.project-head {
  position: sticky;
  inset-block-start: 0;
  z-index: 6;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.project-bar {
  width: calc(100% - clamp(40px, 9vw, 160px));
  max-width: 1480px;
  margin: auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.project-brand, .project-nav a, .project-menu { color: var(--ink); }
.project-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  text-decoration: none;
}
.project-brand img {
  display: block;
  width: clamp(183px, 22vw, 238px);
  max-width: 100%;
  height: auto;
}
.project-nav { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 24px); }
.project-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}
.project-nav a::before {
  content: "";
  width: .32rem;
  height: .32rem;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  visibility: hidden;
}
.project-nav a:hover { color: var(--ink); }
.project-nav a[aria-current] { color: var(--green); font-weight: 600; }
.project-nav a[aria-current]::before { visibility: visible; }
.research-nav a {
  font-size: .9rem;
  padding-block: 12px;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.research-nav [aria-current], .research-nav a:hover {
  color: var(--green);
  border-color: var(--green);
}
.project-menu {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  padding: 6px 10px;
  font: inherit;
  font-size: .875rem;
}
.project-menu span { margin-inline-start: 8px; }
.research-nav, .project-home .wrap, .project-footer { max-width: 1480px; }
.research-nav { width: calc(100% - clamp(40px, 9vw, 160px)); margin: 0 auto; display: flex; gap: clamp(14px, 3vw, 50px); border-bottom: 1px solid var(--line); }
.research-nav a { font-size: .85rem; color: var(--muted); }
.project-site-name { display: flex; margin: 0; font: inherit; }
.project-home { padding-block: clamp(14px, 1.8vw, 26px) 50px; }
.project-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: #dbd6c9;
}
.project-hero > img, .hero-actions { grid-area: 1 / 1; }
.project-hero > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.15;
  object-fit: cover;
  object-position: 50% 55%;
}
.hero-actions {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  padding: clamp(12px, 2.3vw, 34px);
}
.hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 44px;
  padding: .5em clamp(12px, 1.5vw, 22px);
  border-radius: 2px;
  font: 550 clamp(1rem, 1.15vw, 1.12rem)/1.5 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}
.project-tour-play { background: #233b2f; color: #fff; }
.project-tour-play:hover { background: #192c23; }
.project-tour-play::before { content: ""; position: absolute; inset: 0; }
.project-tour-play::after {
  content: "";
  order: -1;
  border-block: .34em solid transparent;
  border-inline-start: .52em solid currentColor;
}
.hero-explore { position: relative; z-index: 1; background: #faf9f5; color: #233b2f; }
.hero-explore:hover { background: #eeeae0; }
.hero-actions a:focus-visible { outline: 3px solid white; outline-offset: 2px; box-shadow: 0 0 0 6px #203529; }
.collection-lead h1 { margin: .27em 0 .34em; font-weight: 550; }
.collection-lead > p:last-child { color: var(--muted); font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.85; }
.project-section-head a, .drawing-jumps a, .research-foot a { font-size: .94rem; text-underline-offset: .3em; }
.project-facts { margin: clamp(22px, 3.6vw, 54px) 0 0; display: grid; grid-template-columns: repeat(4,1fr); padding: 18px 0 16px; border-block: 1px solid var(--line); }
.project-facts div + div { border-inline-start: 1px solid var(--line); padding-inline-start: clamp(12px, 2.4vw, 42px); }
.project-facts dt { color: var(--muted); font-size: .84rem; }
.project-facts dd { font: 500 clamp(1.65rem, 3.2vw, 3.5rem)/1.25 Georgia, serif; margin: .13em 0 0; font-variant-numeric: lining-nums tabular-nums; }
.project-facts small { font: normal .85rem var(--sans); }
.project-locations { padding-block: clamp(40px, 5.5vw, 90px); }
.project-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.project-section-head a, .drawing-jumps a, .research-foot a, .space-links a { color: var(--green); }
.space-grid, .project-library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 40px); }
.space-photo { display: block; text-decoration: none; }
.space-photo img { width: 100%; height: auto; aspect-ratio: 1.7; object-fit: cover; display: block; }
.space-photo h3, .project-library h2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 600 clamp(1.25rem,2vw,1.9rem)/1.35 var(--serif); margin: .55em 0 .28em; }
.space-photo:hover h3, .project-library a:hover h2 { text-decoration: underline; text-underline-offset: .18em; }
.space-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.space-links a { font-size: .85rem; text-underline-offset: .25em; }
.project-library > a { text-decoration: none; border-top: 1px solid var(--line); padding-block: 12px; }
.project-library p { color: var(--muted); font-size: .93rem; }
.project-footer a:first-of-type { margin-right: auto; }
.project-footer { gap: 12px 22px; flex-wrap: wrap; }
.collection-lead { padding-top: clamp(34px,5vw,84px); max-width: 54rem; }
.research-foot, .drawing-jumps { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-block: 18px; border-block: 1px solid var(--line); }
.research-foot { margin: 0 0 50px; }
.drawing-jumps { margin-top: 28px; }
.project-drawings .floor-study { margin-top: 24px; }
.project-drawings .file-group { padding-block: 16px; border-bottom: 1px solid var(--line); }
.project-drawings .file-group .floor-links { margin-top: 12px; }
.project-drawings .file-group h3 { font-size: 1.1rem; }
.skip:focus { z-index: 12; }
@media (max-width: 830px) {
  .project-bar { min-height: 58px; flex-wrap: wrap; gap: 0 12px; padding-block: 9px; }
  .project-nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
  .project-nav a { padding-block: 5px; }
  .project-nav[hidden] { display: none; }
  .project-hero > img { aspect-ratio: 16 / 10; }
}
@media (max-width: 650px) {
  .space-grid, .project-library { grid-template-columns: 1fr; }
  .project-hero > img { aspect-ratio: 4 / 3; object-position: 56% center; }
  .project-facts { grid-template-columns: 1.3fr 1fr; gap: 15px 10px; }
  .project-facts div:nth-child(3) { padding-left: 0; border: 0; }
  .project-section-head { align-items: end; }
  .space-grid { gap: 30px; }
  .research-nav { gap: 0; justify-content: space-between; }
  .research-nav a { font-size: .82rem; }
  .project-footer { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }

.pw .intro { max-width: 55rem; color: var(--ink); }

.scheme-intro {
  max-width: 58rem;
  padding-block: clamp(32px, 4.5vw, 70px) 12px;
}
.scheme-intro h1 { margin-bottom: .35em; }
.scheme-intro > p, .space-deck > p {
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.85;
}
.study-links a, .sheet-jump {
  color: var(--green);
  text-underline-offset: .26em;
}
.space-section { padding-block: clamp(32px, 5vw, 78px); border-bottom: 1px solid var(--line); }
.space-opening {
  display: grid;
  grid-template-columns: minmax(0, .55fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 4.8vw, 78px);
  margin-bottom: clamp(15px, 2.2vw, 34px);
}
.space-deck h2, .archive-group h2 { margin: 0 0 .45em; }
.space-opening .photo { min-width: 0; }
.space-opening .photo img { width: 100%; height: auto; display: block; }
.space-section .photo figcaption { font-size: .86rem; }
.study-detail {
  border-top: 1px solid var(--line);
  min-width: 0;
}
.study-detail > summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  list-style: none;
  padding-block: 13px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 550;
}
.study-detail > summary::-webkit-details-marker { display: none; }
.study-detail > summary::after {
  content: '+';
  flex: none;
  color: var(--green);
  font: 400 1.2em/1 var(--sans);
}
.study-detail[open] > summary::after { content: '−'; }
.study-detail > summary:hover { color: var(--green); }
.study-detail[open] { padding-bottom: 1rem; }
.study-detail > p, .study-detail > h3, .archive-content > p { max-width: 62rem; margin-block: .75rem; }
.study-detail > .photo { max-width: 60rem; margin-block: 1rem; }
.study-detail > .today-pair, .archive-content > .today-pair { margin-block: 1rem; }
.study-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.archive-group { padding-block: clamp(24px, 3.5vw, 54px) 0; }
.archive-group:last-child { margin-bottom: 3rem; }
.archive-group h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.archive-content > :first-child { margin-top: 0; }
.archive-content .photo { max-width: 68rem; }
.archive-content > .today-work { margin-block: 1.4rem; }
.sheet-jump { display: inline-block; margin-top: .5rem; }
.sheet-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  max-width: 100%;
  margin-block: .6rem;
  color: var(--muted);
  font-size: .95rem;
}
.sheet-picker select {
  appearance: none;
  border-radius: 2px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: .55rem 2.25rem .55rem .8rem;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.sheet-picker select:focus-visible { outline: 3px solid #af7044; outline-offset: 3px; }
.sheet-picker::after {
  content: '';
  display: block;
  width: .44rem;
  height: .44rem;
  border-right: 1.5px solid var(--green);
  border-bottom: 1.5px solid var(--green);
  position: absolute;
  right: .9rem;
  top: 50%;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.sheet-picker[hidden], .map-switch[hidden] { display: none; }
.project-drawings .sheets-files { padding-block: 1.4rem; border: 0; }
.project-drawings .sheets-files .file-group { border: 0; }
.project-drawings #scale { margin-bottom: 2.5rem; }
.slim-foot a:first-of-type { margin-right: 0; }
.slim-foot { gap: 10px 25px; }
.gallery-original { color: inherit; font-size: .9rem; white-space: nowrap; }
@media (max-width: 720px) {
  .space-opening { grid-template-columns: 1fr; gap: 15px; }
  .space-deck { max-width: 38rem; }
  .archive-group h2 { margin-bottom: 12px; }
}

#tour-dialog {
  box-sizing: border-box;
  width: min(97vw, 102rem);
  max-width: none;
  max-height: 94vh;
  max-height: 94dvh;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
#tour-dialog[open] { display: flex; flex-direction: column; }
#tour-dialog::backdrop { background: rgb(17 24 20 / 78%); }
body:has(#tour-dialog[open]) { overflow: hidden; }
.tour-dialog-body {
  display: grid; grid-template-columns: minmax(0, 3.2fr) minmax(15rem, 1fr);
  align-items: center; gap: clamp(12px, 1.5vw, 24px); padding: clamp(10px, 1.3vw, 22px);
  overflow: auto; overscroll-behavior: contain;
}
.tour-screen { min-width: 0; }
.tour-screen video { display: block; width: 100%; height: auto; max-height: 77vh; aspect-ratio: 16/9; object-fit: contain; background: #17201c; }
.tour-location { min-width: 0; }
.tour-location h3 { font-size: 1rem; }
.tour-location svg { display: block; width: 100%; height: auto; margin-block: .55rem; }
.tour-location p { font-size: .92rem; color: var(--muted); }
.tour-location strong { font-weight: 550; color: var(--ink); margin-left: .45em; }
@media (max-width: 980px) {
  .tour-dialog-body { display: block; }
  .tour-location { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 3px 16px; margin: .75rem auto 0; max-width: 36rem; }
  .tour-location h3, .tour-location p { grid-row: 1; margin: 0; }
  .tour-location p { text-align: right; }
  .tour-location svg { grid-column: 1 / -1; grid-row: 2; max-height: 24vh; margin: 0; }
}
@media (max-height: 520px) and (min-aspect-ratio: 3/2) {
  .tour-dialog-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(11rem, 1fr); }
  .tour-location { display: block; margin: 0; }
  .tour-location svg { max-height: 42vh; }
  .tour-location p { text-align: left; }
  .tour-screen video { max-height: 68vh; }
}

.home-scheme .space-opening { margin-bottom: 0; }
.space-details { margin-top: clamp(16px, 2.3vw, 36px); }
.space-details > [hidden] { display: none; }
.space-detail-open, .model-download {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .85rem 0;
  color: var(--ink);
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  text-align: left;
  font: 550 1rem/1.6 var(--sans);
}
:is(.space-detail-open, .model-download):is(:hover, :focus-visible) { color: var(--green); }
:is(.space-detail-open, .model-download) > span { flex: none; color: var(--green); font-weight: 400; }
#space-dialog {
  width: min(70rem, calc(100% - 4rem));
  max-width: none;
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 90px #15251e38;
}
#space-dialog[open] { display: flex; flex-direction: column; }
#space-dialog::backdrop { background: rgb(23 31 26 / 60%); }
body:has(#space-dialog[open]) { overflow: hidden; }
.space-dialog-head, .tour-dialog-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: .55rem clamp(16px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
}
.space-dialog-head h2, .tour-dialog-header h2 { margin: 0; font-size: clamp(1.2rem, 2.1vw, 1.65rem); line-height: 1.4; }
.space-dialog-close, .tour-close {
  flex: none;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--ink);
  padding: 4px;
}
.space-dialog-close span, .tour-close span { margin-inline-start: 5px; font-size: 1.15em; }
.space-dialog-scroll {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  padding: clamp(16px, 3vw, 42px);
}
.space-detail-content {
  --detail-gap: clamp(1rem, 2vw, 1.65rem);
  max-width: 64rem;
  margin-inline: auto;
}
.space-detail-content :where(p, figure, table, .today-work, .floor-facts) { margin-block: 0; }
.space-detail-content :is(.today-work, .floor-facts) { margin-block: 0; }
.space-detail-content :where(p) { max-width: 43em; line-height: 1.8; }
.space-detail-content :where(h3, h4) {
  color: var(--ink);
  font: 600 clamp(1.06rem, 1.5vw, 1.24rem)/1.5 var(--sans);
}
.space-detail-content :where(h4) { font-size: 1rem; }
.space-detail-content > :not(span) ~ :not(span),
.space-detail-content :is(.inline-support, #pbr-materials) > * + * { margin-block-start: var(--detail-gap); }
.space-detail-content :is(.today-pair, .today-work, .material-study) {
  display: grid;
  gap: var(--detail-gap);
  align-items: start;
  min-width: 0;
}
.space-detail-content .today-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.space-detail-content .today-work { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.space-detail-content .material-study { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.space-detail-content :is(.today-work, .material-study) > div > * + * { margin-block-start: .75rem; }
.space-detail-content .photo { min-width: 0; }
.space-detail-content .photo img { width: 100%; height: auto; display: block; }
.space-detail-content .photo figcaption {
  padding-top: .42rem;
  line-height: 1.55;
  font-size: .9rem;
  color: var(--muted);
}
.space-detail-content figcaption :is(strong, span) { display: block; font-weight: 500; }
.space-detail-content figcaption small { display: block; margin-top: .15em; }
.space-detail-content :is(.inline-support, #pbr-materials) {
  margin-top: clamp(1.6rem, 3vw, 2.5rem);
  padding-top: clamp(.9rem, 2vw, 1.5rem);
  border-top: 1px solid var(--line);
}
.space-detail-content .inline-support :is(h3, h4):not(:first-child),
.space-detail-content > :is(h3, h4):not(:first-child) { margin-top: clamp(1.6rem, 3vw, 2.5rem); }
.detail-files { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; }
.detail-files a { color: var(--green); text-underline-offset: .23em; }
.home-scheme > .space-section:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  #space-dialog { width: calc(100% - 18px); max-height: 95vh; max-height: 95dvh; }
  .space-details { margin-top: 12px; }
  .home-scheme .space-deck { max-width: none; }
}

.detail-measurements { width: 100%; max-width: 42rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.detail-measurements caption { text-align: left; font-weight: 600; margin-bottom: .5rem; }
.detail-measurements th, .detail-measurements td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; }
.detail-measurements tbody th { font-weight: 400; }
.detail-credit { font-size: .9rem; color: var(--muted); }
.detail-measurements :is(td, th):last-child { text-align: right; }
@media (max-width: 720px) {
  .space-detail-content :is(.today-pair, .today-work, .material-study) { grid-template-columns: minmax(0, 1fr); }
  .space-detail-content .material-reference { max-width: 22rem; }
  .space-detail-content .floor-facts { grid-template-columns: 1fr; }
  .space-detail-content .floor-facts div { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem; }
}
.detail-image-pane { width: 100%; min-width: 0; }
.detail-image-pane.zoomed { overflow: auto; max-height: 65vh; max-height: 65dvh; overscroll-behavior: contain; }
.detail-image-pane.zoomed .photo-open { width: var(--detail-image-width); max-width: none; cursor: zoom-out; }
.detail-image-pane.zoomed .photo-open img { max-width: none; width: 100%; height: auto; }
.detail-image-pane.zoomed .photo-open:focus-visible { outline-offset: -3px; }


/* Keep the photo, its caption and navigation in a consistent reading order. */
.lightbox { background: var(--paper); color: var(--ink); }
.lightbox::backdrop { background: rgb(17 24 20 / 76%); }
.lightbox .viewer { padding: .5rem clamp(.8rem, 2vw, 1.75rem) 1rem; gap: .5rem; }
.lightbox .viewer > img { width: 100%; object-fit: contain; }
.lightbox .viewer button {
  min-height: 44px;
  padding: .35rem .6rem;
  color: var(--ink);
  background: none;
  border: 0;
}
.lightbox .viewer button:is(:hover, :focus-visible), .lightbox .gallery-original:hover { text-decoration: underline; text-underline-offset: .2em; }
.lightbox .viewerfoot { gap: .4rem .9rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.lightbox .viewerfoot p { flex: 1; order: -1; overflow-wrap: anywhere; color: var(--muted); }
.lightbox .viewer button:disabled { opacity: .45; }
@media (max-width: 720px) {
  .lightbox .viewerfoot { flex-wrap: wrap; justify-content: flex-end; }
  .lightbox .viewerfoot p { flex-basis: 100%; }
}

#toranomon .today-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
  margin-top: 1.6rem;
}
#toranomon figure { margin: 0; }
#toranomon .photo img { width: 100%; height: auto; display: block; }
#toranomon h3 { margin-top: 0; }
@media (max-width: 700px) {
  #toranomon .today-pair { grid-template-columns: minmax(0, 1fr); }
}
