.study {
  --serif: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  padding-bottom: 74px;
  background: #f7f4e9;
}
.study header {border-bottom:1px solid #b4a589}
.study .hall-heading h1 {font-weight:500;text-wrap:balance}
.study .hall-heading h1 span {white-space:nowrap}
.study .museum-plaque {background:transparent;color:inherit;border:0;box-shadow:none}
.study .museum-plaque i {letter-spacing:.09em}
.study .museum-plaque p {margin-top:4px}
.study .portrait-mat {min-height:0;grid-template: minmax(0,1fr) / minmax(0,1fr)}
.study .portrait-mat img {max-height:100%}
.study .section-head h2 {font-family:var(--serif)}
.study-switch {
  position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:12;
  display:flex;gap:3px;padding:5px;background:#fffaf0f7;color:#30352e;
  box-shadow:0 4px 24px #211c2830;border:1px solid #c3b394;border-radius:30px;
  font:600 13px/1.3 "Yu Gothic",sans-serif;white-space:nowrap;
}
.study-switch a {border-radius:24px;padding:10px 15px}
.study-switch [aria-current] {background:#264a42;color:#fffaf0}
.study-switch a:hover {text-decoration:underline;text-underline-offset:4px}

/* A pair of illuminated works against a midnight gallery wall. */
.nocturne .portrait-hall {
  display:grid;grid-template-columns: minmax(0,.83fr) minmax(0,1.35fr);align-content:center;
  column-gap:5%;min-height:clamp(560px,72vh,760px);padding-block:70px 88px;text-align:left;
  background:linear-gradient(150deg,#272836,#171827 60%,#272333);
}
.nocturne .portrait-hall:before {background:repeating-linear-gradient(90deg,transparent 0 16.5%,#d6bb8920 16.58%,transparent 16.7%)}
.lantern {position:absolute;inset:-38%;z-index:-1;pointer-events:none;
  background:conic-gradient(from 155deg at 53% 0%,transparent 0deg,#ffe7b820 12deg,#f9d8a350 20deg,transparent 34deg),
    radial-gradient(ellipse at 54% 50%,#daba8640,transparent 35%);
  transform:translateX(var(--lamp,0%));}
.nocturne .hall-heading {grid-column:1;align-self:end}
.nocturne .hall-heading h1 {font-size:clamp(40px,5.1vw,76px);max-width:5.5em;line-height:1.46}
.nocturne .hall-heading p {max-width:25em;margin:15px 0 0;color:#e2d7c1}
.nocturne .exhibit-tools {grid-column:1;justify-content:start;align-self:start}
.nocturne .portrait-wall {grid-column:2;grid-row:1/3;grid-template-columns:repeat(2,minmax(0,1fr));align-self:center;gap:7%}
.nocturne .framed-exhibit:nth-of-type(even) {margin-top:48px}
.nocturne .portrait-mat {aspect-ratio:.82}
.nocturne .gilt-frame {padding:clamp(10px,1.2vw,20px)}
.nocturne .museum-plaque {border-top:1px solid #cbb38588;padding-top:10px}
.nocturne .river-sections {background:linear-gradient(#faf3e4,#eeeadd)}

/* A bound, two-page folio. The right-hand leaf turns around its spine. */
.folio .portrait-hall {
  display:grid;grid-template-columns:1fr 1fr;align-content:center;align-items:center;gap:0 9%;
  color:#473627;text-align:left;background:linear-gradient(90deg,#fbf1db 0%,#f7ecd5 45%,#d0bb96 49.6%,#8d7658 50%,#e5d3b3 50.6%,#fdf6e7 54%,#f4e4c7);
  min-height:560px;padding-block:52px 64px;border-bottom:8px double #9c7955;
}
.folio .paper-edge {position:absolute;inset:16px 2.5%;border:1px solid #a6926b88;pointer-events:none;z-index:-1}
.folio .portrait-hall:before {background:repeating-linear-gradient(0deg,transparent 0 4px,#a78a5e09 4px 5px)}
.folio .hall-heading {grid-column:1;align-self:end}
.folio .hall-heading h1 {max-width:5.3em;font-size:clamp(40px,5.4vw,80px);letter-spacing:.06em}
.folio .hall-heading p {color:#685441;margin-top:18px;max-width:24em;margin-left:0}
.folio .exhibit-tools {grid-column:1;justify-content:start;align-self:start;margin-bottom:12px}
.folio .exhibit-search {color:#443729;border-color:#ac997b}.folio input::placeholder {color:#6c5945}
.folio .folio-controls {grid-column:1;display:flex;align-items:center;gap:15px;margin-top:10px}
.folio .folio-controls[hidden] {display:none}
.folio-controls button {width:44px;height:44px;border-radius:50%;border:1px solid #8e765a;background:#fff7e5;font-size:20px}
.folio-controls button:disabled {opacity:.4}
.folio-controls output {font:italic 18px Georgia,serif;font-variant-numeric:tabular-nums}
.folio .portrait-wall {grid-column:2;grid-row:1/4;grid-template-columns:minmax(0,330px);width:100%;perspective:1050px}
.folio .framed-exhibit {transform-origin:left center;backface-visibility:hidden}
.folio .portrait-mat {aspect-ratio:1.03}
.folio .museum-plaque {border-bottom:1px solid #9e8766}
.folio .river-sections {background:#faf4e6}
.folio .river {opacity:.38}

/* Engraved current lines cross behind the portraits and continue into the river. */
.tide .portrait-hall {background:linear-gradient(148deg,#123f49,#175e65 62%,#237782);padding-bottom:65px}
.tide .portrait-hall:before {background:radial-gradient(ellipse at 27% 65%,#9ff3ce22,transparent 56%)}
.tide .hall-heading h1 {font-size:clamp(35px,5vw,75px);letter-spacing:.08em}
.tide .hall-heading p {color:#e4f7ef}
.tidal-lines {position:absolute;inset:-6% -15%;width:130%;height:118%;color:#9be0cc85;pointer-events:none;z-index:-1}
.tidal-lines path:nth-child(4n) {stroke:#ffefc2;stroke-opacity:.64}
.tide .portrait-wall {gap:clamp(22px,10vw,160px);grid-template-columns:repeat(2,minmax(0,285px));text-align:center}
.tide .framed-exhibit:nth-of-type(odd) {rotate:-3deg}
.tide .framed-exhibit:nth-of-type(even) {rotate:3deg}
.tide .museum-plaque {background:#123f49de;border-radius:3px}
.tide .river-sections {background:linear-gradient(#e8f1e4,#e1f0e7 65%,#f9f4e6)}
.tide .river-sections:before {background:#e8f1e4}

@media (prefers-reduced-motion:no-preference) {
  .nocturne .lantern {animation:sweep-in 2.2s ease-out both;transition:transform .65s ease-out}
  .nocturne .gilt-frame {transition:transform .55s,filter .55s}
  .nocturne .framed-exhibit:is(:hover,:focus-visible) .gilt-frame {transform:perspective(750px) rotateY(-7deg) translateY(-7px);filter:brightness(1.12)}
  .folio .framed-exhibit.turn-next {animation:turn-next .68s cubic-bezier(.16,.74,.2,1) both}
  .folio .framed-exhibit.turn-prev {animation:turn-prev .68s cubic-bezier(.16,.74,.2,1) both}
  .tide .tidal-lines {transform:translateY(var(--current-y,0px)) rotate(var(--current-angle,0deg));transition:transform .12s linear}
  .tide .framed-exhibit {translate:0 var(--float,0px)}
  .tide .framed-exhibit:nth-of-type(even) {translate:0 calc(-1 * var(--float,0px))}
  .tide .water-spark {animation:none;stroke-dashoffset:var(--river-offset,0)}
}
@keyframes sweep-in {from{translate:-27% 0;opacity:.25}to{translate:0 0;opacity:1}}
@keyframes turn-next {from{transform:rotateY(-77deg);filter:brightness(.68);opacity:.55}to{transform:none;filter:none;opacity:1}}
@keyframes turn-prev {from{transform:rotateY(65deg);filter:brightness(.74);opacity:.55}to{transform:none;filter:none;opacity:1}}
@media(max-width:740px) {
  .nocturne .portrait-hall {display:block;min-height:0;text-align:center;padding-block:35px 58px}
  .nocturne .hall-heading h1,.folio .hall-heading h1 {max-width:none;font-size:clamp(28px,6.5vw,43px)}
  .nocturne .hall-heading p {margin-inline:auto}
  .nocturne .exhibit-tools {justify-content:center}
  .nocturne .portrait-wall {max-width:490px;margin:auto;column-gap:8%}
  .nocturne .framed-exhibit:nth-of-type(even) {margin-top:30px}
  .folio .portrait-hall {display:flex;flex-direction:column;text-align:center;gap:0;min-height:0;background:linear-gradient(90deg,#d8c4a0,#fcf2df 6%,#f8edd8 93%,#e5cfad);padding:32px 8% 43px}
  .folio .hall-heading,.folio .exhibit-tools {align-self:center}
  .folio .hall-heading p {margin:8px auto 0}
  .folio .portrait-wall {order:1;grid-template-columns:minmax(0,250px)}
  .folio .folio-controls {order:2;margin-top:12px}
  .folio .exhibit-tools {margin:10px 0 16px}
  .tide .portrait-wall {gap:7%}
}
@media(max-width:410px){.study-switch {font-size:12px}.study-switch a {padding:9px 10px}}
