[hidden] { display: none !important; }
:root {
  --paper: #e9e6df;
  --ink: #1b1a18;
  --ink-2: #5d5a54;
  --ink-3: #8b877f;
  --line: rgba(27, 26, 24, 0.12);
  --card: rgba(252, 251, 248, 0.86);
  --card-solid: #fcfbf8;
  --radius: 14px;
  --serif: "Instrument Serif", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
body { color: var(--ink); transition: background-color .8s var(--ease), color .8s var(--ease); }

body.dark {
  --ink: #efede8; --ink-2: #a9a59d; --ink-3: #7c7972; --line: rgba(255, 255, 255, 0.12);
  --card: rgba(24, 25, 29, 0.78); --card-solid: #18191d;
}

/* ---------- shared controls ---------- */
.glass {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.08);
  transition: background-color .8s var(--ease), border-color .8s var(--ease), color .8s var(--ease);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--line); background: transparent; padding: 9px 14px; border-radius: 999px; font-size: 14px;
  transition: background-color .25s, border-color .25s, transform .25s var(--ease);
}
.btn:hover { background: rgba(127,127,127,.1); }
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
body.dark .btn.solid { color: #111; }
.btn.solid:hover { opacity: .9; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--card-solid); border-color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }

.toast {
  position: fixed; top: calc(18px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -8px);
  background: var(--ink); color: var(--card-solid); font-size: 13px; padding: 9px 16px; border-radius: 999px;
  opacity: 0; transition: opacity .3s, transform .3s var(--ease); pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.attrib {
  position: fixed; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); font-size: 11px; color: var(--ink-2);
  background: var(--card); padding: 3px 8px; border-radius: 6px; z-index: 5;
}
.attrib a:hover { text-decoration: underline; }

/* ---------- map page ---------- */
body.map { overflow: hidden; }
#viewer { position: fixed; inset: 0; }
#backdrop {
  position: fixed; inset: 0; background-size: cover; background-position: center; z-index: 1; pointer-events: none;
}
.loadbar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--ink); z-index: 40; opacity: .6; transition: width .3s, opacity .6s; }
.title {
  position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); left: 16px; padding: 12px 16px 13px; z-index: 10;
  max-width: calc(100vw - 32px);
}
.title a.back { font-size: 12px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.title a.back:hover { color: var(--ink); }
.title h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
.title p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }

.dock {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; z-index: 10; max-width: calc(100vw - 24px);
  flex-wrap: nowrap; justify-content: center; border-radius: 999px;
}
.timebox { display: flex; align-items: center; gap: 12px; }
.timebox .clock { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; min-width: 46px; }
.timebox .phase { font-size: 12px; color: var(--ink-2); min-width: 44px; }
.slider { position: relative; width: 210px; height: 28px; cursor: pointer; touch-action: none; }
.slider .track {
  position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #1b2030 0%, #1b2030 18%, #e0b48a 23%, #d9e2ea 28%, #d9e2ea 68%, #e8b27f 74%, #b88c86 78%, #1b2030 82%, #1b2030 100%);
}
.slider .knob {
  position: absolute; top: 4px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: var(--card-solid); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.22);
  display: flex; align-items: center; justify-content: center;
}
.slider .knob::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun, #e9a54b); transition: background .4s; }
.slider:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 8px; }
.live { font-size: 12px; padding: 6px 10px; }
.live .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; }
.live[aria-pressed="true"] .dot { opacity: 1; background: #3fae6a; box-shadow: 0 0 0 0 rgba(63,174,106,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,174,106,.55); } 70% { box-shadow: 0 0 0 8px rgba(63,174,106,0); } 100% { box-shadow: 0 0 0 0 rgba(63,174,106,0); } }
.sep { width: 1px; height: 22px; background: var(--line); }

.zoombar { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; padding: 4px; gap: 2px; z-index: 10; border-radius: 999px; }
.zoombar .btn { border: 0; }

body.touring .title, body.touring .zoombar { opacity: 0; pointer-events: none; transition: opacity .6s; }
body.touring .dock > :not(#tour) { opacity: .25; transition: opacity .6s; }

@media (max-width: 640px) {
  .title h1 { font-size: 24px; }
  .slider { width: 150px; }
  .dock { border-radius: 22px; gap: 6px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; padding: 8px; }
  .zoombar { display: none; }
  .timebox .phase { display: none; }
}

/* ---------- home ---------- */
body.home { overflow-x: hidden; }
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 48px) 18px; pointer-events: none;
}
.nav > * { pointer-events: auto; }
.wordmark { font-family: var(--serif); font-size: 24px; letter-spacing: -0.01em; }
.nav .links { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); }
.nav .links a { font-size: 14px; padding: 8px 12px; border-radius: 999px; }
.nav .links a:hover { background: rgba(127,127,127,.12); }

.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
#heroMap { position: absolute; inset: 0; }
.hero-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--veil, rgba(233,230,223,.92)) 0%, var(--veil, rgba(233,230,223,.75)) 28%, rgba(0,0,0,0) 62%),
              linear-gradient(0deg, var(--veil, rgba(233,230,223,.85)) 0%, rgba(0,0,0,0) 30%); transition: --veil .8s; }
body.dark .hero-veil { --veil: rgba(15,17,21,.88); }
.hero-copy { position: absolute; left: clamp(16px, 4vw, 48px); bottom: clamp(40px, 10vh, 110px); max-width: min(560px, calc(100vw - 32px)); }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 12px 6px 10px; border-radius: 999px; margin-bottom: 22px; }
.chip .sun { width: 10px; height: 10px; border-radius: 50%; background: var(--sun, #e9a54b); box-shadow: 0 0 0 3px rgba(233,165,75,.18); }
.chip b { font-variant-numeric: tabular-nums; font-weight: 600; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 8.2vw, 116px); line-height: .95; letter-spacing: -0.02em; margin: 0 0 22px; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .line > span { display: inline-block; }
.hero p.lede { font-size: clamp(15px, 1.4vw, 18px); line-height: 1.6; color: var(--ink-2); margin: 0 0 28px; max-width: 470px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.cta .btn { padding: 12px 20px; font-size: 15px; }
.hero-city {
  position: absolute; right: clamp(16px, 4vw, 48px); bottom: clamp(40px, 10vh, 110px); text-align: right;
}
.hero-city .name { font-family: var(--serif); font-size: 30px; line-height: 1; }
.hero-city .sub { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.hero-city .dots { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.hero-city .dots button { width: 22px; height: 3px; border: 0; padding: 0; border-radius: 3px; background: var(--line); cursor: pointer; position: relative; overflow: hidden; }
.hero-city .dots button i { position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; }
@media (max-width: 760px) { .hero-city { display: none; } .nav .links a.hide-sm { display: none; } }

section.block { padding: clamp(72px, 12vh, 140px) clamp(16px, 4vw, 48px); max-width: 1280px; margin: 0 auto; }
.block-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.block-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 64px); line-height: 1; margin: 0; letter-spacing: -0.015em; }
.block-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
.card { display: block; position: relative; border-radius: 18px; overflow: hidden; background: var(--card-solid); border: 1px solid var(--line); transform-style: preserve-3d; will-change: transform; }
.card .thumb { aspect-ratio: 3 / 2; overflow: hidden; position: relative; }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .8s; }
.card:hover .thumb img { transform: scale(1.05); }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 16px 18px 18px; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; line-height: 1; }
.card .sub { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.card .count { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card .go { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--card); backdrop-filter: blur(12px); opacity: 0; transform: scale(.8); transition: opacity .35s, transform .35s var(--ease); }
.card:hover .go { opacity: 1; transform: none; }
.cn-card { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding: 18px 22px; border-radius: 18px; border: 1px dashed var(--line); font-size: 15px; }
.cn-card:hover { background: rgba(127,127,127,.06); }
.make-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .make-grid { grid-template-columns: 1fr; } }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 14px 0; border-top: 1px solid var(--line); display: flex; gap: 14px; font-size: 15px; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--serif); font-size: 20px; color: var(--ink-3); min-width: 30px; }
pre { margin: 0; background: #16171a; color: #e9e7e2; border-radius: 16px; padding: 20px 22px; overflow-x: auto; font-size: 13px; line-height: 1.7; }
pre .c { color: #8c8a84; }
footer.foot { padding: 30px clamp(16px, 4vw, 48px) 40px; max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
footer.foot a:hover { color: var(--ink); }

.flip { position: fixed; z-index: 60; object-fit: cover; pointer-events: none; border-radius: 18px; }

/* ---------- building picking ---------- */
.pick-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.pick-layer polygon { stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pick-layer .hover { fill: rgba(255, 255, 255, .10); stroke: rgba(27, 26, 24, .55); stroke-width: 1.5; }
.pick-layer .sel { fill: rgba(255, 244, 214, .22); stroke: #1b1a18; stroke-width: 2.2; }
body.dark .pick-layer .hover { fill: rgba(255, 220, 160, .08); stroke: rgba(255, 230, 190, .6); }
body.dark .pick-layer .sel { fill: rgba(255, 210, 140, .16); stroke: #ffd79a; }
.bcard {
  position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; width: min(320px, calc(100vw - 32px)); z-index: 12;
  padding: 18px 20px 16px;
}
.bcard .bclose { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.bcard .bclose:hover { background: rgba(127,127,127,.12); color: var(--ink); }
.bcard .kicker { font-size: 12px; color: var(--ink-2); letter-spacing: .02em; margin-bottom: 6px; text-transform: capitalize; }
.bcard h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.08; margin: 0 28px 0 0; }
.bcard .alt { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.bcard dl { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.bcard dl > div { border-top: 1px solid var(--line); padding-top: 8px; }
.bcard dt { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.bcard dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.bcard dd small { font-size: 11px; color: var(--ink-3); }
.bcard .links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 13px; }
.bcard .links a { color: var(--ink-2); border-bottom: 1px solid var(--line); }
.bcard .links a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .bcard { top: auto; bottom: calc(132px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; width: auto; }
}

.seg { display: flex; background: rgba(127,127,127,.12); border-radius: 999px; padding: 3px; }
.seg button { white-space: nowrap; border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--ink-2); transition: background-color .25s, color .25s; }
.seg button[aria-pressed="true"] { background: var(--card-solid); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
@media (max-width: 1180px) { .dock { flex-wrap: wrap; border-radius: 24px; } }
