:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  color: #f3e4ce;
  background: #17120f;
  --paper: #f8edda;
  --ink: #35231b;
  --accent: #783c24;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 3px solid #c17b36;
  outline-offset: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.city {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  outline: none;
}
.square {
  position: relative;
  width: min(100%, 190svh);
  aspect-ratio: 1672 / 941;
}
.square-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  border-radius: .3rem;
}
.spot:hover, .spot:focus-visible {
  background: rgb(255 206 134 / 9%);
  box-shadow: 0 0 1.3rem rgb(240 169 85 / 39%), inset 0 0 1.3rem rgb(237 177 112 / 29%);
}
.spot:focus-visible { outline-color: #ffe0a1; }
.home { --x: 70.6%; --y: 2.2%; --w: 3.9%; --h: 5%; }
.about { --x: 75.7%; --y: 2.2%; --w: 8.4%; --h: 5%; }
.map { --x: 85.1%; --y: 2.2%; --w: 6.5%; --h: 5%; }
.ideas { --x: 92.2%; --y: 2.2%; --w: 5.6%; --h: 5%; }
.thoughts { --x: 10.7%; --y: 31.7%; --w: 11.5%; --h: 38%; }
.memories { --x: 34.8%; --y: 33.9%; --w: 10.7%; --h: 27.6%; }
.stories { --x: 61.7%; --y: 37%; --w: 10.8%; --h: 26.5%; }
.quiet { --x: 83.5%; --y: 35.2%; --w: 10.3%; --h: 27.5%; }
.sign-square { --x: 13.3%; --y: 77.9%; --w: 11.4%; --h: 5.5%; }
.sign-map { --x: 13.1%; --y: 84.6%; --w: 12.7%; --h: 5.7%; }
.sign-ideas { --x: 13%; --y: 91.2%; --w: 12.6%; --h: 6%; }
.mobile-header, .mobile-houses { display: none; }
.no-script { padding: 0 1rem; }

@media (min-width: 761px) and (min-aspect-ratio: 3/2) and (max-aspect-ratio: 19/10) {
  .square { width: 100%; height: 100svh; }
}

.room {
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #bd9568;
  border-radius: .5rem;
  padding: 0;
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  box-shadow: 0 1.3rem 5rem #130c08b0;
  overscroll-behavior: contain;
}
.room::backdrop { background: rgb(23 16 14 / 65%); }
body:has(.room[open]) { overflow: hidden; }
.room-page { padding: clamp(1rem, 5vw, 2.6rem); padding-top: 1rem; }
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #bc946257;
  margin-bottom: 1.25rem;
}
.back, .close {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  min-height: 44px;
  padding: .25rem .5rem;
}
.back { text-decoration: underline; text-underline-offset: .23em; }
.close { font-size: 1.9rem; line-height: 1; min-width: 44px; }
.room h2 {
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: normal;
  line-height: 1.05;
  margin: 0 0 .8rem;
  outline: none;
}
.room-content { line-height: 1.5; font-size: 1.0625rem; }
.room-content > :first-child { margin-top: 0; }
.room-content > :last-child { margin-bottom: 0; }
.room-content a { color: var(--accent); text-underline-offset: .2em; }
blockquote {
  background: #a4784020;
  border-left: 2px solid #a47840;
  margin: 1.25rem 0 .5rem;
  padding: .85rem 1.15rem;
  font-size: clamp(1.15rem, 3vw, 1.42rem);
  font-style: italic;
}
blockquote p { margin: 0; }
.note { font-size: .9375rem; color: #644c3d; }
.action {
  padding: .6rem .95rem;
  min-height: 44px;
  color: #fff4e6;
  background: var(--accent);
  border: 1px solid #6e3724;
  border-radius: .25rem;
  cursor: pointer;
}
.action:hover { background: #5c2c1b; }
.entries { margin: 1.25rem 0; }
.entries > div { padding: .75rem 0; border-top: 1px solid #bc946257; }
.entries dt { font-size: 1.125rem; font-weight: bold; }
.entries dd { margin: .25rem 0 0; }
.map-list { margin: 0; list-style: none; padding: 0; }
.map-list li { padding: .55rem 0; border-bottom: 1px solid #bc946257; }
.map-list span { display: block; color: #644c3d; }
.future-list { padding-left: 1.2em; }
.future-list li { padding: .15em 0; }
textarea {
  display: block;
  width: 100%;
  margin: .45rem 0;
  padding: .75rem;
  resize: vertical;
  color: var(--ink);
  background: #fffbf1;
  border: 1px solid #9c7453;
  border-radius: .25rem;
}
#quiet-status:empty { display: none; }

@media (max-width: 760px), (orientation: portrait) {
  .city { display: block; max-width: 48rem; margin-inline: auto; }
  .desktop-links { display: none; }
  .mobile-header {
    display: block;
    text-align: center;
    padding: max(1.35rem, env(safe-area-inset-top)) 1rem .6rem;
    background: linear-gradient(#241a16, #17120f);
  }
  .name {
    font-size: clamp(2.45rem, 9vw, 4.5rem);
    line-height: 1.03;
    margin: 0;
    letter-spacing: -.04em;
  }
  .motto { margin: .55rem 0 .45rem; color: #decbb4; font-style: italic; }
  .mobile-header nav { display: flex; justify-content: center; flex-wrap: wrap; }
  .mobile-header a {
    padding: .7rem .85rem;
    min-height: 44px;
    color: #f3e4ce;
    text-decoration-color: #b88758;
    text-underline-offset: .33rem;
  }
  .square { width: 100%; aspect-ratio: 1060 / 620; }
  .mobile-houses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    padding: .85rem 1rem max(1.25rem, env(safe-area-inset-bottom));
  }
  .mobile-houses a {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border-radius: .3rem;
    border: 1px solid #755139;
    color: #f7e7d0;
    background: #302019;
    text-align: center;
    text-decoration: none;
  }
  .mobile-houses img { display: block; width: 100%; height: auto; aspect-ratio: 1.8; object-fit: cover; }
  .mobile-houses span { padding: .45rem .25rem; line-height: 1.2; align-self: center; }
}

.room[data-world] {
  --room-ink: #fff1db;
  --room-muted: #e1c9aa;
  --room-line: #e9bd8059;
  --room-wash: #1c1511;
  color-scheme: dark;
  color: var(--room-ink);
  background: var(--room-wash);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  inset: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.room[data-world="memories"] { --room-wash: #20131d; }
.room[data-world="stories"] { --room-wash: #231610; }
.room[data-world="quiet"] { --room-wash: #201a24; }
.room[data-world] .room-page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}
.room-art { display: none; }
.room[data-world] .room-art {
  display: block;
  position: absolute;
  inset: 0;
}
.room-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 68% center; }
.room[data-world] .room-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--room-wash) 0%, rgb(24 16 13 / 89%) 27%, rgb(24 16 13 / 54%) 46%, transparent 68%);
  pointer-events: none;
}
.room[data-world] .room-header {
  flex: none;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: max(.55rem, env(safe-area-inset-top)) max(clamp(1.15rem, 4vw, 3.75rem), env(safe-area-inset-right)) .55rem max(clamp(1.15rem, 4vw, 3.75rem), env(safe-area-inset-left));
  border: 0;
  background: linear-gradient(rgb(21 14 12 / 86%), rgb(21 14 12 / 2%));
}
.room[data-world] .back, .room[data-world] .close {
  color: var(--room-ink);
  text-shadow: 0 1px 6px #17110e;
}
.room[data-world] .close {
  border: 1px solid var(--room-line);
  border-radius: 50%;
  background: #201610bd;
}
.room[data-world] .room-content {
  position: relative;
  width: min(50%, 43rem);
  padding: clamp(1.25rem, 7vh, 5rem) 1.5rem 2rem clamp(1.15rem, 4vw, 3.75rem);
  overflow: auto;
  scrollbar-color: #a88158 transparent;
}
.room[data-world] h2 {
  font-size: clamp(2.5rem, 4.8vw, 5.5rem);
  letter-spacing: -.04em;
  text-wrap: balance;
  text-shadow: 0 2px 16px #17110e;
}
.room[data-world] blockquote {
  background: #201711db;
  border-color: #dcaa70;
}
.room[data-world] .note, .room[data-world] summary, .room[data-world] .load-posts {
  color: var(--room-muted);
}
.room[data-world] .action {
  background: #f0d3a5;
  border: 1px solid #d6aa72;
  color: #301d13;
}
.room[data-world] .action:hover { background: #ffdfae; }
.room[data-world] .action:disabled { opacity: .65; cursor: wait; }
.room[data-world] input, .room[data-world] textarea {
  font: inherit;
  color: var(--room-ink);
  background: #1a130feb;
  border: 1px solid #aa835c;
  border-radius: .25rem;
}
.room[data-world] input:focus-visible { outline: 3px solid #c17b36; outline-offset: 4px; }
.post-box, .city-post {
  margin: 1.15rem 0;
  padding: .85rem 1rem;
  background: #1c1512e8;
  border: 1px solid var(--room-line);
  border-radius: .4rem;
}
.post-box summary, .discussion summary { cursor: pointer; padding: .25rem 0; }
.post-form { margin-top: .85rem; }
.post-form label { display: block; margin: .8rem 0; }
.post-form input { display: block; width: 100%; padding: .6rem .75rem; margin: .4rem 0; }
.post-status { margin-bottom: 0; }
.post-status:empty, .public-posts .note:empty, .replies .note:empty { display: none; }
.city-post h3 { font-size: 1.32rem; line-height: 1.2; margin: 0; color: #ffdfaf; }
.city-post p { margin-block: .5rem; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.city-post h3, .post-status { overflow-wrap: anywhere; }
.discussion {
  border-top: 1px solid var(--room-line);
  margin-top: .7rem;
  padding-top: .4rem;
}
.replies .city-post { background: transparent; }
.discussion > .post-box { background: transparent; border: 0; padding: 0; margin: .6rem 0 0; }
.load-posts {
  padding: .4rem .1rem;
  background: transparent;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 760px), (orientation: portrait) {
  .room[data-world] { overflow: auto; }
  .room[data-world] .room-page { height: auto; min-height: 100%; }
  .room[data-world] .room-header {
    position: sticky;
    top: 0;
    order: -1;
    background: var(--room-wash);
    border-bottom: 1px solid var(--room-line);
  }
  .room[data-world] .room-art {
    position: relative;
    height: clamp(13rem, 40svh, 30rem);
  }
  .room[data-world] .room-art::after {
    background: linear-gradient(180deg, transparent 70%, var(--room-wash) 100%);
  }
  .room[data-world] .room-content {
    width: 100%;
    overflow: visible;
    padding: .4rem max(1.15rem, env(safe-area-inset-right)) max(1.8rem, env(safe-area-inset-bottom)) max(1.15rem, env(safe-area-inset-left));
  }
}
