:root {
  --paper: #f4eee2; --paper2: #ebe2d0; --ink: #1b1712; --muted: #5e5548; --rule: rgba(27, 23, 18, .16);
  --brass: #85581a; --deep: #12100d;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--deep); color: var(--ink); font: 16px/1.55 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- the 3D stage ---------- */
.stage { position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: #7a8ca6; touch-action: none; overscroll-behavior: none; }
.stage .card, .stage .explore { touch-action: pan-y; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- HUD: one system. Paper chips, 3px corners, 44px targets, 16px gutters ---------- */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; pointer-events: none; background: linear-gradient(rgba(18, 16, 13, .38), rgba(18, 16, 13, 0)); }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.brand img { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.brand span { min-width: 0; }
.brand b { display: block; font: 700 18px/1.1 Cinzel, serif; letter-spacing: .04em; white-space: nowrap; }
.brand small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .92; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.chip, .topnav .solid, .topnav .plain, .bottom .acts button, .bottom .acts a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 3px; font-weight: 700; font-size: 14px; letter-spacing: .01em; text-decoration: none; cursor: pointer; white-space: nowrap; }
.topnav .solid { background: var(--paper); color: var(--ink); border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); }
.topnav .plain { background: var(--ink); color: var(--paper); }
.solid, .card .go, .join .go { background: var(--ink); color: var(--paper); border: 0; border-radius: 3px; padding: 12px 18px; min-height: 44px; font-weight: 700; font-size: 14px; letter-spacing: .02em; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.loading { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--deep); transition: opacity .9s, visibility .9s; }
.loading img { border-radius: 50%; }
.loading span { font: 600 14px Cinzel, serif; letter-spacing: .14em; color: #e8d9b8; text-align: center; padding: 0 24px; }
.loading.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.skip { position: absolute; right: 16px; bottom: 84px; z-index: 5; background: rgba(18, 16, 13, .6); color: #fff; border: 1px solid rgba(255, 255, 255, .45); border-radius: 3px; padding: 0 14px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 13px; }

/* labels: small map callouts on a hairline leader */
.tags { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .8s; }
.tags.on { opacity: 1; }
.tag { position: absolute; left: 0; top: 0; padding: 0 0 calc(12px + var(--lift, 0px)); border: 0; background: none; cursor: pointer; pointer-events: none; text-align: center; transition: opacity .3s; white-space: nowrap; }
.tag b { display: block; background: rgba(244, 238, 226, .94); color: var(--ink); font: 700 11.5px/1.2 Cinzel, serif; letter-spacing: .04em; padding: 5px 8px 4px; border-radius: 2px; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.tag small { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 5px rgba(0, 0, 0, .75); }
.tag::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: calc(12px + var(--lift, 0px)); background: rgba(244, 238, 226, .85); }
.tag.client small { display: none; }
.tag.product b { font: 700 10px/1.2 Manrope, sans-serif; letter-spacing: .03em; padding: 3px 6px; }
.tag.sun b { background: #2a1a08; color: #ffd38a; }
.tag.lot b { background: rgba(18, 16, 13, .35); color: #fff; border: 1px dashed rgba(255, 255, 255, .85); box-shadow: none; }
@media (min-width: 1100px) { .tag.client small { display: block; } }

.bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); pointer-events: none; background: linear-gradient(rgba(18, 16, 13, 0), rgba(18, 16, 13, .32)); }
.bottom > * { pointer-events: auto; }
.time { display: flex; align-items: center; gap: 10px; min-height: 44px; background: var(--paper); border-radius: 3px; padding: 0 14px; font-size: 12px; font-weight: 700; color: var(--muted); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.time input { width: 150px; height: 32px; accent-color: var(--brass); }
.time b { color: var(--ink); min-width: 60px; font-variant-numeric: tabular-nums; }
.bottom .acts { display: flex; gap: 8px; align-items: center; }
.bottom .acts button { background: var(--paper); color: var(--ink); border: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.bottom .acts a { color: #fff; padding: 0 6px; text-decoration: underline; text-underline-offset: 4px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.hint { position: absolute; left: 50%; bottom: 76px; z-index: 3; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 3px; background: rgba(18, 16, 13, .55); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; transition: opacity 1s 6s; }
.hint .tch { display: none; }
@media (pointer: coarse) { .hint .desk { display: none; } .hint .tch { display: inline; } }
body.live .hint { opacity: 0; }
body.carding .hint { display: none; }

/* portal card: an editorial page, screenshot first */
.card { position: absolute; z-index: 6; top: 76px; right: 16px; width: 420px; max-height: calc(100% - 160px); overflow: auto; background: var(--paper); color: var(--ink); border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, .38); transform: translateX(calc(100% + 30px)); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.card.open { transform: none; }
.card .x, .explore .x { position: absolute; right: 8px; top: 8px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 1px 6px rgba(0, 0, 0, .2); }
.card .shot { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: #d8cfbd; border-bottom: 1px solid var(--rule); }
.card .shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card .txt { padding: 18px 22px 18px; }
.card .eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.card h2 { margin: 0 0 8px; font: 700 27px/1.12 Cinzel, serif; }
.card .what { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: #2e2820; }
.card .acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card .acts .go { flex: 1 1 auto; }
.card .sub { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.card .sub .dom { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .more { margin-left: auto; background: none; border: 0; padding: 10px 0; min-height: 44px; font-weight: 700; font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; }
.card .won { margin: 0; padding: 10px 22px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; }
.card .txt:first-child { padding-top: 24px; padding-right: 56px; }

/* places: a contact sheet of every site */
.explore { position: absolute; z-index: 7; top: 70px; right: 16px; width: 600px; max-width: calc(100% - 32px); max-height: calc(100% - 150px); overflow: auto; background: var(--paper); border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, .38); padding: 18px 20px 20px; transform: translateY(-10px); opacity: 0; visibility: hidden; transition: transform .3s, opacity .3s, visibility .3s; }
.explore.open { transform: none; opacity: 1; visibility: visible; }
.explore { scroll-padding-bottom: 20px; }
.explore::after { content: ""; position: sticky; bottom: -20px; display: block; height: 28px; margin: 0 -20px -20px; background: linear-gradient(rgba(244, 238, 226, 0), var(--paper)); pointer-events: none; }
.explore .startrow { display: flex; margin-top: 14px; } .explore .startrow .go { flex: 1; background: var(--ink); color: var(--paper); border-radius: 3px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; text-decoration: none; }
.explore h2 { margin: 0 0 4px; font: 700 22px Cinzel, serif; }
.explore h3 { margin: 16px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); }
.explore ul { list-style: none; margin: 0; padding: 0; }
.explore .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; }
.explore .grid.small { grid-template-columns: repeat(5, 1fr); gap: 12px 10px; }
.explore .grid.more { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.explore .grid button { display: block; width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.explore .grid img, .explore .grid .ph { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--rule); background: #d8cfbd; transition: transform .2s; }
.explore .grid button:hover img { transform: translateY(-2px); }
.explore .grid b { display: block; margin-top: 7px; font-size: 13.5px; font-weight: 800; line-height: 1.25; }
.explore .grid span { display: block; font-size: 12px; color: var(--muted); }
.explore .grid.small b { font-size: 12px; } .explore .grid.small span { font-size: 11px; }
.explore .grid.more button { display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 3px; }
.explore .grid.more .ph { grid-row: span 2; width: 40px; height: 40px; aspect-ratio: auto; border-radius: 50%; border: 0; background: radial-gradient(circle, #ffd38a 0 38%, #e29a3a 40% 62%, transparent 64%); }
.explore .grid.more .lot .ph { background: none; border: 2px dashed var(--brass); }
.explore .grid.more b { margin: 0; }
.nojs { position: absolute; inset: 0; display: grid; place-content: center; padding: 24px; background: var(--deep); color: #eee; text-align: center; z-index: 9; }

@media (max-width: 1100px) { .explore .grid.small { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .top { padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .brand img { width: 32px; height: 32px; }
  .brand b { font-size: 15px; } .brand small { font-size: 9.5px; letter-spacing: .1em; }
  .topnav .plain { padding: 0 12px; } .topnav .plain .wide { display: none; } .brand small { display: none; }
  .topnav .solid { padding: 0 14px; }
  .bottom { padding: 10px 12px max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .time { flex: 1 1 auto; min-width: 0; padding: 0 10px; gap: 8px; } .time span { display: none; } .time input { flex: 1; width: auto; min-width: 0; } .time b { min-width: 54px; font-size: 12px; }
  .bottom .acts a.about { display: none; }
  .bottom .acts button { padding: 0 12px; }
  .hint { bottom: 72px; font-size: 11px; white-space: normal; width: max-content; max-width: calc(100% - 32px); text-align: center; }
  .skip { bottom: 128px; }
  body.carding .bottom { display: none; }
  /* bottom sheet: compact, the world stays visible above it */
  .card { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 56%; border-radius: 12px 12px 0 0; transform: translateY(105%); padding-bottom: env(safe-area-inset-bottom); }
  .card .shot { aspect-ratio: 16 / 6.5; }
  .card .sub { margin-top: 6px; }
  .card .txt { padding: 12px 16px 14px; }
  .card h2 { font-size: 21px; margin-bottom: 4px; } .card .eyebrow { margin-bottom: 4px; font-size: 10.5px; }
  .card .what { font-size: 14.5px; margin-bottom: 10px; }
  .card .x { top: 6px; right: 6px; width: 44px; height: 44px; font-size: 22px; }
  .explore { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 78%; border-radius: 12px 12px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); transform: translateY(20px); }
  .explore .grid { grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
  .explore .grid.small { grid-template-columns: repeat(3, 1fr); }
  .explore .grid.more { grid-template-columns: 1fr 1fr; }
  .explore .grid.more button { grid-template-columns: 32px 1fr; padding: 8px 10px; } .explore .grid.more .ph { width: 32px; height: 32px; }
}
@media (max-height: 800px) and (min-width: 761px) { .card { top: 70px; max-height: calc(100% - 140px); } .card .shot { aspect-ratio: 16 / 9; } .explore { max-height: calc(100% - 140px); } }

/* ---------- the crawlable page under the world ---------- */
.page { background: var(--paper); color: var(--ink); padding: 56px 20px 40px; }
.page > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.intro .kicker { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); }
.intro h1 { margin: 0 0 14px; font: 700 clamp(28px, 4.4vw, 44px)/1.12 Cinzel, serif; max-width: 22ch; }
.intro .lead { margin: 0; font-size: 18px; max-width: 64ch; color: #2e2820; }
.list { margin-top: 52px; }
.list h2, .join h2 { font: 700 22px Cinzel, serif; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.portals { list-style: none; margin: 0; padding: 0; }
.portals > li { display: grid; grid-template-columns: 260px 1fr; gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.portals img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--rule); display: block; }
.portals h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.portals h3 a { text-decoration: none; border-bottom: 2px solid var(--brass); }
.portals .place { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.portals p { margin: 0; }
.portals.small { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 28px; }
.portals.small > li { grid-template-columns: 1fr; padding: 16px 0; }
.join { margin-top: 52px; }
.join p { max-width: 60ch; }
.credits { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .portals > li { grid-template-columns: 1fr; gap: 12px; } .page { padding-top: 40px; } }

/* ---------- explorer mode (land + walk) ---------- */
.card .land { background: none; border: 1px solid var(--ink); color: var(--ink); border-radius: 3px; padding: 11px 14px; min-height: 44px; font-weight: 700; font-size: 14px; cursor: pointer; }
.card .land:hover { background: var(--ink); color: var(--paper); }
.card .won { margin: 0 0 10px; padding: 8px 10px; border-left: 3px solid var(--brass); background: var(--paper2); font-size: 14px; font-weight: 700; }
body.exploring .tags, body.exploring .bottom, body.exploring .skip { display: none; }
.exhud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.exhud > * { pointer-events: auto; }
.exhud .quest { position: absolute; left: 16px; top: max(64px, calc(env(safe-area-inset-top) + 56px)); max-width: min(420px, calc(100% - 32px)); display: flex; gap: 10px; align-items: flex-start; background: rgba(244, 238, 226, .94); color: var(--ink); border-radius: 3px; padding: 9px 12px 9px 10px; box-shadow: 0 2px 12px rgba(0, 0, 0, .22); pointer-events: none; }
.exhud .quest b { display: block; font: 700 14px/1.25 Cinzel, serif; letter-spacing: .02em; }
.exhud .quest span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.exhud .quest .arrow { flex: 0 0 22px; width: 22px; height: 22px; color: var(--brass); margin-top: 2px; transition: transform .15s linear; }
.exhud .quest.free .arrow { visibility: hidden; }
.exhud .exacts { position: absolute; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.exhud .exacts button { background: var(--paper); color: var(--ink); border: 0; border-radius: 3px; padding: 10px 14px; min-height: 44px; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.exhud .exacts button.solid { background: var(--ink); color: var(--paper); }
.exhud .exhint { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, .75); pointer-events: none; white-space: nowrap; animation: exfade 1s 7s forwards; }
@keyframes exfade { to { opacity: 0; } }
.exhud .stick { position: absolute; left: 22px; bottom: max(26px, calc(env(safe-area-inset-bottom) + 12px)); width: 124px; height: 124px; border-radius: 50%; border: 2px solid rgba(244, 238, 226, .75); background: rgba(18, 16, 13, .18); touch-action: none; }
.exhud .stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(244, 238, 226, .92); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.exhud .toast { position: absolute; left: 50%; top: 38%; transform: translate(-50%, 8px); max-width: min(460px, calc(100% - 40px)); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 3px; font-weight: 700; font-size: 14px; text-align: center; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.exhud .toast.on { opacity: 1; transform: translate(-50%, 0); }
.journal { width: 380px; }
.journal.open { transition: none; }
.journal .jnote { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.journal canvas { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--rule); cursor: pointer; }
.journal ul li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; }
.journal ul li b { display: block; font-size: 14px; }
.journal ul li span { display: block; font-size: 12px; color: var(--muted); text-align: left; }
.journal ul li.done span { color: var(--brass); font-weight: 700; }
.journal .prog { display: flex; gap: 4px; }
.journal .prog i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--brass); }
.journal .prog i.on { background: var(--brass); }
.journal ul li button { background: none; border: 1px solid var(--ink); border-radius: 3px; padding: 6px 10px; min-height: 44px; font-weight: 700; font-size: 12px; cursor: pointer; }
.journal .more { background: none; border: 0; padding: 12px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 760px) {
  .journal { left: 12px; right: 12px; width: auto; max-height: calc(100% - 140px); }
  .exhud .exacts { flex-direction: column; align-items: stretch; }
  .exhud .quest { top: max(60px, calc(env(safe-area-inset-top) + 52px)); left: 12px; right: 12px; max-width: none; }
  .exhud .exhint { bottom: auto; top: 50%; }
  body.exploring .card { max-height: 66%; }
}
