:root {
  --bg: #f0f4ed;
  --ink: #244e31;
  --muted: #536d57;
  --accent: #d4e98e;
  --line: #b8c7b4;
  --on-accent: #244e31;
  --focus: #785525;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    15px/1.8 "Segoe UI",
    "Yu Gothic",
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
canvas {
  max-width: 100%;
  display: block;
}
button {
  border: 1px solid var(--line);
  background: transparent;
}
button:disabled {
  cursor: default;
}
button:active {
  transform: scale(0.98);
}
:focus-visible {
  outline: 3px solid var(--focus, var(--accent));
  outline-offset: 4px;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.15;
}
h2 {
  font-size: clamp(28px, 3.6vw, 54px);
  letter-spacing: -0.045em;
}
h3 {
  font-size: 22px;
  letter-spacing: -0.025em;
}
p {
  max-width: 72ch;
}
small,
.micro {
  font-size: 12px;
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
.display {
  font-family: Impact, "Arial Narrow", "Arial Black", sans-serif;
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.025em;
}
.serif {
  font-family: Georgia, "Yu Mincho", serif;
  font-weight: 400;
}
.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 12px;
  z-index: 100;
  transform: translateY(-150%);
}
.skip:focus {
  transform: none;
}
.site-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}
.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}
.site-nav {
  display: flex;
  gap: 30px;
  align-items: center;
}
.site-nav a {
  font-size: 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}
.menu {
  display: none;
  min-height: 44px;
  padding: 8px 14px;
}
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent, var(--ink));
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover {
  border-color: var(--ink);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.actions,
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.choices button {
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 0;
}
.choices button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.section {
  padding: 90px 40px;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 38px;
}
.section-head > p {
  max-width: 360px;
  color: var(--muted);
}
.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}
.cols article {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.cols p {
  margin-top: 16px;
  color: var(--muted);
}
.price {
  font-size: clamp(32px, 4vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.06em;
  margin: 24px 0;
}
.ledger {
  width: 100%;
  border-collapse: collapse;
}
.ledger th,
.ledger td {
  text-align: left;
  padding: 20px 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.ledger th {
  font-size: 12px;
  color: var(--muted);
}
.site-footer {
  padding: 38px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-end;
  font-size: 12px;
}
.site-footer p {
  max-width: 600px;
  margin-top: 10px;
  color: var(--muted);
}
.site-footer a {
  padding: 12px 0;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.demo-mark {
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  white-space: nowrap;
}
.art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.art canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: -1;
}
.art-label {
  font-size: 12px;
  position: absolute;
  left: 20px;
  bottom: 18px;
}
.control-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}
.status {
  font-size: 13px;
  min-height: 24px;
  margin-top: 14px;
}
dialog {
  width: min(490px, calc(100% - 36px));
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 42px 30px 30px;
  box-shadow: 0 20px 120px #0005;
}
dialog::backdrop {
  background: #10201dcc;
  backdrop-filter: blur(6px);
}
dialog h2 {
  font-size: 30px;
  padding-right: 15px;
}
dialog p {
  margin: 20px 0;
}
dialog .close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 44px;
  height: 44px;
  font-size: 24px;
}
details {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
summary {
  cursor: pointer;
  min-height: 44px;
  font-size: 18px;
}
details p {
  padding: 8px 0;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
button,
a {
  transition:
    background-color 0.15s,
    color 0.15s,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (max-width: 1000px) {
  .site-header {
    padding: 16px 24px;
  }
  .site-nav {
    gap: 18px;
  }
  .section {
    padding: 64px 24px;
  }
  .site-footer {
    padding: 30px 24px;
  }
  .cols {
    gap: 20px;
  }
}
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
  .site-header {
    min-height: 74px;
    padding: 14px 18px;
  }
  .brand {
    font-size: 25px;
  }
  .menu {
    display: block;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px #0002;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    padding: 6px 10px;
  }
  .section {
    padding: 54px 18px;
  }
  .section-head {
    display: block;
    margin-bottom: 28px;
  }
  .section-head > p {
    margin-top: 20px;
  }
  .cols {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .site-footer {
    padding: 28px 18px;
    display: block;
  }
  .site-footer > a {
    display: inline-block;
    margin-top: 18px;
  }
  .row {
    flex-wrap: wrap;
  }
  .ledger td,
  .ledger th {
    padding: 14px 4px;
    font-size: 13px;
  }
  .ledger th {
    font-size: 11px;
  }
  .choices button {
    padding: 9px 14px;
  }
  .btn {
    padding: 12px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-property: opacity, background-color, color !important;
    transition-duration: 0.12s !important;
  }
  button,
  a,
  .reactive {
    transition:
      opacity 0.12s,
      background-color 0.12s,
      color 0.12s !important;
  }
}

.habitat-living .brand {
  font-size: 36px;
  letter-spacing: -0.075em;
}
.habitat-hero {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  min-height: 690px;
}
.home-search {
  background: #244e31;
  color: #f0f4ed;
  padding: 40px 34px;
  display: flex;
  flex-direction: column;
}
.home-search h1 {
  font-size: 36px;
  line-height: 1.5;
  letter-spacing: -0.055em;
  margin: 28px 0 22px;
}
.home-search > p:not(.micro) {
  font-size: 13px;
  color: #c8d7b8;
  line-height: 2;
}
.home-filters {
  margin-top: 38px;
}
.home-filters .choices {
  margin-top: 12px;
}
.home-filters button {
  border-color: #91ab80;
  flex: 1;
  color: #f0f4ed;
}
.home-filters button[aria-pressed="true"] {
  background: #d4e98e;
  color: #244e31;
  border-color: #d4e98e;
}
.home-count {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-top: 28px;
}
.home-count strong {
  font-size: 75px;
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 1;
}
.home-count span {
  font-size: 12px;
}
.home-search > a {
  margin-top: 26px;
  border-top: 1px solid #718a63;
  padding: 18px 0;
  font-size: 13px;
}
.search-note {
  margin-top: auto;
  color: #c8d7b8;
}
.home-stage {
  padding: 30px 36px;
  background: radial-gradient(ellipse at 55% 50%, #e0e8d2, #c7d6bd);
  min-height: 690px;
}
.home-stage-top,
.home-plan-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  position: relative;
  z-index: 4;
}
.home-stage-top > span:last-child {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.05em;
}
.home-plan-bottom {
  position: absolute;
  bottom: 30px;
  left: 36px;
  right: 36px;
  align-items: end;
}
.plan-scene {
  position: absolute;
  inset: 10% 0 12%;
  perspective: 1000px;
  display: grid;
  place-items: center;
}
.floorplan {
  width: 470px;
  height: 350px;
  position: relative;
  transform: rotateX(42deg) rotateZ(-29deg);
  transform-style: preserve-3d;
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.6fr;
  grid-template-rows: 1.7fr 1fr;
  border: 9px solid #f9fbf4;
  background: #f2e2c5;
  box-shadow:
    0 9px 0 #a3ae91,
    0 17px 0 #a8b291,
    20px 40px 30px #37563155;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.room {
  position: relative;
  border: 5px solid #f9fbf4;
  background: repeating-linear-gradient(
    90deg,
    #d4b88d 0 16px,
    #e1c99c 17px 19px
  );
  padding: 14px;
  box-shadow: inset 4px 4px 8px #5e6d5a33;
}
.room span {
  font:
    11px Georgia,
    serif;
  position: relative;
  z-index: 2;
}
.room b {
  font-size: 11px;
  font-weight: 400;
  display: block;
}
.living {
  grid-row: 1/-1;
}
.bedroom {
  grid-column: 2;
}
.study {
  grid-column: 2;
  grid-row: 2;
  display: none;
}
.bath {
  grid-column: 3;
  grid-row: 1;
  background: repeating-linear-gradient(0deg, #c4d2c8 0 20px, #fff6 21px 22px);
}
.entrance {
  grid-column: 2/4;
  grid-row: 2;
  background: #bdc2b0;
}
.balcony {
  position: absolute;
  left: -9px;
  right: -9px;
  bottom: -55px;
  height: 48px;
  border: 4px solid #f3f5eb;
  border-top: 0;
  padding: 8px 14px;
  font:
    12px Georgia,
    serif;
  background: repeating-linear-gradient(
    90deg,
    #a4ae8b 0 13px,
    #b1b999 14px 16px
  );
  box-shadow: 0 6px 0 #899676;
}
.sofa {
  position: absolute;
  left: 15px;
  top: 40%;
  width: 50px;
  height: 100px;
  border-radius: 8px;
  background: #6e8a54;
  border: 6px solid #819a60;
  box-shadow: 5px 8px 7px #33482844;
}
.table-furniture {
  position: absolute;
  right: 22px;
  bottom: 45px;
  width: 55px;
  height: 80px;
  border-radius: 50%;
  background: #b78a57;
  box-shadow: 5px 7px 8px #56351644;
  border: 3px solid #c69b64;
}
.plant {
  position: absolute;
  right: 15px;
  top: 24px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #6b8a4c, #2c5a3d);
  box-shadow: 2px 4px 7px #244e3144;
}
.bed {
  position: absolute;
  width: 95px;
  height: 122px;
  left: 10px;
  bottom: 10px;
  background: linear-gradient(#efece0 0 25%, #90a5a0 25%);
  border: 6px solid #9b7957;
  border-radius: 4px;
  box-shadow: 4px 7px 7px #244e3144;
}
.bed::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  height: 23px;
  top: 2px;
  background: linear-gradient(90deg, #f9f4e2 47%, #d5cfb9 49% 51%, #f9f4e2 53%);
  border-radius: 4px;
}
.tub {
  position: absolute;
  inset: 40px 8px 18px;
  border-radius: 18px;
  background: #edf4ee;
  box-shadow: inset 2px 2px 8px #46765e55;
}
.desk {
  position: absolute;
  width: 70px;
  height: 30px;
  bottom: 20px;
  left: 15px;
  background: #b78a57;
}
.plan-stamp {
  position: absolute;
  right: 28px;
  bottom: 100px;
  font-size: clamp(60px, 7vw, 115px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.08em;
  color: #244e3122;
  transform: rotate(-90deg);
  transform-origin: 80% 50%;
  pointer-events: none;
}
.plan-stamp span {
  display: block;
  font:
    11px "Segoe UI",
    sans-serif;
  letter-spacing: 0.04em;
  color: #244e3188;
  margin-top: 10px;
}
.home-stage.two .floorplan {
  grid-template-columns: 1.3fr 1fr 0.7fr;
  width: 520px;
}
.home-stage.two .study {
  display: block;
}
.home-stage.two .entrance {
  grid-column: 3;
  grid-row: 2;
}
.property-section {
  background: #f0f4ed;
}
.property {
  display: grid;
  grid-template-columns: 65px 1fr 160px 50px 120px;
  gap: 25px;
  align-items: center;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.property-number {
  width: 55px;
  height: 55px;
  background: #e2eacb;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font:
    25px Georgia,
    serif;
}
.property h3 {
  font-size: 22px;
}
.property p {
  font-size: 13px;
  margin-top: 9px;
  color: var(--muted);
}
.property .micro {
  color: var(--muted);
  display: block;
  margin-top: 9px;
}
.property-price b {
  font-size: 27px;
  letter-spacing: -0.05em;
  font-weight: 500;
}
.property-price span {
  display: block;
  font-size: 10px;
}
.save-home {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}
.save-home[aria-pressed="true"] {
  background: var(--ink);
  color: var(--accent);
}
.property .btn {
  padding: 12px;
  font-size: 13px;
}
.habitat-about {
  background: #d4e98e;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9vw;
}
.habitat-about > div p + p {
  margin-top: 20px;
}
.habitat-about .btn {
  margin-top: 35px;
}
@media (max-width: 1100px) {
  .habitat-hero {
    grid-template-columns: 290px minmax(0, 1fr);
  }
  .home-search {
    padding: 30px 24px;
  }
  .home-search h1 {
    font-size: 30px;
  }
  .home-stage {
    padding: 30px 24px;
  }
  .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.82);
  }
  .home-stage.two .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.75);
  }
  .home-plan-bottom {
    left: 24px;
    right: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .property {
    grid-template-columns: 50px 1fr 130px 45px;
    gap: 18px;
  }
  .property > .btn {
    grid-column: 2;
    justify-self: start;
    padding: 8px 20px;
    min-height: 44px;
  }
  .property-price b {
    font-size: 24px;
  }
  .home-stage {
    min-height: 660px;
  }
  .home-hero {
    min-height: 660px;
  }
}
@media (max-width: 800px) {
  .habitat-hero {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .home-search {
    padding: 28px 20px;
  }
  .home-search h1 {
    font-size: 27px;
  }
  .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.66);
  }
  .home-stage.two .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.6);
  }
  .home-stage-top {
    flex-direction: column;
    gap: 10px;
  }
  .home-stage-top > span:last-child {
    font-size: 23px;
  }
  .plan-stamp {
    right: 10px;
    font-size: 75px;
  }
  .property h3 {
    font-size: 20px;
  }
}
@media (max-width: 640px) {
  .habitat-hero {
    display: flex;
    flex-direction: column;
  }
  .home-search {
    padding: 30px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .home-search > .micro:first-child {
    grid-column: 1/-1;
  }
  .home-search h1 {
    font-size: 29px;
    grid-column: 1/-1;
    margin: 8px 0 0;
  }
  .home-search > p:not(.micro) {
    display: none;
  }
  .home-filters {
    margin-top: 8px;
    grid-column: 1/-1;
  }
  .home-count {
    margin-top: 8px;
    gap: 10px;
  }
  .home-count strong {
    font-size: 55px;
  }
  .home-count span {
    font-size: 10px;
  }
  .home-search > a {
    margin: 10px 0 0;
    font-size: 12px;
    padding: 14px 0;
    align-self: center;
    text-align: right;
  }
  .search-note {
    grid-column: 1/-1;
    font-size: 10px;
  }
  .home-stage {
    min-height: 465px;
    padding: 22px 18px;
  }
  .home-stage-top {
    flex-direction: row;
    font-size: 12px;
  }
  .home-stage-top > span:last-child {
    font-size: 24px;
  }
  .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.62);
  }
  .plan-scene {
    inset: 12% 0 16%;
  }
  .home-plan-bottom {
    left: 18px;
    right: 18px;
    bottom: 20px;
    font-size: 13px;
    gap: 4px;
  }
  .home-plan-bottom > .micro {
    font-size: 10px;
  }
  .home-stage.two .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.56);
  }
  .plan-stamp {
    font-size: 55px;
    right: 15px;
    bottom: 75px;
  }
  .plan-stamp span {
    font-size: 8px;
  }
  .property {
    grid-template-columns: 40px minmax(0, 1fr) 44px;
    gap: 12px;
    padding: 25px 0;
  }
  .property-number {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  .property h3 {
    font-size: 19px;
  }
  .property-price {
    grid-column: 2;
    grid-row: 2;
  }
  .property-price b {
    font-size: 25px;
  }
  .property > .btn {
    grid-column: 2;
    grid-row: 3;
  }
  .save-home {
    width: 44px;
    height: 44px;
    grid-column: 3;
    grid-row: 1;
  }
  .property p {
    font-size: 12px;
  }
  .property .micro {
    font-size: 11px;
  }
  .habitat-about {
    display: block;
  }
  .habitat-about > div {
    margin-top: 35px;
  }
}

/* Visual review: use an explicit zero-minimum grid track for the model. */
.plan-scene {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 640px) {
  .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.58);
  }
  .home-stage.two .floorplan {
    transform: rotateX(42deg) rotateZ(-29deg) scale(0.52);
  }
  .plan-stamp {
    bottom: 90px;
    right: 28px;
    font-size: 48px;
  }
}
