:root {
  --siv-zh-serif: "SivSerif", "Songti SC", "STSongti-SC-Regular", STSong, "Noto Serif CJK SC", "Source Han Serif SC", serif;
}
:lang(zh), [lang^="zh"] { font-synthesis: none; }
html[lang^="zh"] body { font-family: var(--siv-zh-serif); }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
.siv-offscreen, .siv-offscreen * { animation-play-state: paused !important; }
html.siv-page-hidden *, html.siv-page-hidden *::before, html.siv-page-hidden *::after { animation-play-state: paused !important; }

body[data-siv-site="weddings"] .play-button,
body[data-siv-site="weddings"] .case-film-play > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  line-height: 0;
}
body[data-siv-site="weddings"] .play-button .siv-ui-icon,
body[data-siv-site="weddings"] .case-film-play > span .siv-ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  vertical-align: 0;
}

body[data-siv-site="photography"] .book-controls > button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  line-height: 0;
}
body[data-siv-site="photography"] .book-controls > button .siv-ui-icon {
  display: block;
  margin: 0;
}

@media (min-width: 701px) {
  body[data-siv-site="legless-birds"] .reader-stage {
    inset: 68px 0 48px;
  }
  /* PageFlip derives height from spread width. Cap that width so the scaled
     1040:738 spread also fits between the stage's vertical padding. */
  body[data-siv-site="legless-birds"] .flipbook-shell {
    max-width: calc(154.4dvh - 195px);
  }
}

@media (hover: none) and (pointer: coarse) {
  button:focus:not(:focus-visible), a:focus:not(:focus-visible), [role="button"]:focus:not(:focus-visible) {
    outline: 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 700px) {
  body[data-siv-site="travel-proposal"] .hero-copy h1 {
    max-width: 9em;
    font-family: var(--siv-zh-serif);
    font-size: clamp(46px, 15vw, 68px);
    letter-spacing: -.055em;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  body[data-siv-site="legless-birds"] .arrival { min-height: 100svh; }
  body[data-siv-site="legless-birds"] .arrival-copy {
    min-height: 36svh;
    padding-bottom: 8px;
  }
  body[data-siv-site="legless-birds"] .arrival h1 span { font-size: clamp(48px,15vw,62px); }
  body[data-siv-site="legless-birds"] .book-stage { min-height: 64svh; margin-top: 0; }
  body[data-siv-site="legless-birds"] .arrival-actions {
    top: auto;
    bottom: max(16px,env(safe-area-inset-bottom));
  }
  body[data-siv-site="legless-birds"] .stage-hint {
    right: 18px;
    left: 18px;
    bottom: 52px;
    text-align: center;
    white-space: nowrap;
  }
  body[data-siv-site="legless-birds"] .design-note { content-visibility: visible; }
  body[data-siv-site="legless-birds"] .design-note-book,
  body[data-siv-site="legless-birds"] .design-note-image,
  body[data-siv-site="legless-birds"] .design-note-image img {
    display: block;
    visibility: visible;
    content-visibility: visible;
  }
  body[data-siv-site="legless-birds"] .reader-header,
  body[data-siv-site="legless-birds"] .reader-footer { background: rgba(22,24,18,.82); }
  body[data-siv-site="legless-birds"] .reader-stage {
    inset: 60px 0 50px;
    padding: 4px 8px 52px;
    overflow: visible;
  }
  body[data-siv-site="legless-birds"] .flipbook-shell {
    width: 100%;
    height: 100%;
    transform: scale(.74);
  }
  body[data-siv-site="legless-birds"] .page-flip-book { max-width: 100%; max-height: 100%; }
  body[data-siv-site="legless-birds"] .page-arrow {
    z-index: 40;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  body[data-siv-site="legless-birds"] .stf__parent,
  body[data-siv-site="legless-birds"] .stf__block,
  body[data-siv-site="legless-birds"] .stf__item,
  body[data-siv-site="legless-birds"] .flip-page {
    backface-visibility: hidden;
    transform-style: preserve-3d;
    will-change: transform;
  }
  body[data-siv-site="legless-birds"] .flip-page img { transform: translateZ(0); }

  body[data-siv-site="zhiyuan"] .hero h1 {
    width: 100%;
    max-width: 100%;
    font-family: var(--siv-zh-serif);
    font-size: clamp(34px, 8.6vw, 42px);
    line-height: 1.34;
    overflow-wrap: anywhere;
  }
  body[data-siv-site="zhiyuan"] .hero h1 em {
    display: block;
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
  }
  body[data-siv-site="zhiyuan"] .object-stage,
  body[data-siv-site="zhiyuan"] .scene-camera {
    isolation: isolate;
    -webkit-perspective: 1800px;
    perspective: 1800px;
  }
  body[data-siv-site="zhiyuan"] .giftbox,
  body[data-siv-site="zhiyuan"] .giftbox *,
  body[data-siv-site="zhiyuan"] .dn-model {
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
  }
  body[data-siv-site="zhiyuan"] .dn-model {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    will-change: transform;
  }
  body[data-siv-site="zhiyuan"] .dn-face {
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
  }
  body[data-siv-site="zhiyuan"] #structureBox[data-siv-scene="1"] .dn-side-body > .dn-face,
  body[data-siv-site="zhiyuan"] #structureBox[data-siv-scene="1"] .dn-side-inner {
    display: none;
  }
  body[data-siv-site="zhiyuan"] #structureBox {
    pointer-events: auto;
    touch-action: pan-y;
  }
  body[data-siv-site="zhiyuan"] .process-dieline img,
  body[data-siv-site="zhiyuan"] .process-views img,
  body[data-siv-site="zhiyuan"] .form-study img {
    width: 100%;
    height: auto;
    object-fit: contain !important;
  }

  body[data-siv-site="weddings"] .close-detail,
  body[data-siv-site="weddings"] #closeLightbox,
  body[data-siv-site="weddings"] #closeExplore {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    border: 0 !important;
    outline: 0;
    box-shadow: none !important;
  }
  body[data-siv-site="weddings"] .case-image { background: #eceae4; }
  body[data-siv-site="weddings"] .case-image img { content-visibility: auto; }
  body[data-siv-site="weddings"] .film-tag,
  body[data-siv-site="weddings"] .case-film-play > span { font-family: Arial, sans-serif !important; }
  body[data-siv-site="weddings"] .play-button .siv-ui-icon,
  body[data-siv-site="weddings"] .case-film-play > span .siv-ui-icon {
    transform: translate(1px, 0);
  }
  body[data-siv-site="weddings"] #playFeatured .siv-ui-icon,
  body[data-siv-site="weddings"] #playDetail > span .siv-ui-icon {
    transform: translate(1px, 0) !important;
  }
  body[data-siv-site="photography"] .camera-prop {
    left: 50% !important;
    width: min(100vw, 430px) !important;
    max-width: 100vw;
    transform: translateX(-50%) !important;
    overflow: visible;
  }
  body[data-siv-site="photography"] #cameraCanvas { width: 100% !important; max-width: 100vw; }
  body[data-siv-site="photography"] .preview-stage { aspect-ratio: auto; min-height: 0; }
  body[data-siv-site="photography"] .preview-stage img { object-fit: contain; max-height: calc(100svh - 150px); }
  body[data-siv-site="photography"] .album-skill-frame { max-width: 100%; max-height: 100%; }
  body[data-siv-site="photography"] .story-nav [data-story-close] {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid currentColor !important;
    border-radius: 999px;
    box-shadow: none !important;
    outline: 0 !important;
  }
  body[data-siv-site="photography"] .book-dialog button:focus:not(:focus-visible),
  body[data-siv-site="photography"] .image-dialog button:focus:not(:focus-visible) { outline: 0 !important; }
  body[data-siv-site="photography"] #closeBook {
    -webkit-appearance: none;
    appearance: none;
    padding: 10px 14px;
    border: 1px solid #5b6255;
    border-radius: 999px;
    background: #5b6255 !important;
    background-color: #5b6255 !important;
    color: #f2eee3;
    opacity: 1;
    outline: 0 !important;
    box-shadow: none !important;
  }

  dialog::backdrop,
  .chapter-panel,
  .callout,
  .siv-return,
  .viewer-toolbar,
  .viewer-status,
  .book-controls { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  img { content-visibility: auto; }
}

