@property --wall { syntax: "<color>"; inherits: true; initial-value: #f6f3ec; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #29251f; }
@property --dim { syntax: "<color>"; inherits: true; initial-value: #6e675c; }
:root {
  --wall: #f6f3ec;
  --ink: #29251f;
  --dim: #6e675c;
  --accent: #c8402e;
  --rule: color-mix(in srgb, var(--dim) 28%, transparent);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
  background: var(--wall);
  color: var(--ink);
  font: 106.25%/1.6 var(--serif);  /* not 1.0625rem: while the walls change colour, Safari reads a rem here against
                                      this very size, frame after frame, and the type swells */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  transition: --wall 1.6s ease, --ink 1.6s ease, --dim 1.6s ease;
}
:root:has(.viewer[open]) { overflow: hidden; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
code, pre { font-family: var(--mono); font-size: .85em; }
pre { padding: 1rem 1.25rem; background: color-mix(in srgb, var(--ink) 4%, transparent); line-height: 1.6; white-space: pre-wrap;
  overflow-wrap: anywhere; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.numeral { letter-spacing: .08em; }

.hero { display: grid; grid-template: "bar bar" auto "picture words" minmax(0, 1fr) / 1fr 1fr; height: 100svh; min-height: 36rem; }
.bar { grid-area: bar; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 2rem;
  padding: 1.2rem 4vw; border-bottom: 1px solid var(--rule); font-size: .8rem; font-variant-caps: all-small-caps;
  letter-spacing: .18em; white-space: nowrap; }
.bar a { text-decoration: none; }
.bar a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.mark { font-size: 1rem; letter-spacing: .22em; text-transform: uppercase; }
.bar nav { display: flex; gap: 1.5rem; margin-left: auto; }
.repo::after { content: "\2009\2197"; }
.picture { grid-area: picture; display: block; min-height: 0; overflow: hidden; }
.picture img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  background: 50% 40% / cover; }
.words { grid-area: words; display: flex; flex-direction: column; justify-content: center; padding: 2rem 7vw 2rem 6vw; }
.words p { margin: 0; }
.kicker { color: var(--dim); font-size: .8rem; font-variant-caps: all-small-caps; letter-spacing: .18em; }
.hero h1 { margin: .9rem 0 0; font-size: clamp(2.6rem, 4.3vw, 4.2rem); font-weight: 400; line-height: 1.1; letter-spacing: .08em;
  text-transform: uppercase; }
.words .sub { margin-top: 1.4rem; font-size: 1.2rem; font-style: italic; line-height: 1.45; }
.words .ways { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.3rem; }
.ways a { padding: .7rem 1.25rem; border: 1px solid var(--ink); font-size: .95rem; text-decoration: none; }
.ways a:first-child { background: var(--ink); color: var(--wall); }
.ways a:hover { border-color: var(--accent); }
.words .credit { margin-top: 3.2rem; color: var(--dim); font-size: .8rem; }

.intro { padding: clamp(3rem, 9vh, 5.5rem) 1.25rem 0; }
.text { max-width: 33em; margin: clamp(3.5rem, 10vh, 6rem) auto 0; }
.text p { margin: 0 0 1.1em; }
.text p:first-child::first-letter { float: left; margin: .06em .1em 0 0; color: var(--accent); font-size: 3.55em; line-height: .82; }
.screen { position: relative; width: min(100%, 60rem); margin: 0 auto; }
.film { display: block; width: 100%; height: auto; background: #090807; box-shadow: 0 1.2rem 2.2rem -1.2rem rgb(0 0 0 / .45); }
.play { position: absolute; inset: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: none; cursor: pointer; }
.play::before { content: ""; position: absolute; left: clamp(.8rem, 2.5%, 1.6rem); bottom: clamp(.8rem, 4%, 1.6rem); width: 3.6rem;
  height: 3.6rem; border-radius: 50%; background: rgb(246 243 236 / .92); transition: scale .4s cubic-bezier(.2, .7, .3, 1); }
.play::after { content: ""; position: absolute; left: calc(clamp(.8rem, 2.5%, 1.6rem) + 1.42rem); bottom: calc(clamp(.8rem, 4%, 1.6rem) + 1.2rem);
  border: solid transparent; border-width: .6rem 0 .6rem 1rem; border-left-color: #29251f; }
.play:hover::before { scale: 1.08; }
.screen figcaption { margin-top: .9rem; color: var(--dim); font-size: .85rem; font-style: italic; text-align: center; }
.plan { max-width: 54rem; margin: clamp(5rem, 14vh, 8rem) auto 0; }
.plan ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.plan a { display: grid; grid-template: "num name strip" auto "num about strip" auto "num count strip" 1fr / 2.4rem minmax(0, 14rem) minmax(0, 1fr);
  column-gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.plan .numeral { grid-area: num; color: var(--accent); font-size: 1.1rem; line-height: 1.6; }
.plan .name { grid-area: name; font-size: 1.1rem; font-variant-caps: all-small-caps; letter-spacing: .14em; line-height: 1.6; }
.plan a:hover .name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .3em; }
.plan .about { grid-area: about; color: var(--dim); font-size: .9rem; font-style: italic; line-height: 1.4; }
.plan .count { grid-area: count; margin-top: .5rem; color: var(--dim); font-size: .8rem; }
.strip { grid-area: strip; align-self: center; display: flex; gap: .6rem; align-items: center; padding: 1rem 1.1rem; background: var(--door);
  box-shadow: inset 0 0 0 1px var(--rule); }
.strip img { flex: var(--a) 1 0; min-width: 0; height: auto; aspect-ratio: var(--a); box-shadow: 0 .35rem .6rem -.25rem rgb(0 0 0 / .45);
  background-size: 100% 100%; transition: translate .5s cubic-bezier(.2, .7, .3, 1); }
.plan a:hover .strip img { translate: 0 -3px; }
@media (max-width: 40rem) {
  .plan a { grid-template: "num name" auto "num about" auto "num count" auto "strip strip" auto / 2rem minmax(0, 1fr); column-gap: .6rem; }
  .strip { margin-top: 1rem; padding: .8rem; gap: .45rem; }
}
.marker { position: fixed; top: .7rem; left: .7rem; z-index: 5; font-size: .8rem; font-variant-caps: all-small-caps; letter-spacing: .16em;
  opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.marker.on { opacity: 1; pointer-events: auto; }
.marker summary { padding: .3rem .85rem; border-radius: 1rem; background: color-mix(in srgb, var(--wall) 88%, transparent);
  box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink); cursor: pointer; list-style: none; }
.marker summary::-webkit-details-marker { display: none; }
.marker summary::after { content: "  \25BE"; color: var(--dim); }
.marker[open] summary::after { content: "  \25B4"; }
.marker ol { margin: .4rem 0 0; padding: .5rem .9rem; list-style: none; background: var(--wall);
  box-shadow: inset 0 0 0 1px var(--rule), 0 .8rem 1.6rem -.8rem rgb(0 0 0 / .5); }
.marker a { display: block; padding: .3rem 0; color: var(--ink); text-decoration: none; }
.marker a:hover { color: var(--accent); }
.marker .numeral { display: inline-block; min-width: 2.4em; color: var(--accent); }
@media (max-width: 52rem) { .bar nav { display: none; } }

main { max-width: 84rem; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
.room > header { padding: clamp(10rem, 30vh, 18rem) 0 clamp(4rem, 11vh, 7rem); text-align: center; }
.room h2 { margin: 0; font-size: 1.6rem; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: .18em; }
.room h2 .numeral { display: block; margin-bottom: .5rem; color: var(--accent); font-size: 2.6rem; font-variant-caps: normal; letter-spacing: .04em; }
.room header p { margin: .5rem 0 0; color: var(--dim); font-style: italic; }
.row { margin: 0 0 clamp(6rem, 18vh, 11rem); }
.work { margin: 0; }
.plate { display: block; }
.plate img { display: block; width: 100%; height: auto; box-shadow: 0 .9rem 1.6rem -.6rem rgb(0 0 0 / .45);
  background-size: 100% 100%; transition: transform .6s cubic-bezier(.2, .7, .3, 1); }
.plate:hover img { transform: translateY(-3px); }
.row.left .work, .row.right .work { display: grid; gap: 1.75rem 3.5rem; align-items: end; }
.row.left .work { grid-template-columns: minmax(0, 1fr) 15rem; }
.row.right .work { grid-template-columns: 15rem minmax(0, 1fr); }
.row.right .label { order: -1; }
.row.left .plate { width: min(100%, calc(80svh * var(--a))); }
.row.right .plate { width: min(100%, calc(68svh * var(--a))); justify-self: end; }
.row.pair { display: flex; gap: clamp(2rem, 5vw, 5rem); align-items: flex-start; max-width: min(100%, calc(62svh * var(--sum) + 5rem));
  margin-inline: auto; }
.row.pair .work { flex: var(--a) 1 0; min-width: 0; display: grid; align-content: start; gap: 1.4rem; }
.row.long .work { display: grid; gap: 1.6rem; }
.row.long .label { max-width: 34rem; }
.js .work { opacity: 0; transform: translateY(2.5rem); transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2, .7, .3, 1); }
.js .work.seen { opacity: 1; transform: none; }
.js .row.pair .work + .work { transition-delay: .18s; }

.label { color: var(--dim); font-size: .9rem; line-height: 1.5; }
figcaption.label { max-width: 32rem; }
.label h3 { margin: 0 0 .3rem; color: var(--ink); font-size: 1.05rem; font-weight: 400; }
.label p { margin: 0; }
.label .note { margin-top: 1rem; color: var(--ink); }
.label .source { margin-top: 1rem; font-size: .8rem; }
.label .full, .viewer .label .short { display: none; }
.viewer .label .full { display: block; }
.source a { font-family: var(--mono); }

.colophon { max-width: 33em; margin: 0 auto; padding: clamp(8rem, 24vh, 14rem) 1.25rem 6rem; color: var(--dim); }
.colophon h2 { color: var(--ink); font-size: 1.2rem; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: .16em; text-align: center; }

.viewer { inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  overflow: hidden; overscroll-behavior: contain; background: var(--wall); color: var(--ink); }
.viewer::backdrop { background: rgb(12 11 10 / .9); }
.viewer[open] { display: grid; grid-template: "stage caption" minmax(0, 1fr) / minmax(0, 1fr) 21rem; animation: enter .3s ease-out; }
@keyframes enter { from { opacity: 0; } }
.stage { grid-area: stage; position: relative; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage.held { cursor: grabbing; }
.stage img { display: block; background-size: 100% 100%; -webkit-user-drag: none; }
.viewer:not(.scroll) .stage img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; }
.caption { grid-area: caption; align-self: end; max-height: 100%; overflow-y: auto; padding: 2rem 2.5rem 2.5rem 1.5rem; color: var(--dim); }
.where, .hint { margin: 0; font-size: .8rem; font-variant-caps: all-small-caps; letter-spacing: .12em; }
.where { margin-bottom: 1.25rem; }
.hint { margin-top: 2rem; opacity: .8; }
.controls { position: fixed; top: .75rem; right: .75rem; display: flex; gap: .25rem; }
.controls button { width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--wall) 60%, transparent);
  color: var(--ink); font: 1.35rem/1 var(--serif); cursor: pointer; }
.controls button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.controls .turn { width: auto; padding: 0 1.1rem; border-radius: 1.4rem; font: .85rem/1 var(--serif); font-variant-caps: all-small-caps;
  letter-spacing: .12em; }
.viewer.scroll[open] { display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.viewer.scroll .caption { flex: 0 0 min(24rem, 80vw); max-height: none; padding: 2rem 2.5rem; }
.viewer.scroll .stage { flex: none; height: 100%; touch-action: pan-x; }
.viewer.scroll .stage img { width: auto; height: 100%; }
.back { grid-area: stage; display: none; min-height: 0; margin: clamp(.75rem, 2.5vw, 2rem); padding: 1.1rem; border-radius: 2px;
  background: linear-gradient(90deg, rgb(255 255 255 / .07), transparent 35%, rgb(0 0 0 / .1)), #9a7b51;
  box-shadow: 0 1.5rem 3rem -1rem rgb(0 0 0 / .55); }
.linen { height: 100%; overflow: auto; overscroll-behavior: contain; padding: clamp(1.5rem, 4vw, 3rem); color: #3b3327;
  background: repeating-linear-gradient(90deg, rgb(90 70 40 / .06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgb(90 70 40 / .05) 0 1px, transparent 1px 3px), #d8ccb3;
  box-shadow: inset 0 0 2.5rem rgb(70 50 20 / .3); }
.linen:focus-visible { outline-offset: -4px; }
.file { margin: 0 0 1.5rem; font-size: .8rem; font-variant-caps: all-small-caps; letter-spacing: .14em; }
.linen pre { margin: 0; padding: 0; overflow: visible; background: none; font-size: .75rem; line-height: 1.55; }
.viewer.turned .stage { display: none; }
.viewer.turned .back { display: block; }
.viewer.scroll.turned[open] { display: grid; overflow: hidden; }

@media (max-width: 52rem), (orientation: portrait) {
  .hero { grid-template: "bar" auto "picture" 46svh "words" auto / minmax(0, 1fr); height: auto; }
  .words { padding: 2.2rem 6vw 3rem; }
  .hero h1 { margin-top: .6rem; font-size: min(9.6vw, 4.2rem); }
  .words .sub { margin-top: .9rem; }
  .words .ways { margin-top: 1.6rem; }
  .words .credit { margin-top: 1.8rem; }
  .room > header { padding: clamp(5rem, 14vh, 8rem) 0 clamp(2.5rem, 6vh, 4rem); }
  .row { margin-bottom: clamp(4rem, 11vh, 6rem); }
  .row.left .work, .row.right .work { grid-template-columns: minmax(0, 1fr); }
  .row.right .label { order: 0; }
  .row.right .plate { justify-self: start; }
  .row.pair { flex-direction: column; max-width: none; }
  .row.pair .work { flex: none; }
  .viewer[open] { padding-top: 3.6rem; }  /* the controls above the work, not over it */
  .viewer[open]:not(.scroll), .viewer.turned[open] { grid-template: "stage" minmax(0, 1fr) "caption" auto / minmax(0, 1fr); }
  .viewer:not(.scroll) .caption, .viewer.turned .caption { max-height: 40vh; padding: 1rem 1.25rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, ::backdrop { animation: none !important; transition: none !important; }
  .js .work { opacity: 1; transform: none; }
}
