:root {
  color-scheme: light;
  --paper: #f4f3ef;
  --ink: #171715;
  --muted: #6d6c67;
  --line: #deddd7;
  --white: #ffffff;
  --accent: #ff552f;
  --radius: 28px;
  --page: min(1440px, calc(100vw - 56px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.dialog-close:active, .enter-button:active { transform: translateY(1px); }

main { width: var(--page); margin: 0 auto; }
.gallery-section { padding: 28px 0 112px; }
.more-note { width: var(--page); margin: -72px auto 28px; color: var(--muted); font: inherit; line-height: 1.5; text-align: right; letter-spacing: normal; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 34px; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 72px); font-weight: 580; letter-spacing: -.055em; line-height: .96; }
.section-heading p { max-width: 410px; margin: 0 0 6px; color: var(--muted); line-height: 1.5; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 22px; }
.scene-card { display: block; min-width: 0; animation: reveal .55s cubic-bezier(.22,.8,.2,1) both; }
.scene-card a { display: block; width: 100%; text-align: left; }
.scene-image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e2e1dc;
  position: relative;
}
.scene-image::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); border-radius: inherit; pointer-events: none; }
.scene-image img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.scene-title { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 4px 0; }
.scene-title strong { font-size: 16px; font-weight: 520; letter-spacing: -.025em; }
.scene-number { color: #9a9993; font-size: 12px; font-variant-numeric: tabular-nums; }

.scene-dialog { width: min(1180px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); padding: 12px; border: 0; border-radius: var(--radius); background: #eeede8; box-shadow: 0 32px 100px rgba(20, 20, 16, .3); overflow: hidden; }
.scene-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 12px; }
.scene-dialog::backdrop { background: rgba(24, 23, 20, .55); backdrop-filter: blur(9px); }
.dialog-media { min-height: min(72vh, 720px); border-radius: 20px; overflow: hidden; background: #d9d8d2; position: relative; }
.dialog-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dialog-transition-image { position: absolute; inset: 0; z-index: 2; }
.scene-dialog.is-flying .dialog-copy, .scene-dialog.is-flying .dialog-close { opacity: 0; }
.dialog-copy, .dialog-close { transition: opacity .22s ease; }
.dialog-copy { padding: clamp(24px, 4vw, 56px) clamp(18px, 3vw, 42px) 28px; display: flex; flex-direction: column; }
.dialog-index { margin: 0 0 auto; color: var(--muted); font-size: 12px; }
.dialog-copy h2 { margin: 28px 0 16px; font-size: clamp(32px, 4vw, 58px); line-height: .95; letter-spacing: -.055em; font-weight: 580; }
.dialog-copy > p:not(.dialog-index) { color: var(--muted); line-height: 1.55; margin: 0 0 32px; }
.dialog-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.dialog-nav button { border: 1px solid #d5d3cc; border-radius: 999px; padding: 12px 14px; background: transparent; cursor: pointer; }
.dialog-nav button:hover { background: rgba(255,255,255,.54); }
.enter-button { border: 0; border-radius: 999px; padding: 15px 18px; background: var(--ink); color: white; display: flex; justify-content: space-between; cursor: pointer; }
.dialog-close { position: absolute; right: 24px; top: 24px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(244,243,239,.86); font-size: 25px; line-height: 1; cursor: pointer; }

@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1000px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --page: calc(100vw - 28px); --radius: 20px; }
  .section-heading { display: block; margin: 20px 0 26px; }
  .section-heading p { margin-top: 16px; }
  .gallery-section { padding: 10px 0 76px; }
  .more-note { margin-top: -44px; margin-bottom: 18px; }
  .gallery { grid-template-columns: 1fr; gap: 28px; }
  .scene-dialog[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .dialog-media { min-height: 46vh; }
  .dialog-copy { padding-top: 16px; }
  .dialog-index { margin-bottom: 8px; }
}

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