.thea-page {
  --thea-ink: #142b49;
  --thea-sky: #bad6e6;
  --thea-text: #364f65;
  --thea-rule: #bdc9cd;
  --thea-wash: #edf0ef;
  --thea-sheet: #faf5ee;
  --thea-gap: clamp(.3rem, .66vw, .75rem);
  --thea-space: clamp(3rem, 5.5vw, 6.5rem);
}
.thea-wrap { width: min(calc(100% - 2 * var(--home-edge)), 108rem); margin-inline: auto; }
.thea-page main { overflow-wrap: break-word; }
.thea-page main h2 {
  font: 300 clamp(2.35rem, 4.15vw, 4.65rem)/1.13 var(--body);
  letter-spacing: -.042em; text-wrap: balance;
}
.thea-page main h2 em { font-style: normal; color: var(--sea-blue); }
.thea-page .thea-prose { font-size: clamp(1.06rem, 1.31vw, 1.32rem); line-height: 1.65; color: var(--thea-text); text-wrap: pretty; }
.thea-icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.thea-meta .icon, .thea-map-link .icon { width: 1.12em; height: 1.12em; stroke-width: 1.5; }
.thea-plan-tabs[hidden], .thea-plan[hidden], .thea-viewer [hidden] { display: none; }

/* Align the mast and gallery to the width of the two stacked landscapes. */
.thea-cover { background: var(--thea-ink); color: var(--paper); }
.thea-mast, .thea-collage-cover, .thea-gallery-foot {
  display: grid; grid-template-columns: minmax(0,1fr) var(--side-width, calc(33.333333% - var(--thea-gap) * .925926));
  gap: var(--thea-gap);
}
.thea-mast {
  grid-template-areas: "lede identity"; align-items: center;
  padding-block: clamp(1.65rem, 3vw, 3.5rem) clamp(1.45rem, 2.45vw, 2.75rem);
}
.thea-identity { grid-area: identity; display: grid; justify-items: end; gap: clamp(.55rem, 1vw, 1.15rem); }
.thea-identity h1 {
  font: 400 clamp(4.5rem, 9.8vw, 11.3rem)/.85 Georgia, 'Times New Roman', serif;
  letter-spacing: -.035em; color: var(--paper); margin-inline-start: -.025em;
}
.thea-meta, .thea-meta > span { display: inline-flex; align-items: center; }
.thea-meta { color: #e0e9ed; gap: .8rem; font-size: 1rem; line-height: 1.45; }
.thea-meta > span { gap: .3rem; }
.thea-status { padding-inline-start: .8rem; border-inline-start: 1px solid #7790a4; }
.thea-lede { grid-area: lede; }
.thea-deck { font-size: clamp(2.25rem, 3.85vw, 4.45rem); font-weight: 300; line-height: 1.16; letter-spacing: -.044em; }
.thea-deck em { font-style: normal; color: var(--thea-sky); }
.thea-page .thea-intro { max-width: 64ch; margin-top: clamp(.55rem, .8vw, .85rem); color: #e2e9ed; text-wrap: balance; }
.thea-style-name { white-space: nowrap; }
.thea-collage-cover { align-items: start; }
.thea-collage-side { display: grid; min-width: 0; gap: var(--thea-gap); }
.thea-photo-link { display: block; position: relative; min-width: 0; isolation: isolate; background: #e7e3d9; cursor: zoom-in; }
.thea-photo-link img { display: block; width: 100%; height: auto; }
.thea-photo-link:focus-visible { outline: 3px solid var(--paper); outline-offset: -5px; z-index: 1; box-shadow: 0 0 0 2px var(--thea-ink); }
.thea-photo-caption, .thea-expand { position: absolute; color: white; pointer-events: none; opacity: 0; transition: opacity .16s ease-out; }
.thea-photo-caption {
  inset-inline: 0; bottom: 0; padding: 2.5rem 1rem .75rem 3.6rem;
  background: linear-gradient(transparent, #0c1a2edb); font-size: 1rem; line-height: 1.4;
}
.thea-expand { bottom: .55rem; inset-inline-end: .65rem; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; }
.thea-photo-link:focus-visible :is(.thea-photo-caption,.thea-expand) { opacity: 1; }
@media (hover: hover) { .thea-photo-link:hover :is(.thea-photo-caption,.thea-expand) { opacity: 1; } }
.thea-gallery-foot { align-items: center; padding-block: var(--thea-gap) clamp(1.1rem, 1.75vw, 2rem); }
.thea-collage-details { display: flex; gap: var(--thea-gap); align-items: start; }
.thea-collage-details a { flex: var(--photo-ratio) 1 0; background: transparent; }
.thea-collage-details :is(.thea-photo-caption,.thea-expand) { display: none; }
.thea-collage-details a:hover, .thea-collage-details a:focus-visible { outline: 2px solid var(--thea-sky); outline-offset: 2px; }
.thea-index, .thea-contact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem clamp(1rem, 2vw, 2.15rem); }
.thea-index a, .thea-text-link, .thea-cta {
  display: inline-flex; justify-content: center; align-items: center; gap: .55rem; min-height: 2.75rem; font-size: 1rem; line-height: 1.45;
}
.thea-index a:not(.thea-gallery-entry), .thea-text-link { text-decoration: underline; text-decoration-color: #9baeb8; text-underline-offset: .38em; }
.thea-index a:not(.thea-gallery-entry):hover, .thea-text-link:hover { text-decoration-color: currentColor; }
.thea-index a:focus-visible { outline-color: var(--thea-sky); }
.thea-gallery-entry { border: 1px solid #aec1d0; padding: .52rem 1.05rem; }
.thea-gallery-entry:hover { color: var(--thea-ink); background: var(--paper); }

/* The floor-plan tabs enhance the same complete plans that are readable without JavaScript. */
.thea-homes { background: var(--thea-wash); padding-block: var(--thea-space); }
.thea-section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 1.25rem clamp(2rem,6vw,7.5rem);
  margin-bottom: clamp(1.35rem,2.2vw,2.5rem);
}
.thea-section-head p { max-width: 35ch; }
.thea-plan-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 0 .75rem; border: 1px solid var(--thea-rule); }
.thea-plan-tabs button {
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: .15rem .85rem;
  min-width: 0; min-height: 3.5rem; padding: .62rem .8rem; border: 0; color: var(--thea-text); background: transparent;
  font-size: clamp(1rem,1.12vw,1.2rem); line-height: 1.4;
}
.thea-plan-tabs button + button { border-inline-start: 1px solid var(--thea-rule); }
.thea-plan-tabs bdi { font: 400 clamp(1.25rem,1.65vw,1.75rem)/1 Georgia,serif; letter-spacing: -.025em; }
.thea-plan-tabs button:hover { background: #fffaf2; color: var(--thea-ink); }
.thea-plan-tabs button[aria-selected="true"] { background: var(--thea-ink); color: var(--paper); }
.thea-plan-tabs button:focus-visible { position: relative; z-index: 1; outline: 2px solid #5588a7; outline-offset: 3px; }
.thea-plans { display: grid; gap: 1.15rem; }
.thea-plan {
  display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); grid-template-areas: "summary sheet";
  scroll-margin-block-start: 5.6rem; border: 1px solid var(--thea-rule); background: var(--paper);
}
.thea-plan-summary {
  grid-area: summary; align-self: center; width: min(100%,36rem); justify-self: center;
  padding: clamp(1.5rem,3.4vw,4rem);
}
.thea-plan-heading { display: grid; gap: .35rem; }
.thea-plan-heading bdi { justify-self: start; color: var(--sea-blue); font: 400 clamp(1.65rem,2.4vw,2.8rem)/1 Georgia,serif; }
.thea-plan-heading h3 { font: 300 clamp(1.85rem,2.65vw,3.1rem)/1.23 var(--body); letter-spacing: -.036em; }
.thea-plan-copy { margin-top: .7rem; max-width: 37ch; color: var(--thea-text); font-size: clamp(1.04rem,1.2vw,1.2rem); line-height: 1.57; text-wrap: pretty; }
.thea-plan-spec { margin: clamp(1.2rem,2.2vw,2.4rem) 0 0; font-size: 1rem; }
.thea-plan-spec > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block: .55rem; border-block-start: 1px solid var(--thea-rule); }
.thea-plan-spec dt { color: var(--thea-text); }
.thea-plan-spec dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.thea-plan-spec dd bdi { font-weight: 500; font-size: 1.14em; }
.thea-plan-link {
  grid-area: sheet; display: grid; grid-template-rows: 1fr auto; align-self: stretch; cursor: zoom-in;
  border-inline-start: 1px solid var(--thea-rule); background: var(--thea-sheet);
}
.thea-plan-link:focus-visible { outline-offset: -4px; }
.thea-sheet { width: 100%; min-width: 0; position: relative; min-height: clamp(23rem,34vw,36rem); }
.thea-sheet img { position: absolute; inset: 0; width: 100%; height: 100%; padding: clamp(.9rem,1.55vw,1.6rem) .8rem .25rem; object-fit: contain; }
.thea-plan-open {
  display: inline-flex; align-items: center; justify-self: start; gap: .45rem; min-height: 2.75rem;
  margin: .2rem .8rem .65rem; padding-inline: .8rem; border: 1px solid #a4b1b5; color: var(--thea-ink); font-size: 1rem;
}
.thea-plan-link:hover .thea-plan-open, .thea-plan-link:focus-visible .thea-plan-open { text-decoration: underline; text-underline-offset: .35em; }

.thea-place { padding-block: var(--thea-space); }
.thea-place-head h2 { max-width: 17ch; }
.thea-place-head p { max-width: 43ch; }
.thea-place-views {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-areas: "map photo" "directions .";
  gap: .3rem var(--thea-gap);
}
.thea-map { grid-area: map; position: relative; width: 100%; min-width: 0; background: #dce5e5; border: 1px solid var(--thea-rule); }
.thea-map iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.thea-map-link { grid-area: directions; justify-self: start; }
.thea-field { grid-area: photo; position: relative; align-self: start; min-width: 0; }
.thea-field img { display: block; width: 100%; height: auto; }
.thea-field figcaption {
  position: absolute; inset-inline: 0; bottom: 0; pointer-events: none;
  padding: clamp(2.2rem, 4.25vw, 4.5rem) clamp(.9rem,1.6vw,1.65rem) clamp(.7rem,1.1vw,1.2rem);
  color: #fff; background: linear-gradient(to top, #0c1c30d9, #0c1c307d 47%, transparent);
  font-size: clamp(1.06rem,1.4vw,1.45rem); font-weight: 500; line-height: 1.35;
}
.thea-contact { background: #dfe8ec; }
.thea-contact-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding-block: clamp(2.2rem,4.1vw,4.75rem); }
.thea-contact .thea-contact-row h2 { font-size: clamp(2.05rem,3.5vw,3.75rem); }
.thea-cta { padding: .65rem 1.6rem; background: var(--thea-ink); color: var(--paper); }
.thea-cta:hover { background: #2c4b65; }


.thea-viewer {
  margin: auto; padding: 0; width: min(96vw,88rem); max-width: 100%; max-height: 96vh; max-height: 96dvh;
  color: white; border: 1px solid #64798b; background: var(--dark);
}
.thea-viewer::backdrop { background: #081320e8; }
.thea-viewer-shell { height: min(90vh,65rem); height: min(90dvh,65rem); display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: .5rem; padding: .7rem clamp(.7rem,2.1vw,2rem); }
.thea-viewer-top, .thea-viewer-controls { display: flex; align-items: center; gap: .7rem; }
.thea-viewer-top { justify-content: space-between; }
.thea-viewer-top h2 { color: white; font: 400 clamp(1.12rem,1.7vw,1.55rem)/1.4 var(--body); }
.thea-viewer-controls { justify-content: center; flex-wrap: wrap; }
.thea-viewer button { min-width: 2.75rem; min-height: 2.75rem; padding: .24rem .8rem; color: white; background: transparent; border: 1px solid #8093a2; font-size: 1rem; }
.thea-viewer button:hover, .thea-viewer button[aria-pressed="true"] { background: #314a64; }
.thea-viewer button:disabled { opacity: .55; cursor: wait; }
.thea-viewer button:focus-visible, .thea-viewer-stage:focus-visible { outline-color: var(--paper); outline-offset: 2px; }
.thea-viewer button[data-close-viewer] { border-radius: 50%; display: grid; place-items: center; padding: 0; }
.thea-viewer button .icon { height: 1.08rem; width: 1.08rem; }
.thea-viewer-content { display: grid; grid-template-rows: minmax(0,1fr) auto; gap: .45rem; min-height: 0; text-align: center; }
.thea-viewer-stage { display: grid; place-items: center; min-height: 0; min-width: 0; }
.thea-viewer-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.thea-viewer-stage.is-zoomed { display: block; overflow: auto; overscroll-behavior: contain; }
.thea-viewer-stage.is-zoomed img { width: var(--zoom-width); height: auto; max-width: none; margin-inline: auto; }
.thea-viewer.showing-plan .thea-viewer-stage { background: var(--thea-sheet); }
.thea-viewer-content figcaption { color: white; font-size: 1rem; line-height: 1.45; }
.thea-viewer-controls [role="status"] { color: #d9e3e9; font-size: .95rem; }

@media (max-width: 940px) {
  .thea-meta { gap: .5rem; font-size: .94rem; }
  .thea-status { padding-inline-start: .5rem; }
  .thea-section-head { gap: 1.1rem 2rem; }
  .thea-index { gap: .2rem .95rem; }
  .thea-collage-details a { display: grid; align-content: center; min-height: 2.75rem; }
  .thea-plan-summary { padding: 1.65rem; }
  .thea-sheet { min-height: 23rem; }
}
@media (min-width: 641px) and (max-width: 760px) {
  .thea-meta { display: grid; justify-items: end; gap: .1rem; }
  .thea-status { border: 0; padding: 0; color: var(--thea-sky); }
}
@media (max-width: 720px) {
  .thea-section-head { display: block; }
  .thea-section-head p { max-width: 52ch; margin-top: .65rem; }
  .thea-place-head h2 { max-width: none; }
  .thea-plan-tabs button { display: grid; grid-template-rows: auto 1fr; align-content: start; align-items: start; justify-items: center; gap: .3rem; text-wrap: balance; }
  .thea-plan { grid-template-columns: minmax(0,.83fr) minmax(0,1.17fr); }
  .thea-contact-row { align-items: start; flex-direction: column; }
}
@media (max-width: 680px) {
  .thea-place-views { grid-template-columns: minmax(0,1fr); grid-template-areas: "map" "directions" "photo"; }
  .thea-map { aspect-ratio: 1.55; min-height: 13rem; }
  .thea-field { margin-top: .7rem; }
}
@media (max-width: 640px) {
  .thea-mast { display: flex; flex-direction: column; align-items: stretch; gap: .8rem; padding-block: 1rem 1.12rem; }
  .thea-identity { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: .7rem; }
  .thea-identity h1 { font-size: clamp(3.3rem,13.7vw,5.3rem); }
  .thea-meta { display: grid; gap: .12rem; }
  .thea-status { padding: 0; border: 0; color: var(--thea-sky); }
  .thea-deck { font-size: clamp(2rem,7.8vw,2.7rem); }
  .thea-page .thea-intro { margin-top: .38rem; font-size: 1.04rem; line-height: 1.58; }
  .thea-collage-cover { grid-template-columns: minmax(0,1fr); }
  .thea-collage-side { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-areas: "gym terrace"; }
  .thea-collage-side #view-terrace { grid-area: terrace; }
  .thea-collage-side #view-gym { grid-area: gym; }
  .thea-gallery-foot { grid-template-columns: minmax(0,1fr); grid-template-areas: "thumbs" "links"; row-gap: .75rem; padding-bottom: 1rem; }
  .thea-collage-details { grid-area: thumbs; }
  .thea-index { grid-area: links; justify-content: space-between; gap: .15rem .6rem; flex-wrap: wrap; }
  .thea-index a { font-size: .95rem; }
  .thea-gallery-entry { padding-inline: .72rem; }
  .thea-photo-caption { padding: 1.8rem .6rem .55rem 2.5rem; font-size: .9rem; }
  .thea-expand { bottom: .2rem; inset-inline-end: .15rem; }
  .thea-page main h2 { font-size: clamp(2.05rem,8vw,3rem); }
  .thea-plan-tabs { margin-bottom: .55rem; }
  .thea-plan-tabs button { padding: .65rem .28rem; font-size: .94rem; gap: .32rem; }
  .thea-plan-tabs bdi { font-size: 1.4rem; }
  .thea-plan { grid-template-columns: minmax(0,1fr); grid-template-areas: "sheet" "summary"; }
  .thea-plan-summary { width: 100%; max-width: none; padding: 1.08rem 1.15rem 1.25rem; }
  .thea-plan-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-direction: row-reverse; }
  .thea-plan-heading h3 { font-size: 1.6rem; }
  .thea-plan-heading bdi { font-size: 1.38rem; }
  .thea-plan-copy { margin-top: .35rem; }
  .thea-plan-spec { margin-top: .85rem; }
  .thea-plan-spec > div { padding-block: .35rem; }
  .thea-plan-link { border-inline-start: 0; border-block-end: 1px solid var(--thea-rule); }
  .thea-sheet { min-height: 0; height: clamp(18rem,83vw,26rem); }
  .thea-sheet img { padding: .7rem .8rem 0; }
  .thea-contact-actions { gap: .6rem 1.2rem; }
  .thea-viewer { width: calc(100% - .5rem); }
  .thea-viewer-shell { height: 89vh; height: 89dvh; padding: .45rem; gap: .4rem; }
  .thea-viewer-controls { gap: .35rem; }
  .thea-viewer button { padding-inline: .55rem; }
}
@media (max-width: 380px) {
  .thea-meta { font-size: .875rem; }
  .thea-index { gap: .1rem .5rem; }
  .thea-viewer-zoom { flex-basis: 55%; }
}
@media (max-width: 360px) {
  .thea-index { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .2rem .65rem; }
  .thea-index .thea-gallery-entry { grid-column: 1 / -1; }
}
@media (max-height: 520px) {
  .thea-viewer-shell { height: 92vh; height: 92dvh; gap: .2rem; padding-block: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.thea-page) { scroll-behavior: auto; }
  .thea-photo-caption, .thea-expand { transition: none; }
}
@media (forced-colors: active) {
  .thea-plan-tabs button[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
}

/* The portfolio shares THEA's frame, with the gallery sized to each project's photographs. */
.residence-page .thea-identity h1 {
  font-size: clamp(2rem, 5.55vw, 6.45rem); line-height: 1; white-space: nowrap; letter-spacing: -.05em;
}
.residence-page .thea-deck { text-wrap: balance; }
.residence-page .thea-intro { max-width: 55ch; }
.residence-page .thea-plan-tabs { grid-template-columns: repeat(var(--plan-count), minmax(0,1fr)); }
.detail-plan-tabs button { align-items: center; }
.residence-page .thea-plan-spec dd { white-space: normal; text-align: end; }
@media (min-width: 641px) {
  .residence-page .thea-mast { grid-template-columns: minmax(0,1fr) minmax(max-content,var(--side-width)); }
}
.residence-plan-preview {
  display: inline-flex; align-items: center; gap: .7rem; min-height: 2.75rem; margin-block-start: .85rem;
  color: var(--thea-ink); font-size: 1rem; line-height: 1.4; text-underline-offset: .28em;
}
.residence-plan-preview img { display: block; width: clamp(4.2rem,7vw,5.5rem); height: auto; }
.residence-plan-preview span { text-decoration: underline; text-decoration-color: var(--thea-rule); }
.residence-plan-preview:hover span, .residence-plan-preview:focus-visible span { text-decoration-color: currentColor; }
.residence-plan-preview .thea-icon { width: 1em; height: 1em; }
@media (max-width: 360px) {
  .residence-plan-preview { gap: .4rem; }
}
/* Both project films were shot vertically. Keep the complete picture and the native controls accessible. */
.residence-film {
  position: relative; isolation: isolate; aspect-ratio: 9 / 16; width: 100%; min-width: 0;
  align-self: start; overflow: hidden; background: var(--thea-ink);
}
.residence-film video { display: block; width: 100%; height: 100%; object-fit: contain; }
.residence-film-play {
  position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%;
  border: 0; padding: 1rem; cursor: pointer; color: #fff; background: transparent;
}
.residence-film-play span {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.9rem;
  padding: .5rem 1rem; border: 1px solid rgb(255 255 255 / .72); border-radius: 4rem;
  background: rgb(19 39 57 / .82); font: 500 1rem/1.4 var(--body);
}
.residence-film-play svg { width: 1.04rem; height: 1.04rem; fill: currentColor; }
.residence-film-play:hover span { background: var(--thea-ink); }
.residence-film-play:focus-visible, .residence-film video:focus-visible { outline: 3px solid white; outline-offset: -5px; }
.residence-film [hidden] { display: none; }
.residence-film-error { position: absolute; inset: 0 0 auto; padding: 1rem; color: white; background: var(--thea-ink); }
.residence-film-error a { text-decoration: underline; }
.residence-filmed-place .residence-film { grid-area: photo; }
@media (min-width: 681px) {
  .residence-filmed-place .thea-place-views { grid-template-columns: minmax(0,1fr) clamp(14rem,22vw,20rem); }
}
.residence-tour-spread {
  max-width: 54rem; display: grid; grid-template-columns: minmax(0,1fr) clamp(15rem,24vw,20rem);
  gap: clamp(2rem,6vw,7rem); align-items: center;
}
.residence-tour-copy { border-block-start: 1px solid var(--thea-rule); padding-block-start: clamp(1.25rem,2vw,2rem); }
.residence-tour-copy p { max-width: 33ch; margin-block-start: 1rem; }
@media (max-width: 680px) {
  .residence-filmed-place .residence-film, .residence-tour .residence-film {
    width: min(100%, 25rem, 47vh); width: min(100%, 25rem, 47svh); justify-self: center;
  }
  .residence-filmed-place .residence-film { margin-block-start: .85rem; }
  .residence-tour-spread { grid-template-columns: minmax(0,1fr); gap: 1.3rem; }
  .residence-tour-copy { border: 0; padding: 0; }
  .residence-tour-copy p { margin-block-start: .6rem; }
}
@media (min-width: 641px) and (max-width: 940px) {
  .residence-page .thea-meta { display: grid; justify-items: end; gap: .1rem; }
  .residence-page .thea-status { padding: 0; border: 0; color: var(--thea-sky); }
}
@media (max-width: 720px) {
  .detail-plan-tabs button { display: flex; align-items: center; }
}
@media (max-width: 640px) {
  .residence-page .thea-identity h1 { font-size: clamp(1.8rem,8.55vw,3.65rem); }
  .residence-page .thea-collage-side {
    grid-template-columns: var(--mobile-columns);
    grid-template-areas: "lower upper";
  }
  .residence-page .thea-collage-side > a:first-child { grid-area: upper; }
  .residence-page .thea-collage-side > a:nth-child(2) { grid-area: lower; }
  .residence-page .thea-plan-heading { display: block; }
}
