:root {
  --ink: #171311;
  --muted: #756a5f;
  --paper: #f6efe3;
  --paper-soft: #fffaf0;
  --brass: #b18a4a;
  --teal: #285f5d;
  --wine: #7d3644;
  --forest: #304d3d;
  --blue: #263f55;
  --clay: #7c5746;
  --shadow: rgba(19, 13, 9, 0.25);
  --line: rgba(57, 42, 31, 0.14);
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(246, 239, 227, 0.98), rgba(238, 224, 205, 0.94) 48%, rgba(34, 29, 26, 0.98)),
    #efe2cf;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.home-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.96fr);
  overflow: hidden;
}

.threshold,
.rooms {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.threshold {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 42px;
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.72), rgba(255, 250, 239, 0.18) 42%, rgba(25, 19, 15, 0.28)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.25), transparent 36%);
}

.threshold::after {
  content: "";
  position: absolute;
  right: 0;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(70, 50, 34, 0.24), transparent);
}

.threshold-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8a6635;
  font-family: "Gill Sans", "Avenir Next", sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p,
figure {
  margin: 0;
}

h1 {
  font-size: 64px;
  line-height: 0.96;
  letter-spacing: 0;
}

.home-line {
  max-width: 420px;
  margin-top: 14px;
  color: rgba(23, 19, 17, 0.68);
  font-size: 19px;
  line-height: 1.6;
}

.house-portrait {
  position: relative;
  align-self: end;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(88, 62, 43, 0.22);
  border-radius: 8px;
  background: #211915;
  box-shadow: 0 30px 72px var(--shadow);
}

.house-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 245, 222, 0.04), transparent 45%, rgba(20, 13, 8, 0.48)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 38%, rgba(0, 0, 0, 0.12));
}

.house-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: block;
  object-fit: cover;
  transform: translate3d(var(--image-x, 0), var(--image-y, 0), 0) scale(1.04);
  transition: transform 300ms ease;
}

.house-portrait figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  color: #fff5df;
}

.portrait-label {
  color: rgba(255, 245, 223, 0.72);
  font-family: "Gill Sans", "Avenir Next", sans-serif;
  font-size: 12px;
}

.house-portrait strong {
  font-size: 30px;
  line-height: 1;
}

.rooms {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 24px;
  padding: 42px;
  color: #f8ecd4;
  background:
    linear-gradient(180deg, rgba(255, 241, 205, 0.06), transparent 30%),
    linear-gradient(145deg, #151311, #25201b 46%, #171311);
}

.rooms-header h2 {
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.room-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(148px, 1fr);
  gap: 14px;
}

.room-door {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  padding: 18px;
  color: #f8ecd4;
  text-align: left;
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 247, 222, 0.08), rgba(255, 247, 222, 0.02)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 231, 176, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.room-door::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(177, 138, 74, 0.55), transparent);
  opacity: 0.22;
}

.room-door:hover,
.room-door:focus-visible,
.room-door.is-active {
  transform: translateY(-3px);
  border-color: rgba(226, 190, 111, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 247, 222, 0.13), rgba(255, 247, 222, 0.03)),
    rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 34px rgba(0, 0, 0, 0.2);
  outline: none;
}

.room-door-primary {
  grid-row: span 2;
  background:
    linear-gradient(180deg, rgba(40, 95, 93, 0.5), rgba(31, 63, 59, 0.12)),
    linear-gradient(135deg, rgba(255, 236, 184, 0.2), transparent 44%),
    rgba(255, 255, 255, 0.04);
}

.room-door:nth-child(2) {
  border-color: rgba(125, 54, 68, 0.34);
}

.room-door:nth-child(3) {
  border-color: rgba(177, 138, 74, 0.28);
}

.room-door:nth-child(4) {
  border-color: rgba(38, 63, 85, 0.48);
}

.room-door:nth-child(5) {
  border-color: rgba(124, 87, 70, 0.42);
}

.room-state {
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  color: rgba(255, 245, 223, 0.78);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 231, 176, 0.13);
  border-radius: 999px;
  font-family: "Gill Sans", "Avenir Next", sans-serif;
  font-size: 12px;
}

.room-door strong {
  align-self: center;
  overflow-wrap: anywhere;
  font-size: 28px;
  line-height: 1.1;
}

.room-door small {
  max-width: 100%;
  color: rgba(248, 236, 212, 0.64);
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
}

.room-current {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 231, 176, 0.14);
}

.room-current span {
  min-height: 28px;
  padding: 5px 9px;
  color: #211914;
  background: #d5b46f;
  border-radius: 999px;
  font-family: "Gill Sans", "Avenir Next", sans-serif;
  font-size: 12px;
}

.room-current strong {
  min-width: 0;
  font-size: 22px;
  line-height: 1;
}

.room-current p {
  grid-column: 2 / 3;
  color: rgba(248, 236, 212, 0.66);
  font-size: 14px;
  line-height: 1.45;
}

.enter-link {
  grid-row: 1 / span 2;
  grid-column: 3;
  min-width: 110px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  color: #211914;
  text-decoration: none;
  background: linear-gradient(180deg, #f1d891, #c99d52);
  border: 1px solid rgba(255, 241, 190, 0.72);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, filter 160ms ease;
}

.enter-link:hover,
.enter-link:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
  outline: none;
}

@media (max-width: 1040px) {
  .home-shell {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .threshold,
  .rooms {
    min-height: auto;
  }

  .threshold {
    gap: 28px;
  }

  .house-portrait,
  .house-image {
    min-height: 360px;
  }
}

@media (max-width: 680px) {
  .threshold,
  .rooms {
    padding: 22px 16px;
  }

  h1 {
    font-size: 43px;
  }

  .home-line {
    font-size: 17px;
  }

  .house-portrait,
  .house-image {
    min-height: 300px;
  }

  .rooms {
    gap: 18px;
  }

  .room-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 140px;
  }

  .room-door-primary {
    grid-row: span 1;
  }

  .room-current {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .room-current p,
  .enter-link {
    grid-column: 1;
  }

  .enter-link {
    grid-row: auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
