* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  color: var(--ink);
  background: var(--black);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  font-family: var(--serif);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 78%, white);
  outline-offset: 3px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

.gallery-app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
}

.gallery-app::after {
  position: absolute;
  z-index: 9;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent 7.8%, rgba(109, 37, 29, .045) 8%, transparent 8.2%),
    linear-gradient(rgba(255, 255, 255, .03), rgba(38, 31, 25, .025));
  mix-blend-mode: multiply;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: 10px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--qin-dark);
  font: 700 13px/1 var(--sans);
  transform: translateY(-160%);
  transition: transform .2s ease;
}

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

.global-head {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--head-h) + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding:
    calc(10px + var(--safe-top))
    max(20px, calc((100vw - 1440px) / 2 + 28px))
    10px;
  border-bottom: 1px solid rgba(56, 38, 28, .13);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
  font-family: var(--sans);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}

.brand .brand-back {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--qin);
  opacity: .85;
  white-space: nowrap;
}

.brand:hover .brand-back {
  opacity: 1;
  text-decoration: underline;
}

.brand-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--qin);
}

.head-progress {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 11px/1 var(--sans);
  letter-spacing: .06em;
}

.progress-track {
  width: clamp(52px, 9vw, 120px);
  height: 2px;
  overflow: hidden;
  background: rgba(66, 48, 36, .14);
}

.progress-track i {
  display: block;
  width: 6.6667%;
  height: 100%;
  background: var(--qin);
  transition: width var(--scene-duration) var(--ease);
}

.scene-frame {
  position: absolute;
  z-index: 2;
  top: calc(var(--head-h) + var(--safe-top));
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 56fr) minmax(390px, 44fr);
  overflow: hidden;
  touch-action: pan-y;
  background: var(--paper);
}

.scene-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 10%, rgba(109, 37, 29, .04) 10.2%, transparent 10.4%),
    var(--paper);
}

.scene-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(86, 54, 39, .35) transparent;
  padding: clamp(52px, 8vh, 92px) clamp(32px, 5vw, 78px) 100px;
  scroll-behavior: smooth;
}

.scene-scroll::-webkit-scrollbar {
  width: 5px;
}

.scene-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(86, 54, 39, .3);
}

.scene-copy {
  width: min(100%, 590px);
  margin: 0 auto;
  animation: copy-in var(--scene-duration) var(--ease) both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--qin);
  font: 800 11px/1.45 var(--sans);
  letter-spacing: .17em;
  text-transform: uppercase;
}

.scene-title {
  margin-bottom: 24px;
  font-size: clamp(38px, 4.5vw, 66px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.scene-lead {
  margin-bottom: 22px;
  color: #3c332c;
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.7;
  text-wrap: pretty;
}

.scene-body {
  color: #534940;
  font-size: 16px;
  line-height: 1.82;
}

.scene-body p {
  margin-bottom: 12px;
}

.scene-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  color: var(--muted);
  font: 13px/1.5 var(--sans);
}

.scene-prompt::before {
  width: 28px;
  height: 1px;
  content: "";
  background: var(--qin);
}

.boundary-note {
  margin-top: 26px;
  padding: 14px 0 14px 17px;
  border-left: 2px solid var(--qin);
  color: #5b5047;
  font: 13px/1.72 var(--sans);
}

.closing-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--qin-dark);
  font-size: 17px;
  line-height: 1.72;
}

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

.noscript {
  position: fixed;
  z-index: 200;
  inset: 20px;
  display: grid;
  place-items: center;
  padding: 32px;
  color: var(--white);
  background: var(--qin-dark);
  text-align: center;
}

@keyframes copy-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  :root {
    --head-h: 56px;
    --nav-h: 74px;
  }

  .global-head {
    padding-right: calc(16px + var(--safe-right));
    padding-left: calc(16px + var(--safe-left));
  }

  .brand {
    max-width: 58vw;
  }

  .progress-track {
    width: 52px;
  }

  .scene-frame {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 42fr) minmax(0, 58fr);
  }

  .scene-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .scene-scroll {
    padding: 27px 22px 92px;
  }

  .scene-title {
    margin-bottom: 14px;
    font-size: clamp(26px, 8vw, 36px);
  }

  .scene-lead {
    margin-bottom: 14px;
    font-size: 15.5px;
    line-height: 1.62;
  }

  .scene-body {
    font-size: 14px;
    line-height: 1.7;
  }
}

@media (max-height: 720px) and (max-width: 760px) {
  .scene-frame {
    grid-template-rows: minmax(190px, 38fr) minmax(0, 62fr);
  }

  .scene-scroll {
    padding-top: 22px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .scene-scroll {
    padding-top: 28px;
    padding-right: 28px;
    padding-left: 28px;
  }

  .scene-title {
    margin-bottom: 16px;
    font-size: clamp(31px, 4vw, 48px);
  }

  .scene-lead {
    margin-bottom: 16px;
    font-size: 17px;
  }
}

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