:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --surface: #fffef9;
  --ink: #243349;
  --muted: #576477;
  --rule: #c6c9c4;
  --blue: #294761;
  --serif: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --gutter: clamp(16px, 3.2vw, 60px);
  --frame: 1504px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-width: 280px; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #3267a5; outline-offset: 5px; }
button { color: inherit; }
[hidden] { display: none !important; }
.wrap { width: min(calc(100% - 2 * var(--gutter)), var(--frame)); margin-inline: auto; }
.skip { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 10px 15px; background: var(--surface); transform: translateY(-180%); }
.skip:focus { transform: none; }

.masthead {
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 42px);
  min-height: clamp(66px, 6vw, 88px); margin-inline: auto;
  width: min(calc(100% - 2 * var(--gutter)), var(--frame));
}
.brand { display: inline-flex; gap: 10px; align-items: center; flex-shrink: 0; font: italic 600 clamp(22px, 2vw, 31px)/1 var(--serif); letter-spacing: -.055em; }
.brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav, .utility { display: flex; align-items: center; }
.nav { margin-left: auto; gap: clamp(13px, 1.8vw, 34px); }
.utility { gap: clamp(9px, 1.4vw, 23px); }
.nav a, .lang { padding-block: 10px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.nav a:hover, .lang:hover { text-decoration: underline; text-underline-offset: 5px; }
.view-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #aeb7bb;
  border-radius: 999px; background: #f7f7f2; white-space: nowrap; font-size: .78rem;
}
.view-switch :is(button, a) { display: inline-flex; gap: 5px; align-items: center; border: 0; background: transparent; border-radius: 999px; padding: 5px 11px; line-height: 1.3; }
.view-switch :is([aria-pressed="true"], [aria-current="true"], .active) { color: white; background: var(--ink); }

.scene {
  overflow: hidden; border: 1px solid #b7b8ae; border-radius: 6px;
  background: #f4f0e7;
}
.room-stage {
  position: relative; isolation: isolate; overflow: hidden; background: #d7c1a6;
  height: clamp(365px, min(55vw, 70svh), 800px);
}
.room-poster, .room-poster img, .room-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.room-poster img { object-fit: cover; }
.room-stage canvas { visibility: hidden; touch-action: pan-y pinch-zoom; }
.room-stage[data-room-ready="true"] canvas { visibility: visible; cursor: grab; }
.room-stage[data-room-ready="true"] canvas:active { cursor: grabbing; }
.room-stage canvas:focus-visible { outline-offset: -4px; }
.room-stage[data-room-ready="true"] .room-poster { visibility: hidden; }
.room-pin {
  position: absolute; z-index: 1; transform: translate(-50%, -50%); white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px;
  padding: 5px 12px; border: 1px solid #fffc; border-radius: 20px;
  color: #283a43; background: #fffaf0ee; box-shadow: 0 2px 10px #37231638;
  font-size: clamp(.72rem, .83vw, .9rem); font-weight: 650; line-height: 1.3;
}
.room-pin i { width: 7px; height: 7px; border-radius: 50%; background: #547b78; }
.room-pin:is(:hover, :focus-visible, [data-object-hover]) { background: white; color: #192b40; box-shadow: 0 2px 12px #37231658; }
.room-pin:is(:hover, :focus-visible, [data-object-hover]) i { background: #b06631; }
.room-pin[data-room-pin="album"] { left: 20%; top: 71%; }
.room-pin[data-room-pin="profile"] { left: 48%; top: 72%; }
.room-pin[data-room-pin="mail"] { left: 79%; top: 65%; }
.room-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: clamp(15px, 1.6vw, 25px) clamp(18px, 2.4vw, 38px);
  border-top: 1px solid #c7c3b6; background: #faf8f1;
}
.room-caption h1 { font: 550 clamp(25px, 2.55vw, 43px)/1.17 var(--serif); margin: 0; letter-spacing: -.045em; }
.room-caption p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.room-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.room-tools button {
  align-items: center; justify-content: center; gap: 7px; min-height: 42px;
  border: 1px solid #aaa996; border-radius: 24px; padding: 6px 14px;
  color: var(--ink); background: #fffdf7; font: 600 .82rem/1.25 var(--sans);
}
.room-tools button:hover { background: #eeeade; }
.room-tools button span[aria-hidden] { font-size: 1.15rem; font-family: var(--sans); }
.light-switch { display: inline-flex; }
.light-switch[aria-pressed="true"] { color: #fcf6df; background: #334158; border-color: #334158; }
.room-tools .light-switch[aria-pressed="true"]:hover { background: #424f63; }
.camera-help, .room-reset, .touch-help, .room-zoom { display: none; }
.room-zoom { align-items: center; }
.room-tools .room-zoom button { padding-inline: 0; width: 38px; font-size: 1.15rem; }
.room-zoom button:first-child { border-radius: 22px 0 0 22px; }
.room-zoom button:last-child { border-radius: 0 22px 22px 0; margin-left: -1px; }
.room-zoom button:disabled { opacity: .45; cursor: default; }
.room-stage[data-room-ready="true"] + .room-bar .room-zoom { display: inline-flex; }
.room-stage[data-room-ready="true"] + .room-bar .camera-help { display: block; }
.room-stage[data-room-ready="true"] + .room-bar .room-reset { display: inline-flex; }
.room-stage[data-room-ready="true"] + .room-bar .still-help { display: none; }
html[data-light="night"] .room-poster { filter: brightness(.58) saturate(.78) hue-rotate(14deg); }
html[data-view="journal"] .scene, html:not([data-view="journal"]) .journal { display: none; }
.location {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font: 650 .72rem/1.45 var(--sans); letter-spacing: .14em; text-transform: uppercase;
}
.location svg { width: 14px; height: 14px; }
.lede { max-width: 35em; margin: 0; font-size: clamp(14px, 1.15vw, 19px); line-height: 1.7; }
.action {
  width: fit-content; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 10px 20px; margin-top: 19px; min-height: 40px; font-size: .86rem; font-weight: 650;
  border: 1px solid transparent; background: var(--blue); color: white; border-radius: 999px;
}
.action:hover { background: #1c334e; }

.journal {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 5%;
  min-height: 430px; padding: clamp(28px, 5vw, 82px); border: 1px solid var(--rule);
  border-radius: 5px; background: linear-gradient(114deg, #f4efdc, #faf7eb 59%, #f1ecdc);
}
.journal-copy { max-width: 54ch; }
.journal-copy h1, .journal-copy h2 { margin: .23em 0; font: italic 500 clamp(45px, 6.6vw, 105px)/1.08 var(--serif); letter-spacing: -.055em; }
.journal-copy p:not(.location) { line-height: 1.8; }
.journal-art { margin: 0; min-width: 0; width: 100%; height: auto; max-height: 360px; object-fit: cover; border: 8px solid #fffcf2; box-shadow: 0 3px 13px #55472c20; transform: rotate(1deg); }

.shelf, .places { margin-block: clamp(42px, 5.2vw, 80px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); margin-bottom: clamp(17px, 2vw, 30px); }
.section-head h2, .places h2 { font: 550 clamp(27px, 3.2vw, 50px)/1.2 var(--serif); letter-spacing: -.055em; margin: 0; }
.section-head > a { font-size: .81rem; font-weight: 650; }
.section-head > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); gap: clamp(14px, 1.7vw, 28px); }
.feature {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  text-align: left; width: 100%; min-height: clamp(200px, 18.5vw, 302px);
  color: var(--ink); padding: clamp(20px, 2.6vw, 43px); border: 1px solid var(--rule);
  border-radius: 4px; background: #eae8dc;
}
.feature-copy { z-index: 1; width: 51%; }
.feature h3 { font: 550 clamp(24px, 2.5vw, 40px)/1.15 var(--serif); margin: .3em 0; letter-spacing: -.045em; }
.feature-copy p { margin: 0; font-size: .9rem; line-height: 1.6; }
.feature-copy small { color: var(--muted); font: italic 500 clamp(15px,1.3vw,20px)/1.2 var(--serif); }
.feature-copy > span { display: inline-grid; place-items: center; width: 29px; height: 29px; border: 1px solid #a7afaf; border-radius: 50%; margin-top: 14px; font-size: 15px; }
.feature-art { position: absolute; right: 0; top: 0; width: 44%; height: 100%; object-fit: cover; z-index: 0; transition: width .2s; }
.feature:hover .feature-art { width: 46%; }
.feature-world .feature-art { object-position: 78% center; }
.feature-gallery { background: #f4ece4; }
.feature-world { background: #e9eef0; }
.feature :is(a, button):hover { text-decoration: underline; text-underline-offset: 3px; }
.place-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(195px,100%),1fr)); }
.place-list a { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; padding: 12px 20px 14px 0; border-bottom: 1px solid var(--rule); }
.place-list a:hover { color: #476f99; }
.place-list strong { font: 600 1.25rem/1.3 var(--serif); }
.place-list span { grid-column: 1; color: var(--muted); margin-top: 4px; font-size: .84rem; }
.place-list b { grid-column: 2; grid-row: 1/3; align-self: center; font-weight: 400; }
.foot { display: flex; justify-content: space-between; width: min(calc(100% - 2 * var(--gutter)), var(--frame)); margin: auto; border-top: 1px solid var(--rule); padding-block: 22px 30px; color: var(--muted); font-size: .8rem; }
.foot a:hover { text-decoration: underline; }

body:has(dialog[open]) { overflow: hidden; }
.modal { position: fixed; max-width: min(770px, calc(100vw - 32px)); width: max-content; min-width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: clamp(22px, 3.4vw, 53px); overflow: auto; border: 1px solid #b2bbc1; border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 100px #1423383d; }
.modal::backdrop { background: #192c46a8; backdrop-filter: blur(3px); }
.modal h2 { margin: .25em 0 .42em; font: 550 clamp(27px, 3vw, 44px)/1.15 var(--serif); }
.modal p { line-height: 1.7; }
.close { position: absolute; top: 11px; right: 11px; z-index: 3; display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--rule); border-radius: 50%; background: #fffef6ed; font-size: 18px; }
.close:hover, .gallery-controls button:hover { background: #eaf0ed; }
.profile-layout, .gallery-layout { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: clamp(18px, 3vw, 38px); align-items: center; }
.profile-layout img { width: 100%; height: auto; max-height: 250px; object-fit: contain; }
.gallery-photo { position: relative; margin: 0; width: 100%; aspect-ratio: 1; background: #efede5; overflow: hidden; }
.gallery-photo figure { position: absolute; inset: 0; margin: 0; display: grid; grid-template-rows: minmax(0,1fr) auto; }
.gallery-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gallery-photo figcaption { padding: 8px; font-size: .85rem; text-align: center; }
.gallery-info > a { display: inline-block; margin-top: 22px; }
.gallery-controls { display: flex; align-items: center; gap: 8px; }
.gallery-controls button { padding: 6px 12px; min-height: 36px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); }
.mail-content { max-width: 53ch; }
.modal a:not(.action) { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .room-stage { height: clamp(320px, 54vw, 470px); }
}
@media (max-width: 680px) {
  .masthead { flex-wrap: wrap; gap: 0 10px; padding-block: 12px 0; min-height: 0; }
  .brand { font-size: 24px; }
  .brand img { width: 28px; height: 28px; }
  .utility { margin-left: auto; }
  .view-switch :is(button, a) { padding-inline: 8px; }
  .nav { order: 3; width: 100%; justify-content: flex-start; gap: 21px; margin-top: 5px; }
  .nav a { padding: 8px 0 10px; font-size: .78rem; }
  .room-stage { height: auto; aspect-ratio: 1.16; }
  .room-bar { align-items: flex-start; flex-wrap: wrap; gap: 10px 18px; padding: 15px; }
  .room-tools button { min-height: 39px; padding-inline: 12px; }
  .room-pin { gap: 4px; min-height: 29px; padding: 4px 7px; font-size: .67rem; }
  .room-pin i { width: 5px; height: 5px; }
  .room-pin[data-room-pin="album"] { left: max(14%, 44px); top: 67%; }
  .room-pin[data-room-pin="profile"] { left: 48%; top: 70%; }
  .room-pin[data-room-pin="mail"] { left: min(88%, calc(100% - 38px)); top: 61%; }
  .journal { grid-template-columns: 1fr; gap: 20px; padding: 28px 20px; }
  .journal-art { max-height: 235px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature { min-height: 175px; }
  .shelf, .places { margin-block: 35px; }
  .feature h3 { font-size: 27px; }
  .place-list { grid-template-columns: 1fr 1fr; }
  .place-list a { overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .profile-layout, .gallery-layout { grid-template-columns: 1fr; gap: 14px; }
  .gallery-photo { aspect-ratio: 1.45; }
  .profile-layout img { max-height: 170px; }
  .modal { min-width: 0; width: calc(100% - 26px); }
}
@media (max-width: 350px) {
  .brand { gap: 5px; font-size: 19px; }
  .brand img { width: 24px; height: 24px; }
  .view-switch { font-size: .7rem; }
  .utility { gap: 6px; }
}
@media (pointer: coarse) {
  .touch-help { display: inline; }
  .drag-help { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
