/* kankakari: the passage and the lamp.
   Each room is a photograph; upright photographs stand whole beside a close view of themselves,
   wide ones take the whole screen. The room's darkest and lightest tones are the page and the type. */
:root {
  --dark: #17130f;
  --light: #ece4d6;
  --ink: var(--light);
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --gut: clamp(16px, 3vw, 48px);
  --ease: cubic-bezier(.2, .7, .15, 1);
  --slow: 1.4s;
  --latW: 44vw;
}
* { box-sizing: border-box; }
html { background: #14110e; color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--dark); color: var(--ink); font: 400 16px/1.7 var(--serif); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 50; padding: 8px 12px; background: var(--dark); color: var(--light); }
.skip:focus { top: 8px; }
html[lang="en"] [lang="ja"].t, html[lang="ja"] [lang="en"].t { display: none; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }

/* ---------- chrome: three words and the house's hour ---------- */
.chrome { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px var(--gut); pointer-events: none; color: var(--ink); font: 11px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  text-shadow: 0 0 16px var(--halo, rgba(0,0,0,.6)), 0 0 2px var(--halo, rgba(0,0,0,.4)); transition: color 1.2s var(--ease); }
.chrome::before { content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(color-mix(in srgb, var(--halo, #000) 55%, transparent), transparent); }
.chrome a, .chrome button { pointer-events: auto; }
.mark { font: 400 20px/1 var(--serif); letter-spacing: .14em; text-transform: none; }
.chrome nav { display: flex; gap: 22px; align-items: baseline; }
.chrome button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-transform: none; text-shadow: inherit; }
.status { opacity: .78; text-transform: none; letter-spacing: .08em; }
.status .more { display: none; }

/* ---------- a photograph ---------- */
.ph { margin: 0; position: absolute; inset: 0; background-size: contain; background-position: center; background-repeat: no-repeat; overflow: hidden; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: var(--focus, 50% 50%); }
.ph.fill img, .ph.cover img { object-fit: cover; }
.ph.fill { background-size: cover; }
.ph img.base { opacity: 0; transform: scale(1.035);
  transition: opacity 1.6s var(--ease), transform 2.4s var(--ease); }
.ph img.base.in { opacity: 1; transform: none; }
/* the lamp: a small round window moved by transform; its soft edge is a static mask, so nothing repaints */
.ph .lamp-w { position: absolute; left: 0; top: 0; z-index: 1; overflow: hidden; pointer-events: none; opacity: 0; will-change: transform;
  transition: opacity .9s var(--ease); contain: strict;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 0%, rgba(0,0,0,.5) 40%, transparent 72%);
          mask-image: radial-gradient(circle closest-side, #000 0%, rgba(0,0,0,.5) 40%, transparent 72%); }
.ph .lamp-w img.lit { inset: auto; left: 0; top: 0; max-width: none; will-change: transform; filter: brightness(var(--lamp, 1.6)) contrast(.94) saturate(1.06); }
.ph.lamp .lamp-w { opacity: 1; }

/* ---------- rooms ---------- */
.room { position: relative; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; isolation: isolate;
  background-color: var(--dark); background-size: cover; background-position: center; color: var(--light); }
.room > a.fill { position: absolute; inset: 0; z-index: 3; }
/* upright photograph whole on one side, its close view filling the other */
.room.pair { display: grid; grid-template-columns: 1fr auto; }
.room.pair.side-l { grid-template-columns: auto 1fr; }
.room.pair .ph { position: relative; inset: auto; height: 100%; aspect-ratio: var(--ar, .75); max-width: 62vw; }
.room.pair.side-l .ph { order: -1; }
.room.pair .close { position: relative; overflow: hidden; }
.room.pair .close img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82) saturate(.95); transform: scale(1.06);
  transition: transform 3s var(--ease), filter 1.6s var(--ease); }
.room.pair.seen .close img { transform: none; }
.room.bright.pair .close img { filter: none; }

/* label: date in small capitals, the name large, nothing else */
.label { position: absolute; z-index: 4; left: var(--gut); bottom: var(--gut); max-width: min(30em, 80vw); pointer-events: none;
  text-shadow: 0 0 24px color-mix(in srgb, var(--dark) 85%, transparent), 0 0 3px color-mix(in srgb, var(--dark) 60%, transparent);
  opacity: 0; transform: translateY(14px); transition: opacity 1.1s var(--ease) .25s, transform 1.4s var(--ease) .25s; }
.room.seen .label, .room.hero .label { opacity: 1; transform: none; }
.room.pair.side-l .label { left: auto; right: var(--gut); text-align: right; }
.label a { pointer-events: auto; }
.when { display: block; font: 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .86; }
.when b { font-weight: 400; margin-right: 1.2em; }
.label h2, .label h1 { margin: .28em 0 0; font-weight: 400; font-size: clamp(30px, 4.2vw, 64px); line-height: 1.04; letter-spacing: .01em; }
html[lang="ja"] .label h2, html[lang="ja"] .label h1 { letter-spacing: .08em; }
.label.big h1 { font-size: clamp(36px, 5.6vw, 88px); }
.label .title { margin: .5em 0 0; font-size: clamp(15px, 1.4vw, 19px); opacity: .9; }

/* ---------- the opening room: the lattice and the house ---------- */
.room.hero { display: grid; grid-template-columns: 1fr auto; }
.room.hero .ph { position: relative; inset: auto; height: 100%; aspect-ratio: .75; }
.lattice { position: relative; display: flex; gap: 2px; padding: 0 2px 0 0; height: 100%; min-width: 0; background: var(--dark); }
.lattice a { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; background: var(--c, #222); transition: flex-grow .7s var(--ease); }
.lattice a img { position: absolute; top: 0; left: 50%; height: 100%; object-fit: cover; transform: translateX(-50%); pointer-events: none; }
.lattice a img.rest { width: 44px; filter: brightness(.62) saturate(.9); transition: filter .7s var(--ease); }
.lattice a img.wide { width: 250px; opacity: 0; transition: opacity .5s var(--ease); }
.lattice a:hover img.rest, .lattice a:focus-visible img.rest { filter: none; }
.lattice a:hover img.wide.ready, .lattice a:focus-visible img.wide.ready { opacity: 1; }
.lattice a.is-now img.rest { filter: brightness(.95); }
.lattice a > span { position: absolute; left: 12px; bottom: 14px; font: 11px/1.4 var(--sans); letter-spacing: .1em; color: #f3ede3; white-space: nowrap;
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .6s var(--ease); text-shadow: 0 0 10px rgba(0,0,0,.95); }
.lattice a span b { display: block; font-weight: 400; opacity: .8; letter-spacing: .2em; }
.lattice a:hover > span, .lattice a:focus-visible > span { opacity: 1; transform: none; }
.intro { position: absolute; z-index: 5; left: var(--gut); top: 50%; transform: translateY(-50%); pointer-events: none;
  text-shadow: 0 0 30px rgba(0,0,0,.9), 0 0 4px rgba(0,0,0,.6); color: #f1eadf; }
.intro a { pointer-events: auto; }
.intro h1 { margin: 0; font-weight: 400; font-size: clamp(48px, 7.2vw, 120px); line-height: .95; letter-spacing: .08em; }
.intro .line { margin: 18px 0 0; font: 11px/1.5 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.now { display: inline-flex; gap: .7em; align-items: baseline; margin-top: 28px; padding: 10px 16px 9px; font-size: 17px;
  background: color-mix(in srgb, #0d0b09 72%, transparent);
  border: 1px solid rgba(241,234,223,.28); text-shadow: none; transition: background .4s; }
.now:hover { background: color-mix(in srgb, #0d0b09 82%, transparent); }
.now b { font: 10px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; font-weight: 400; color: #d9c7a6; }
.now i { font: 12px/1 var(--sans); font-style: normal; letter-spacing: .08em; opacity: .8; }

/* ---------- calendar and visit: few words on the wall of a photograph ---------- */
.wall { position: absolute; z-index: 4; left: var(--gut); bottom: var(--gut); max-width: min(30em, calc(100vw - 2 * var(--gut)));
  padding: 26px 30px 24px; background: color-mix(in srgb, var(--dark) 84%, transparent); }
.wall h2 { margin: 0 0 14px; font: 11px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.wall ul { list-style: none; margin: 0; padding: 0; }
.wall li { font-size: clamp(18px, 1.7vw, 24px); line-height: 1.35; padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--light) 18%, transparent); }
.wall li:first-child { border-top: 0; }
.wall li .d { display: inline-block; min-width: 7.5em; font: 12px/1 var(--sans); letter-spacing: .12em; opacity: .8; }
.wall li.on .d::after { content: " ●"; color: #d9c7a6; }
.wall p { margin: 0 0 8px; font-size: 16px; }
.wall a { border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent); }
.wall details { margin-top: 12px; font-size: 14px; }
.wall summary { cursor: pointer; font: 11px/1.6 var(--sans); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.wall details p { font-size: 14px; margin-top: 8px; }

/* ---------- exhibition page ---------- */
.facts-band { background: var(--dark); color: var(--light); padding: 22px var(--gut) 20px; display: flex; flex-wrap: wrap; gap: 10px 40px;
  align-items: baseline; justify-content: space-between; }
.facts { margin: 0; font: 12px/1.6 var(--sans); letter-spacing: .1em; opacity: .9; }
.read { flex: 1 1 100%; }
.read summary { list-style: none; cursor: pointer; display: inline-block; font: 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  border-bottom: 1px solid color-mix(in srgb, var(--light) 50%, transparent); padding-bottom: 4px; }
.read summary::-webkit-details-marker { display: none; }
.read summary::after { content: " +"; }
.read[open] summary::after { content: " −"; }
.read .body { max-width: 40em; margin: 34px auto 30px; }
.read p { margin: 0 0 1.1em; font-size: 17px; line-height: 1.95; }
.read p[lang="ja"] { font-size: 16px; line-height: 2.15; letter-spacing: .05em; text-align: justify; }
.read .note, .read .sig { font: 12px/1.7 var(--sans); letter-spacing: .08em; opacity: .85; }
.room.solo, .room.duo { height: 100vh; height: 100svh; }
.room.solo .ph { inset: 4vh 4vw; }
.room.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background-color: var(--dark); }
.room.duo .ph { position: relative; inset: auto; }
.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--dark); }
.details img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--dark); }
.next a { position: relative; height: 62vh; min-height: 300px; overflow: hidden; background: var(--c); }
.next a img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.6); transform: scale(1.02);
  transition: filter .8s var(--ease), transform 1.6s var(--ease); }
.next a:hover img, .next a:focus-visible img { filter: brightness(.95); transform: none; }
.next a > span { position: absolute; left: var(--gut); bottom: var(--gut); z-index: 1; color: #f3ede3; text-shadow: 0 0 18px rgba(0,0,0,.9);
  font-size: clamp(24px, 2.6vw, 40px); line-height: 1.1; }
.next a small { display: block; margin-bottom: 8px; font: 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .85; }

footer.end { padding: 22px var(--gut) 26px; font: 11px/1.7 var(--sans); letter-spacing: .1em; background: var(--dark); color: var(--light);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; opacity: .85; }
footer.end a { border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent); }

/* bright photographs: ground is their lightest tone, ink their darkest; no lamp */
.room.bright .label { text-shadow: 0 0 24px color-mix(in srgb, var(--dark) 90%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .ph img.base { opacity: 1; transform: none; filter: none; }
  .ph .lamp-w { display: none; }
  .label { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* a floor of the room's own dark under the words */
.room.wide::after, .room.pair::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: 2; pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--dark) 72%, transparent)); }
.room.pair::after { display: none; }
.room.calendar::after, .room.visit::after { display: none; }

/* ================= phone: its own reading mode =================
   A vertical feed: every photograph at its own shape, full width, never cropped, never letterboxed in blur;
   the words sit under the photograph on the room's own dark, not over it. */
@media (max-width: 720px), (max-height: 500px) and (orientation: landscape) {
  .room:not(.hero) { height: auto; min-height: 0; display: block; background-image: none !important; overflow: visible; }
  .room:not(.hero)::after { display: none; }
  .room:not(.hero) .ph { position: relative; inset: auto; width: 100%; height: auto; max-width: none; aspect-ratio: var(--ar);
    max-height: 100svh; margin: 0 auto; background-image: none !important; }
  .room:not(.hero) .ph img { object-fit: contain; }
  .room.pair { display: block; }
  .room.pair .close { display: none; }
  .room:not(.hero) .label, .room.pair.side-l .label { position: relative; left: auto; right: auto; bottom: auto; max-width: none; text-align: left;
    padding: 16px 16px 40px; text-shadow: none; transform: translateY(8px); }
  .room.seen .label { transform: none; }
  .label h2, .label h1 { font-size: 30px; line-height: 1.12; }
  .label.big h1 { font-size: 36px; }
  .label .title { font-size: 15px; }
  .room.solo .ph { inset: auto; }
  .room.duo { display: block; height: auto; }
  .room.duo .ph + .ph { margin-top: 2px; }
  .room.solo, .room.duo { height: auto; padding-bottom: 2px; }
  .room.calendar .ph, .room.visit .ph { aspect-ratio: 4 / 3; }
  .room.calendar .ph img, .room.visit .ph img { object-fit: cover; }
  .room.visit .ph { aspect-ratio: 4 / 5; }
  .wall { position: relative; left: auto; right: auto; bottom: auto; max-width: none; margin: 0; padding: 22px 16px 40px;
    background: var(--dark); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .wall li .d { display: block; margin-bottom: 2px; }
  .facts-band { padding: 4px 16px 26px; display: block; }
  .facts { margin-bottom: 16px; }
  .read summary { padding: 10px 0 6px; }
  .read .body { margin: 24px 0 8px; }
  .read p { font-size: 16px; line-height: 1.9; }
  .read p[lang="ja"] { font-size: 15px; }
  .details { grid-template-columns: repeat(3, 1fr); }
  .next { grid-template-columns: 1fr 1fr; }
  .next a { height: auto; min-height: 0; aspect-ratio: 3 / 4; }
  .next a > span { left: 12px; right: 12px; bottom: 14px; font-size: 20px; }
  footer.end { padding: 20px 16px 28px; display: block; }
  footer.end > * { display: block; margin-bottom: 6px; }
}
@media (max-width: 720px) {
  .chrome { padding: 14px 16px; }
  .chrome nav { gap: 16px; }
  .mark { font-size: 18px; }
  .status { display: none; }
  .chrome a, .chrome button { padding: 6px 0; }
  /* the opening room stays a full screen: the house above, the lattice as a strip you can swipe */
  .room.hero { display: block; height: 100svh; min-height: 560px; }
  .room.hero .ph { position: absolute; inset: 0 0 108px 0; height: auto; aspect-ratio: auto; background-size: cover; }
  .room.hero .ph img { object-fit: cover; }
  .room.hero .lattice { position: absolute; left: 0; right: 0; bottom: 0; height: 108px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; padding: 2px 0 0; gap: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .room.hero .lattice::-webkit-scrollbar { display: none; }
  .lattice a { flex: 0 0 52px; scroll-snap-align: start; }
  .lattice a:hover, .lattice a:focus-visible { flex: 0 0 52px; }
  .lattice a > span { display: none; }
  .lattice a img.rest { width: 100%; filter: brightness(.85); }
  .lattice a img.wide { display: none; }
  .intro { top: auto; bottom: 128px; transform: none; left: 16px; right: 16px; }
  .intro h1 { font-size: clamp(44px, 14vw, 60px); }
  .intro .line { margin-top: 12px; font-size: 10px; letter-spacing: .18em; }
  .now { font-size: 15px; margin-top: 16px; padding: 10px 14px 9px; max-width: 100%; flex-wrap: wrap; }
}
/* phone held sideways: the opening room keeps the lattice beside the house, just smaller type */
@media (max-height: 500px) and (orientation: landscape) {
  .room.hero { min-height: 0; }
  .intro h1 { font-size: 44px; }
  .intro .line { margin-top: 8px; }
  .now { margin-top: 12px; font-size: 14px; }
  .chrome { padding: 10px var(--gut); }
}
.label h1, .label h2 { text-wrap: balance; }
html[lang="ja"] .label h1, html[lang="ja"] .label h2 { word-break: keep-all; line-break: strict; }
@media (max-width: 720px), (max-height: 500px) and (orientation: landscape) {
  .room:not(.hero) .label.big { padding-bottom: 10px; }
}
/* phone header: a solid band in the colour of the room in view, tucked away while scrolling down */
@media (max-width: 720px), (max-height: 500px) and (orientation: landscape) {
  .chrome { align-items: center; padding-top: 10px; padding-bottom: 10px; text-shadow: none;
    background: color-mix(in srgb, var(--halo, #17130f) 95%, transparent);
    transition: transform .45s var(--ease), background-color .8s var(--ease), color .8s var(--ease); }
  .chrome::before { display: none; }
  .chrome.tuck { transform: translateY(-100%); }
  .room.hero .ph { top: 0; }
  main > .room:first-child:not(.hero) { padding-top: 52px; }
}
@media (prefers-reduced-motion: reduce) { .chrome.tuck { transform: none; } }
/* close views cut from small originals: a deliberate soft focus instead of enlarged pixels */
.room.pair .close.soft img { filter: blur(2px) brightness(.78) saturate(.95); transform: scale(1.04); }
.room.pair.seen .close.soft img { transform: scale(1.02); }
