/* Masterplan — aerial hero, the layout explorer (3D table model or zoomable plan), the township at a glance,
   five features in varied compositions, the plot-size calculator and the official-plan status. */

/* ---------- Layout explorer ---------- */
.mpx { position: relative; padding-top: clamp(4rem, 8vw, 6.5rem); padding-bottom: clamp(3rem, 6vw, 5rem); background: linear-gradient(180deg, var(--cream-2) 0%, #efe3cd 60%, #ebdcc2 100%); }
.mpx__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.mpx__head h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.04; }
.mpx__mode { display: inline-flex; padding: .25rem; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 99px; }
.mpx__mode[hidden] { display: none; }
.mpx__mode button { min-height: 2.6rem; padding: .45rem 1.2rem; font: 500 .9rem var(--font-body); color: var(--ink); background: none; border: 0; border-radius: 99px; cursor: pointer; transition: background-color .3s, color .3s; }
.mpx__mode button[aria-selected="true"] { color: #fff; background: var(--ink); }
.mpx__model[hidden], .mpx__plan[hidden] { display: none; }
.mpx__stage { position: relative; height: min(84vh, 54rem); }
.mpx__stage.is-full { height: 100vh; background: linear-gradient(180deg, var(--cream-2), #ebdcc2); }
.mpx__gl { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.2s var(--ease); outline: none; }
.mpx.is-loaded .mpx__gl { opacity: 1; }
.mpx__gl:active { cursor: grabbing; }
.mpx__gl:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.mpx__marks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mpx__mark { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .3rem; white-space: nowrap; font: 600 .8rem/1.2 var(--font-body); color: var(--ink); background: rgba(255, 252, 245, .96); border: 1px solid rgba(49, 39, 38, .12); border-radius: 99px; box-shadow: 0 10px 24px -14px rgba(49, 39, 38, .6); cursor: pointer; pointer-events: auto; transition: opacity .5s, background-color .3s, color .3s; will-change: transform; }
.mpx__mark span { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; font-size: .7rem; color: #fff; background: var(--gold); }
.mpx__mark:hover { background: #fff; }
.mpx__mark.is-on { z-index: 2; color: #fff; background: var(--ink); border-color: var(--ink); }
.mpx__tools { position: absolute; z-index: 3; left: var(--gutter); bottom: 1.4rem; display: flex; gap: .4rem; }
.mpx__tools button { width: 2.75rem; height: 2.75rem; font: 400 1.2rem/1 var(--font-body); color: var(--ink); background: rgba(255, 252, 245, .92); border: 1px solid rgba(49, 39, 38, .14); border-radius: 50%; cursor: pointer; transition: background-color .3s, color .3s; }
.mpx__tools button:hover { color: #fff; background: var(--ink); }
.mpx__panel { position: absolute; z-index: 3; top: 1.25rem; right: var(--gutter); width: min(22rem, 34vw); padding: 1.4rem 1.5rem 1.5rem; background: rgba(255, 252, 246, .97); border-radius: 1rem; box-shadow: 0 30px 70px -40px rgba(49, 39, 38, .7); opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.mpx__panel.is-on { opacity: 1; visibility: visible; }
.mpx__panel.is-in { animation: mpxIn .6s var(--ease); }
@keyframes mpxIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.mpx__pnum { font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8a6a2a; }
.mpx__pname { margin: .4rem 0 .5rem; font-size: 1.8rem; line-height: 1.1; }
.mpx__ptext { font-size: .93rem; color: var(--ink-soft); }
.mpx__pmore { display: inline-block; margin-top: .9rem; font-size: .9rem; }
.mpx__label { position: absolute; z-index: 2; left: var(--gutter); top: 1.25rem; max-width: 26rem; font-size: .8rem; color: var(--ink-soft); }
.mpx__label .tag { margin-right: .4rem; }
.mpx__list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.mpx__list button { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: .35rem 1rem .35rem .4rem; font: 500 .88rem/1.2 var(--font-body); color: var(--ink); background: rgba(255, 255, 255, .72); border: 1px solid var(--line); border-radius: 99px; cursor: pointer; transition: background-color .3s, color .3s, border-color .3s; }
.mpx__list button span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: .74rem; font-weight: 600; color: #fff; background: var(--gold); }
.mpx__list button:hover { border-color: var(--ink); }
.mpx__list button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.mpx__plan .viewer__stage { aspect-ratio: auto; height: min(78vh, 46rem); }
.mpx__plan .note { margin-top: .9rem; }
@media (max-width: 1100px) {
  .mpx__stage:not(.is-full) { height: auto; }
  .mpx__stage:not(.is-full) .mpx__gl { position: relative; display: block; height: min(64svh, 34rem); }
  .mpx__stage:not(.is-full) .mpx__marks { bottom: auto; height: min(64svh, 34rem); }
  .mpx__stage:not(.is-full) .mpx__tools { bottom: auto; top: calc(min(64svh, 34rem) - 3.6rem); }
  .mpx__stage:not(.is-full) .mpx__label { position: static; padding: .75rem var(--gutter) 0; }
  .mpx__stage:not(.is-full) .mpx__panel { position: relative; top: auto; right: auto; width: auto; max-width: 44rem; margin: 1rem var(--gutter) 0; display: none; }
  .mpx__stage:not(.is-full) .mpx__panel.is-on { display: block; }
  .mpx__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mpx__list::-webkit-scrollbar { display: none; }
  .mpx__list button { flex: none; }
  .mpx__plan .viewer__stage { height: auto; aspect-ratio: 4 / 3; }
}
@media (max-width: 640px) {
  .mpx__stage:not(.is-full) .mpx__gl, .mpx__stage:not(.is-full) .mpx__marks { height: min(56svh, 26rem); }
  .mpx__stage:not(.is-full) .mpx__tools { top: calc(min(56svh, 26rem) - 3.5rem); }
  .mpx__mark { font-size: 0; gap: 0; padding: .2rem; }
  .mpx__mark span { width: 1.4rem; height: 1.4rem; font-size: .7rem; }
  .mpx__mark.is-on { font-size: .74rem; gap: .4rem; padding: .25rem .6rem .25rem .25rem; }
}

/* ---------- The township at a glance ---------- */
.mpo__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 1000px) { .mpo__grid { grid-template-columns: 7fr 5fr; column-gap: clamp(3rem, 6vw, 6rem); } }
.mpo__main { margin: 0; }
.mpo__frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .3rem; background: var(--sand); }
.mpo__frame img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; }
.mpo__main figcaption, .mpo__inset figcaption, .feat__img figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; margin-top: .8rem; font-size: .84rem; color: var(--muted); }
.mpo__text h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.06; }
.mpo__text > p { margin-top: 1rem; color: var(--ink-soft); }
.mpo__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.75rem; }
.mpo__facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mpo__facts dd { margin: .35rem 0 .15rem; font: 500 clamp(1.35rem, 2vw, 1.7rem)/1.15 var(--font-display); color: var(--ink); }
.mpo__facts small { font-size: .74rem; color: #8a6a2a; }
.mpo__inset { margin: 2rem 0 0; max-width: 22rem; }
.mpo__inset img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: .3rem; }
@media (max-width: 560px) { .mpo__facts { grid-template-columns: 1fr 1fr; } }

/* ---------- Five features ---------- */
.feats__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.feats__head h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.04; }
.feat { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: center; }
.feat + .feat { margin-top: clamp(4rem, 9vw, 8rem); }
.feat__img { margin: 0; }
.feat__img button { position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden; border-radius: .3rem; background: var(--sand); cursor: zoom-in; }
.feat__img img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.feat__n { display: block; font: italic 500 clamp(3.2rem, 6vw, 5rem)/.9 var(--font-display); color: var(--gold); }
.feat__text h3 { margin-top: .6rem; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.08; }
.feat__lead { margin-top: .5rem; font: 500 1.15rem/1.4 var(--font-display); color: #8a6a2a; }
.feat__text > p:not(.feat__lead) { margin-top: .8rem; max-width: 30rem; color: var(--ink-soft); }
.feat__show { margin-top: 1.1rem; padding: 0; background: none; border: 0; cursor: pointer; font: 500 .95rem var(--font-body); }
/* each feature gets its own composition */
.feat--entrance .feat__img button { aspect-ratio: 16 / 10; }
.feat--avenue .feat__img button { aspect-ratio: 4 / 3; }
.feat--plots .feat__img button { aspect-ratio: 21 / 9; }
.feat--boundary .feat__img button { aspect-ratio: 3 / 4; max-width: 30rem; }
.feat--approach .feat__img button { aspect-ratio: 4 / 1; }
@media (min-width: 1000px) {
  .feat { grid-template-columns: repeat(12, 1fr); column-gap: clamp(2rem, 4vw, 4rem); }
  .feat--entrance .feat__img { grid-column: 1 / 8; }
  .feat--entrance .feat__text { grid-column: 8 / 13; }
  .feat--avenue .feat__img { grid-column: 6 / 13; grid-row: 1; }
  .feat--avenue .feat__text { grid-column: 1 / 6; grid-row: 1; }
  .feat--plots .feat__img { grid-column: 1 / 13; }
  .feat--plots .feat__text { grid-column: 2 / 12; display: grid; grid-template-columns: auto 1fr 1fr; column-gap: 2.5rem; align-items: baseline; }
  .feat--plots .feat__n { grid-row: 1 / 4; }
  .feat--plots .feat__text h3 { margin-top: 0; }
  .feat--plots .feat__lead { grid-column: 2; }
  .feat--plots .feat__text > p:not(.feat__lead) { grid-column: 3; grid-row: 1 / 3; margin-top: 0; }
  .feat--plots .feat__show { grid-column: 3; justify-self: start; }
  .feat--boundary .feat__img { grid-column: 2 / 6; }
  .feat--boundary .feat__text { grid-column: 7 / 12; }
  .feat--approach .feat__img { grid-column: 1 / 13; }
  .feat--approach .feat__text { grid-column: 7 / 13; }
}

/* ---------- Plot-size calculator ---------- */
.calc__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 1000px) { .calc__grid { grid-template-columns: 5fr 7fr; column-gap: clamp(3rem, 6vw, 6rem); } }
.calc__side h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.06; }
.calc__side > p { margin-top: 1rem; max-width: 30rem; color: var(--ink-soft); }
.calc__pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1.75rem; max-width: 26rem; }
.calc__pick button { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .9rem 1rem; text-align: left; color: var(--ink); background: rgba(255, 255, 255, .6); border: 1px solid var(--line); border-radius: .7rem; cursor: pointer; transition: background-color .3s, color .3s, border-color .3s; }
.calc__pick button b { font: 500 2rem/1 var(--font-display); }
.calc__pick button span { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.calc__pick button:hover { border-color: var(--ink); }
.calc__pick button[aria-checked="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.calc__pick button[aria-checked="true"] span { color: rgba(255, 255, 255, .7); }
.calc__custom { display: block; margin-top: 1.25rem; max-width: 26rem; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.calc__custom span { display: flex; align-items: center; margin-top: .5rem; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: .7rem; overflow: hidden; }
.calc__custom input { flex: 1; min-width: 0; min-height: 3.1rem; padding: .5rem 1rem; font: 500 1.25rem var(--font-display); color: var(--ink); background: none; border: 0; outline: none; }
.calc__custom em { padding: 0 1rem; font-style: normal; font-size: .8rem; letter-spacing: 0; text-transform: none; color: var(--muted); }
.calc__custom span:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196, 163, 95, .2); }
.calc__out { display: grid; gap: 1.5rem; }
@media (min-width: 700px) { .calc__out { grid-template-columns: 1fr 1.2fr; align-items: center; } .calc__fine { grid-column: 1 / -1; } }
.calc__read { display: grid; gap: 1.1rem; }
.calc__read b { display: block; font: 500 clamp(2.8rem, 5vw, 4.2rem)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.calc__read span { font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.calc__read div:first-child b { color: #8a6a2a; }
.calc__viz { padding: 1rem; background: #fbf6ec; border-radius: 1rem; box-shadow: 0 24px 60px -45px rgba(49, 39, 38, .6); }
.calc__board { position: relative; aspect-ratio: 1; background-color: #fffdf8; background-image: linear-gradient(rgba(49, 39, 38, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(49, 39, 38, .07) 1px, transparent 1px); background-size: var(--grid, 10%) var(--grid, 10%); background-position: left bottom; border-radius: .4rem; overflow: hidden; }
.calc__ghost, .calc__plot { position: absolute; left: 0; bottom: 0; width: var(--s, 50%); height: var(--s, 50%); transition: width .7s var(--ease), height .7s var(--ease); }
.calc__ghost { border-top: 1px dashed rgba(49, 39, 38, .35); border-right: 1px dashed rgba(49, 39, 38, .35); }
.calc__ghost i { position: absolute; right: .35rem; top: .2rem; font-style: normal; font-size: .7rem; font-weight: 600; color: var(--muted); }
.calc__plot { background: rgba(196, 163, 95, .32); border-top: 2px solid #a8813a; border-right: 2px solid #a8813a; }
.calc__plot em { position: absolute; left: 50%; top: 50%; translate: -50% -50%; white-space: nowrap; font-style: normal; font: 500 clamp(.95rem, 1.5vw, 1.15rem)/1.2 var(--font-display); color: var(--ink); }
.calc__fine { font-size: .82rem; color: var(--muted); }

/* ---------- The official plan ---------- */
.mpend__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 1000px) { .mpend__grid { grid-template-columns: 6fr 5fr; column-gap: clamp(3rem, 6vw, 6rem); } }
.mpend h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.06; }
.mpend p { margin-top: 1rem; max-width: 32rem; color: var(--ink-soft); }
.mpend .actions { margin-top: 1.75rem; }
.mpend__status { display: grid; gap: 1.4rem; }
.mpend__status li { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: baseline; }
.mpend__status .chip { grid-row: 1 / 3; align-self: start; }
.mpend__status b { font: 500 1.4rem/1.2 var(--font-display); }
.mpend__status span:last-child { font-size: .9rem; color: var(--ink-soft); }
