.house-page {
  --house-paper: #f3efe7;
  --house-muted: #4e4a43;
  --house-rule: #39322938;
}

.house-page .menu nav a[aria-current] { text-decoration: underline; text-underline-offset: 5px; }

.house-wrap,
.house-cover-copy {
  width: min(1440px, var(--editorial-width, calc(100% - 2 * var(--gutter))));
  margin-inline: auto;
}

.house-cover {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: clamp(490px, 76svh, 820px);
  color: #fff;
  background: #39312a;
}

.house-cover-image,
.house-cover::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.house-cover-image {
  z-index: -2;
  object-fit: cover;
  object-position: 52% 55%;
}

.house-cover::after {
  z-index: -1;
  content: "";
  background: linear-gradient(15deg, #100d0bf2 0%, #100d0bb5 23%, #100d0b14 64%, transparent 80%);
}

.house-cover-copy { padding-block: clamp(64px, 10vw, 108px) clamp(40px, 7vw, 96px); }
.house-cover h1 { font-size: clamp(70px, 12vw, 168px); line-height: .93; }
.house-cover-copy > p { max-width: 39ch; margin-top: 22px; font-size: clamp(15px, 1.3vw, 19px); }
.house-cover-copy > .house-cover-subtitle { margin-top: 12px; font: 400 clamp(26px, 4vw, 52px)/1.05 var(--serif); }
.house-cover-subtitle + p { margin-top: 16px; }
.house-cover .text-link { margin-top: 22px; }

.house-building-row,
.house-dardo-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(26px, 7vw, 106px);
}

.house-building {
  display: grid;
  gap: clamp(42px, 7vw, 108px);
  padding-block-end: clamp(48px, 7vw, 108px);
}

.house-wrap h2 {
  font-size: clamp(43px, 5.6vw, 88px);
  line-height: 1.02;
}

.house-copy p { max-width: 58ch; color: var(--house-muted); }
.house-copy h2 + p { margin-top: 24px; }
.house-copy p + p { margin-top: 15px; }

.house-building h3 {
  margin: 0 0 20px;
  font: 400 clamp(32px, 4.2vw, 62px)/1.06 var(--serif);
  text-wrap: balance;
}

.house-building img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: 55% 50%;
}

.house-building-wood img { object-position: center 55%; }

@media (min-width: 761px) {
  .house-building-wood { grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); }
  .house-building-wood figure { grid-column: 1; grid-row: 1; }
}

.house-museum {
  padding-block: clamp(60px, 9vw, 134px);
}

.house-museum:has(> .house-inventory > .house-catalogue[hidden]) {
  padding-block-end: 0;
}

.house-museum-header {
  margin-bottom: clamp(42px, 7vw, 108px);
}

.house-museum-header h2 {
  margin-bottom: clamp(20px, 3vw, 40px);
  font-size: clamp(44px, 8vw, 120px);
  text-wrap: balance;
}

.house-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 32px);
  align-items: start;
}

.house-gallery img {
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.house-gallery-centre img { aspect-ratio: 16 / 13; }
.house-gallery figcaption { margin-top: 9px; color: var(--house-muted); font-size: 12px; }

.house-inventory-heading {
  position: absolute;
  z-index: 1;
  inset: clamp(18px, 5vw, 80px) 0 auto;
  color: #fff;
  pointer-events: none;
}

.house-inventory-heading h3 {
  margin: 0 0 8px;
  font: 400 clamp(28px, 5.5vw, 88px)/1.03 var(--serif);
}

.house-inventory-heading p { max-width: 38ch; font-size: clamp(12px, 1.15vw, 16px); }

.house-tour { display: grid; gap: 6px; }

.house-tour-scene {
  --image-ratio: 1.5;
  --frame-ratio: 2.25;
  --framing: 56%;
  position: relative;
  isolation: isolate;
  aspect-ratio: var(--frame-ratio);
}

.house-tour-scene--cannon {
  --image-ratio: 1.3333333333;
  --frame-ratio: 2.15;
  --framing: 73%;
}

.house-tour-scene > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--framing);
}

.house-tour-scene--intro::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(155deg, #18120dd9, #18120d60 30%, transparent 60%);
  pointer-events: none;
}

.house-tour-point {
  position: absolute;
  z-index: 1;
  /* Project the original image coordinates onto the cropped frame. */
  top: calc(var(--framing) + (var(--y) - var(--framing)) * var(--frame-ratio) / var(--image-ratio));
  left: var(--x);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}

.house-tour-point span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #f3efe7;
  border-radius: 50%;
  background: #262018e8;
  box-shadow: 0 1px 5px #17120d60;
}

.house-tour-point span::before,
.house-tour-point span::after {
  content: "";
  grid-area: 1 / 1;
  background: currentColor;
}

.house-tour-point span::before { width: 8px; height: 1px; }
.house-tour-point span::after { width: 1px; height: 8px; }

.house-tour-point:hover span,
.house-tour-point:focus-visible span,
.house-tour-point[aria-expanded="true"] span {
  background: var(--house-paper);
  color: #262018;
  border-color: #262018;
}

.house-tour-point:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

@media screen and (prefers-reduced-motion: no-preference) {
  .is-awaiting-points .house-tour-point:not(:focus-visible, :hover) span { opacity: 0; }
  .has-revealed-points .house-tour-point span {
    animation: house-point-enter .45s cubic-bezier(.24, .75, .35, 1) var(--house-point-delay, 0ms) both;
  }
  @keyframes house-point-enter {
    0% { opacity: 0; transform: scale(.55); }
    72% { opacity: 1; transform: scale(1.16); }
    100% { opacity: 1; transform: scale(1); }
  }
}

.house-piece-panel {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  width: min(250px, calc(100% - 16px));
  padding: 12px 32px 12px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 6px;
  background: var(--house-paper);
  color: #262018;
  box-shadow: 0 5px 14px #17120d26;
}

.house-piece-panel h4 { margin: 0 0 6px; font: 400 21px/1.05 var(--serif); }
.house-piece-description { color: var(--house-muted); font-size: 13px; line-height: 1.35; }
.house-piece-description p { margin: 0; }
.house-piece-description p + p { margin-top: 6px; }

.house-piece-close {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 400 19px/1 system-ui, sans-serif;
}

.house-catalogue { margin-top: clamp(20px, 3vw, 44px); border-block: 1px solid var(--house-rule); }
.house-catalogue summary { padding-block: 16px; }
.house-catalogue .house-gallery { margin-top: 12px; }
.house-catalogue-note { margin-block: 24px; color: var(--house-muted); font-size: 14px; }
.house-catalogue .house-collection { padding-bottom: 24px; }

.house-collection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px) clamp(18px, 3vw, 40px);
}

.house-object { padding-top: 14px; border-top: 1px solid var(--house-rule); }
.house-object h4 { margin: 0 0 9px; font: 400 clamp(24px, 2.15vw, 33px)/1.12 var(--serif); }
.house-object p { color: var(--house-muted); font-size: 14px; }
.house-object a, .house-dardo a { text-decoration: underline; text-underline-offset: .18em; }

.house-object-photo {
  position: relative;
  margin-bottom: 16px;
  background: #d7cec0;
}

.house-object-photo img {
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.house-object-photo figcaption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  color: #fff;
  background: #201c17;
  font-size: 11px;
}

.house-dardo { padding-block: clamp(60px, 9vw, 144px) clamp(34px, 6vw, 76px); }
.house-dardo h2 { max-width: 19ch; margin-bottom: clamp(24px, 4vw, 54px); text-wrap: balance; }
.house-dardo h2 i { font-style: normal; }
.house-dardo h3 { margin: 0 0 12px; font: 400 clamp(26px, 3vw, 42px)/1.08 var(--serif); }
.house-dardo-photos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .26fr);
  align-items: end;
  margin-bottom: clamp(42px, 6vw, 88px);
}
.house-dardo-wide img { height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 55%; }
.house-dardo-detail {
  margin-inline-start: clamp(-80px, -5vw, -26px);
  margin-bottom: clamp(-28px, -2vw, -12px);
  border: clamp(4px, .55vw, 8px) solid var(--paper);
}
.house-dardo-detail img { height: auto; }
.house-dardo-story { align-items: start; }
.house-dardo-car {
  align-items: center;
  margin-top: clamp(38px, 7vw, 100px);
  padding-top: clamp(26px, 4vw, 56px);
  border-top: 1px solid var(--house-rule);
}
.house-dardo-car img { height: auto; }

.house-next { border-top: 1px solid var(--house-rule); }
.house-next .house-wrap { padding-block: clamp(38px, 6vw, 74px); }
.house-next h2 { font-size: clamp(30px, 3.5vw, 54px); }
.house-next nav { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 17px; }
.house-next .text-link { margin: 0; }

@media (max-width: 760px) {
  .house-cover { min-height: clamp(450px, 70svh, 620px); }
  .house-cover-image { object-position: 58% 50%; }
  .house-cover::after { background: linear-gradient(0deg, #100d0bef 0%, #100d0b92 35%, #100d0b14 76%); }
  .house-building-row,
  .house-dardo-story { grid-template-columns: minmax(0, 1fr); }
  .house-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .house-gallery-centre { grid-row: 2; grid-column: 1 / -1; }
  .house-gallery-centre img { aspect-ratio: 3 / 2; }
  .house-tour-scene { --frame-ratio: var(--image-ratio); }
  .house-dardo-photos { grid-template-columns: minmax(0, 1fr) minmax(0, .38fr); }
  .house-dardo-wide img { aspect-ratio: 4 / 3; }
}

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

@media (max-width: 510px) {
  .house-collection { grid-template-columns: minmax(0, 1fr); }
  .house-inventory-heading { inset-block-start: 14px; }
  .house-inventory-heading h3 { margin-bottom: 5px; font-size: clamp(20px, 6.2vw, 32px); }
  .house-inventory-heading p { line-height: 1.3; }
  .house-tour-point { width: 28px; height: 28px; }
  .house-tour-point span { width: 16px; height: 16px; }
  .house-piece-panel { width: min(218px, calc(100% - 16px)); padding-block: 9px; }
  .house-piece-panel h4 { font-size: 18px; }
  .house-piece-description { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
