:root {
  --paper: #f2ead8;
  --ink: #172729;
  --muted: #697273;
  --cinnabar: #a94936;
  --east-jade: #486d69;
  --west-navy: #0a2339;
  --west-gold: #c5a665;
  --serif-cn: "Songti SC", "STSong", "SimSun", serif;
  --serif-west: Georgia, "Times New Roman", serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.2,.75,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); overflow-x: hidden; }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.grain { position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .15; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"); }

.site-header { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 80px; padding: 0 3.4vw; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; color: #263a38; }
body[data-world="east"] .site-header, body[data-time="night"] .site-header { color: #f8f1df; }
body[data-world="east"] .site-header { background: linear-gradient(180deg,rgba(20,42,41,.64),rgba(20,42,41,0)); }
body[data-world="west"][data-time="night"] .site-header { background: linear-gradient(180deg,rgba(6,24,42,.5),rgba(6,24,42,0)); }
.brand { display: flex; align-items: center; gap: 11px; width: max-content; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid currentColor; border-radius: 50%; font-family: var(--serif-cn); font-size: 18px; }
.brand b { display: block; font-family: var(--serif-cn); font-size: 17px; font-weight: 600; letter-spacing: .18em; }
.brand small { display: block; margin-top: 2px; font-size: 8px; letter-spacing: .18em; opacity: .7; }
nav { display: flex; align-items: center; gap: 34px; font-size: 13px; letter-spacing: .16em; }
nav a { position: relative; opacity: .58; transition: opacity .25s; }
nav a:hover, nav a.active { opacity: 1; }
nav a.active::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.header-tools { justify-self: end; display: flex; align-items: center; gap: 24px; }
.date-range { font: 11px/1 var(--sans); letter-spacing: .16em; opacity: .75; }
.time-control { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .08em; }
.time-control select { max-width: 88px; padding: 6px 3px; color: inherit; background: transparent; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; cursor: pointer; font-size: 12px; }
.time-control option { color: #172729; background: #f2ead8; }

.page { min-height: 100svh; }
.home-page { position: relative; min-height: 100svh; padding: 118px 5vw 36px; background: radial-gradient(circle at 50% 12%, #fffdf5 0, #f2ead8 38%, #d9ccb4 100%); }
.home-page::before { content: "十"; position: absolute; left: 50%; top: 48%; transform: translate(-50%,-50%); font: 42vw/1 var(--serif-cn); color: rgba(53,70,66,.035); pointer-events: none; }
.home-intro { position: relative; z-index: 2; text-align: center; margin: 0 auto 30px; }
.eyebrow { margin: 0 0 12px; color: #66706d; font-size: 10px; letter-spacing: .34em; }
.home-intro h1 { margin: 0; font: 400 clamp(33px,4vw,61px)/1.15 var(--serif-cn); letter-spacing: .09em; }
.home-intro h1 i { color: var(--cinnabar); font-style: normal; }
.intro-note { margin: 14px 0 0; color: #6c7069; font-family: var(--serif-cn); font-size: 15px; letter-spacing: .08em; }

.world-gates { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 1240px; margin: 0 auto; }
.world-gate { isolation: isolate; position: relative; min-height: min(52vh, 520px); overflow: hidden; color: white; border-radius: 4px; box-shadow: 0 24px 60px rgba(32,35,30,.18); transition: transform .55s var(--ease), box-shadow .55s var(--ease); }
.world-gate:hover { transform: translateY(-7px); box-shadow: 0 32px 80px rgba(27,32,31,.26); }
.gate-art, .gate-shade { position: absolute; inset: 0; }
.gate-art { background-size: cover; background-position: center; transition: transform 1.4s var(--ease), filter .6s; }
.eastern-gate .gate-art { background-image: url("assets/eastern-map-day-v2.png"); }
.western-gate .gate-art { background-image: url("assets/western-map-day-v2.png"); }
.world-gate:hover .gate-art { transform: scale(1.055); }
.eastern-gate .gate-shade { background: linear-gradient(90deg, rgba(9,24,24,.82), rgba(24,43,39,.2) 75%), linear-gradient(0deg, rgba(12,28,27,.28), transparent); }
.western-gate .gate-shade { background: linear-gradient(90deg, rgba(7,30,49,.76), rgba(9,27,46,.04) 78%), linear-gradient(0deg, rgba(4,14,26,.18), transparent); }
.gate-number { position: absolute; top: 25px; right: 29px; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; font: italic 15px var(--serif-west); }
.gate-copy { position: absolute; z-index: 2; left: clamp(28px,4vw,58px); bottom: clamp(30px,5vh,54px); max-width: 390px; }
.gate-kicker { font-size: 9px; letter-spacing: .25em; opacity: .8; }
.gate-copy h2 { margin: 13px 0 14px; font: 400 clamp(42px,5vw,72px)/.88 var(--serif-cn); letter-spacing: .08em; }
.western-gate .gate-copy h2 { font-family: var(--serif-west); letter-spacing: -.045em; }
.western-gate .gate-copy h2 i { color: #e8cc91; }
.gate-copy p { margin: 0 0 25px; font: 14px/1.7 var(--serif-cn); letter-spacing: .05em; opacity: .86; }
.western-gate .gate-copy p { font-family: var(--serif-west); letter-spacing: .02em; }
.gate-cta { display: inline-flex; align-items: center; gap: 20px; padding: 11px 16px; border: 1px solid rgba(255,255,255,.7); font-size: 12px; letter-spacing: .1em; transition: background .25s,color .25s; }
.gate-cta b { font-size: 15px; font-weight: 400; }
.world-gate:hover .gate-cta { color: var(--ink); background: #f8f1df; }
.seal { position: absolute; z-index: 2; right: 36px; bottom: 38px; width: 40px; height: 40px; padding: 5px; display: grid; place-items: center; border: 2px solid #d7664e; color: #f28668; font: 14px/1 var(--serif-cn); transform: rotate(-6deg); }
.compass { position: absolute; right: 38px; bottom: 37px; color: #e4c47d; font-size: 38px; animation: breathe 3s ease-in-out infinite; }

.journey-counters { position: relative; z-index: 2; max-width: 720px; margin: 25px auto 0; display: flex; justify-content: space-around; color: #4b5754; }
.journey-counters p { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.journey-counters strong { font: 23px var(--serif-west); }
.journey-counters span { font-size: 11px; letter-spacing: .12em; }

.map-page { position: relative; height: 100svh; overflow: hidden; background: #172827; }
.west-page { background: #dce3dc; }
.map-stage { position: absolute; inset: 0 0 0 29%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: grab; }
.map-stage::-webkit-scrollbar { display: none; }
.map-stage.dragging { cursor: grabbing; user-select: none; }
.map-canvas { position: relative; width: max(100%, 177.8svh); height: 100%; overflow: hidden; }
.map-markers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.map-markers .location { pointer-events: auto; }
.map-image { position: absolute; inset: 0; background-size: 100% 100%; background-position: center; }
.eastern-image { background-image: url("assets/eastern-map-day-v2.png"); filter: saturate(.82) contrast(.96); }
.western-image { background-image: url("assets/western-map-day-v2.png"); filter: saturate(.95) contrast(1.01); }
.map-canvas::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.eastern-stage .map-canvas::after { background: linear-gradient(90deg, rgba(23,40,39,.42), transparent 18%); }
.western-stage .map-canvas::after { background: linear-gradient(90deg, rgba(247,245,235,.35), transparent 18%); }
.map-intro { position: absolute; z-index: 10; inset: 0 auto 0 0; width: 34%; min-width: 380px; padding: 120px 4vw 38px; display: flex; flex-direction: column; color: #f3ead9; }
.eastern-panel { background: linear-gradient(90deg,#192d2c 78%,transparent); }
.western-panel { color: #1a3448; background: linear-gradient(90deg,#f2f1e9 82%,rgba(242,241,233,.88) 94%,transparent); }
.back-home { width: max-content; padding: 0 0 7px; color: inherit; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.3); cursor: pointer; font-size: 11px; letter-spacing: .14em; opacity: .7; }
.chapter { margin: auto 0 13px; font-size: 10px; letter-spacing: .25em; opacity: .65; }
.map-intro > h1 { margin: 0; font: 400 clamp(42px,4.8vw,72px)/1 var(--serif-cn); letter-spacing: .08em; }
.western-panel > h1 { font-family: var(--serif-west); letter-spacing: -.05em; }
.western-panel > h1 i { color: var(--west-gold); }
.map-lede { max-width: 350px; margin: 18px 0 30px; font: 15px/1.8 var(--serif-cn); opacity: .74; }
.western-panel .map-lede { font-family: var(--serif-west); letter-spacing: .02em; }
.place-detail { max-width: 340px; min-height: 115px; padding: 21px 0 0; border-top: 1px solid currentColor; }
.detail-index { font-size: 9px; letter-spacing: .18em; opacity: .56; }
.place-detail h2 { margin: 9px 0 2px; font: 400 32px/1.15 var(--serif-cn); }
.western-panel .place-detail h2 { font-family: var(--serif-west); }
.western-panel .detail-note { max-width: 330px; margin: 12px 0 0; font-size: 14px; line-height: 1.7; }
.open-place { margin-top: 17px; padding: 10px 18px; color: inherit; background: rgba(255,255,255,.06); border: 1px solid currentColor; cursor: pointer; font-size: 13px; letter-spacing: .1em; transition: background .25s, transform .25s; }
.open-place:hover { background: rgba(255,255,255,.2); transform: translateY(-2px); }
.western-panel .open-place { background: #183b56; color: #fff9eb; border-color: #183b56; }
.western-panel .open-place:hover { background: #2d5774; }
body[data-time="night"] .western-panel .open-place { background: #d3b36f; color: #102b42; border-color: #d3b36f; }
.temple-action { margin-top: 16px; }
.incense-button { padding: 10px 15px; color: #f4e9d1; background: rgba(165,70,50,.22); border: 1px solid #ae6957; cursor: pointer; font-family: var(--serif-cn); font-size: 14px; letter-spacing: .1em; }
.incense-button:hover { background: rgba(165,70,50,.4); }
.incense-button:disabled { cursor: default; opacity: .7; }
.incense-message { min-height: 1.5em; margin: 10px 0 0; font-family: var(--serif-cn); font-size: 14px; color: #e6c992; }
.map-hint { margin: 20px 0 0; font-size: 10px; letter-spacing: .08em; opacity: .45; }

.location { position: absolute; z-index: 4; left: var(--x); top: var(--y); min-width: 44px; min-height: 44px; padding: 0; color: white; background: none; border: 0; cursor: pointer; transform: translate(-50%,-50%); }
.location::before { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%,-50%); transition: transform .3s,background .3s,box-shadow .3s; }
.location::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; border: 1px solid currentColor; border-radius: 50%; transform: translate(-50%,-50%); opacity: .62; transition: transform .35s,opacity .35s; }
.location span { position: absolute; left: 50%; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%,5px); transition: opacity .25s,transform .25s; }
.location span { bottom: calc(50% + 21px); padding: 7px 10px 5px; background: rgba(11,29,29,.88); font: 16px var(--serif-cn); letter-spacing: .1em; }
.west-location span { color: #1a3448; background: rgba(249,247,238,.93); box-shadow: 0 3px 12px rgba(29,41,50,.14); font: 14px var(--serif-west); letter-spacing: .03em; }
.east-location { color: #f4dba1; }
.east-location::before { background: #a94936; box-shadow: 0 0 0 3px rgba(255,244,211,.3), 0 0 18px rgba(210,157,90,.9); }
.west-location { color: #0f3e60; }
.west-location::before { width: 10px; height: 10px; border-radius: 0; background: #f5eee0; transform: translate(-50%,-50%) rotate(45deg); box-shadow: 0 0 0 3px #153c57, 0 0 14px rgba(255,255,255,.8); }
.location:hover::after, .location:focus-visible::after, .location.active::after { transform: translate(-50%,-50%) scale(1.45); opacity: 1; }
.location:hover::before, .location:focus-visible::before, .location.active::before { transform: translate(-50%,-50%) scale(1.3); }
.west-location:hover::before, .west-location.active::before { transform: translate(-50%,-50%) rotate(45deg) scale(1.3); }
.location:hover span, .location:focus-visible span, .location.active span { opacity: 1; transform: translate(-50%,0); }
.location.unlocked::after { animation: locationPulse 2.8s infinite; }

.moving-mist { position: absolute; z-index: 2; width: 54%; height: 24%; border-radius: 50%; background: radial-gradient(ellipse,rgba(245,240,219,.6),transparent 68%); filter: blur(18px); pointer-events: none; opacity: .58; }
.mist-one { left: 10%; top: 28%; animation: mistDrift 18s ease-in-out infinite alternate; }
.mist-two { left: 48%; top: 55%; animation: mistDrift 24s ease-in-out -8s infinite alternate-reverse; }
.orbit { position: absolute; z-index: 2; left: 50%; top: 50%; border: 1px solid rgba(220,190,120,.28); border-radius: 50%; pointer-events: none; }
.orbit-a { width: 58vw; height: 58vw; animation: spin 50s linear infinite; }
.orbit-b { width: 38vw; height: 38vw; border-style: dashed; animation: spin 38s linear infinite reverse; }

body[data-time="night"] .home-page { color: #f5ead8; background: radial-gradient(circle at 50% 5%, #2a3a4d, #101f2d 60%, #0b1825); }
body[data-time="night"] .home-page::before { color: rgba(230,222,190,.04); }
body[data-time="night"] .eyebrow, body[data-time="night"] .intro-note, body[data-time="night"] .journey-counters { color: #d9d8d2; }
body[data-time="night"] .eastern-image { background-image: url("assets/eastern-map-night-v2.png"); filter: saturate(.95); }
body[data-time="night"] .western-image { background-image: url("assets/western-map-night-v2.png"); filter: saturate(.95); }
body[data-time="night"] .eastern-gate .gate-art { background-image: url("assets/eastern-map-night-v2.png"); }
body[data-time="night"] .western-gate .gate-art { background-image: url("assets/western-map-night-v2.png"); }
body[data-time="night"] .eastern-stage .map-canvas::after { background: linear-gradient(90deg,rgba(10,25,31,.5),transparent 18%); }
body[data-time="night"] .western-stage .map-canvas::after { background: linear-gradient(90deg,rgba(8,23,42,.45),transparent 18%); }
body[data-time="night"] .western-panel { color: #f5edda; background: linear-gradient(90deg,#0b2840 82%,rgba(11,40,64,.88) 94%,transparent); }
body[data-time="night"] .west-location { color: #f3d894; }
body[data-time="night"] .west-location::before { background: #e3bd67; box-shadow: 0 0 15px rgba(226,190,106,.85); }
body[data-time="night"] .west-location span { color: #f5edda; background: rgba(5,20,36,.9); }
body[data-time="night"] .map-page.west-page { background: #071a2b; }

/* A place is a close view of its position on the world map. */
.place-page { position: relative; min-height: 100svh; isolation: isolate; }
.place-background, .place-wash { position: fixed; inset: 0; pointer-events: none; }
.place-background { z-index: -2; background-repeat: no-repeat; background-size: 180% auto; background-position: var(--scene-x,50%) var(--scene-y,50%); }
.place-wash { z-index: -1; }
.place-page[data-realm="east"] { color: #f6ecda; background: #1c3030; }
.place-page[data-realm="east"] .place-background { background-image: url("assets/eastern-map-day-v2.png"); }
.place-page[data-realm="east"] .place-wash { background: linear-gradient(90deg,rgba(12,31,32,.87),rgba(16,36,36,.48) 45%,rgba(16,36,36,.28)),linear-gradient(0deg,rgba(17,38,39,.46),transparent 65%); }
.place-page[data-realm="west"] { color: #19334a; background: #e6e8df; }
.place-page[data-realm="west"] .place-background { background-image: url("assets/western-map-day-v2.png"); }
.place-page[data-realm="west"] .place-wash { background: linear-gradient(90deg,rgba(247,245,235,.87),rgba(247,245,235,.54) 42%,rgba(247,245,235,.1)),linear-gradient(0deg,rgba(231,235,229,.35),transparent 65%); }
.place-page[data-realm="east"][data-focus-side="right"] .place-wash { background: linear-gradient(270deg,rgba(12,31,32,.87),rgba(16,36,36,.48) 45%,rgba(16,36,36,.22)),linear-gradient(0deg,rgba(17,38,39,.36),transparent 65%); }
.place-page[data-realm="west"][data-focus-side="right"] .place-wash { background: linear-gradient(270deg,rgba(247,245,235,.87),rgba(247,245,235,.54) 42%,rgba(247,245,235,.1)),linear-gradient(0deg,rgba(231,235,229,.35),transparent 65%); }
body[data-time="night"] .place-page[data-realm="east"] .place-background { background-image: url("assets/eastern-map-night-v2.png"); }
body[data-time="night"] .place-page[data-realm="west"] .place-background { background-image: url("assets/western-map-night-v2.png"); }
body[data-time="night"] .place-page[data-realm="west"] { color: #f4e9d6; background: #0b2033; }
body[data-time="night"] .place-page[data-realm="west"] .place-wash { background: linear-gradient(90deg,rgba(7,27,43,.9),rgba(7,27,43,.5) 45%,rgba(7,27,43,.15)),linear-gradient(0deg,rgba(7,27,43,.4),transparent 65%); }
body[data-time="night"] .place-page[data-realm="west"][data-focus-side="right"] .place-wash { background: linear-gradient(270deg,rgba(7,27,43,.9),rgba(7,27,43,.5) 45%,rgba(7,27,43,.15)),linear-gradient(0deg,rgba(7,27,43,.4),transparent 65%); }
.place-inner { position: relative; width: min(1320px,90vw); min-height: 100svh; margin: auto; padding: 118px 0 90px; display: grid; grid-template-columns: minmax(300px,.82fr) minmax(440px,1.18fr); gap: clamp(38px,6vw,110px); align-items: start; }
.place-page[data-focus-side="right"] .place-inner { grid-template-columns: minmax(440px,1.18fr) minmax(300px,.82fr); }
.place-page[data-focus-side="right"] .place-hero { grid-column: 2; grid-row: 1; }
.place-page[data-focus-side="right"] .path-board { grid-column: 1; grid-row: 1; }
.place-hero { position: sticky; top: 116px; min-height: min(74svh,680px); display: flex; flex-direction: column; align-items: flex-start; }
.return-map { padding: 0 0 8px; color: inherit; background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; font-size: 13px; letter-spacing: .08em; opacity: .8; }
.return-map:hover { opacity: 1; }
.place-heading { margin: auto 0 7vh; max-width: 470px; }
.place-eyebrow, .path-eyebrow, .dialog-eyebrow { margin: 0 0 13px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }
.place-heading h1 { margin: 0; font: 400 clamp(54px,6.5vw,96px)/.98 var(--serif-cn); letter-spacing: .07em; text-wrap: balance; }
.place-page[data-realm="west"] .place-heading h1 { font-family: var(--serif-west); letter-spacing: -.06em; }
.place-subtitle { margin: 22px 0 0; font: 17px/1.7 var(--serif-cn); }
.place-page[data-realm="west"] .place-subtitle { font-family: var(--serif-west); }
.place-ritual { margin-top: 26px; }
.place-incense-button { padding: 11px 18px; color: #f4e7cb; background: rgba(169,73,54,.52); border: 1px solid #d69a77; cursor: pointer; font-family: var(--serif-cn); font-size: 15px; }
.place-incense-button:disabled { cursor: default; opacity: .75; }
.place-incense-message { min-height: 1.5em; margin: 9px 0 0; color: #e6c992; font-family: var(--serif-cn); font-size: 14px; }

.path-board { margin-top: 10vh; padding: clamp(28px,3.2vw,52px); color: #243732; background: rgba(246,239,222,.94); border: 1px solid rgba(255,255,255,.4); box-shadow: 0 32px 100px rgba(3,18,22,.22); backdrop-filter: blur(8px); }
.place-page[data-realm="east"] .path-board { background: rgba(245,237,216,.94); border-radius: 2px; }
.place-page[data-realm="west"] .path-board { color: #1c374e; background: rgba(248,247,240,.94); border-radius: 12px 12px 3px 3px; border-top: 5px solid #bb9b62; }
body[data-time="night"] .place-page[data-realm="west"] .path-board { background: rgba(239,236,224,.96); }
.path-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.path-eyebrow { color: #8f624f; }
.place-page[data-realm="west"] .path-eyebrow { color: #7f674c; }
.path-head h2 { margin: 0; font: 400 clamp(30px,3vw,42px)/1.15 var(--serif-cn); }
.place-page[data-realm="west"] .path-head h2 { font-family: var(--serif-west); }
.add-node { flex: none; padding: 12px 16px; color: #fff7e8; background: #a24b3c; border: 1px solid #a24b3c; cursor: pointer; font-size: 13px; letter-spacing: .04em; transition: transform .2s,background .2s; }
.add-node:hover { transform: translateY(-2px); background: #873a30; }
.place-page[data-realm="west"] .add-node { background: #173e5d; border-color: #173e5d; }
.place-page[data-realm="west"] .add-node:hover { background: #2c5b7a; }
.path-intro { margin: 15px 0 34px; font: 16px/1.6 var(--serif-cn); color: #65716b; }
.place-page[data-realm="west"] .path-intro { font-family: var(--serif-west); }
.node-list { position: relative; padding: 10px 0 0; }
.node-list:has(.journey-node)::before { content: ""; position: absolute; left: 28px; top: 30px; bottom: 55px; width: 1px; background: linear-gradient(#b68071,#c8bea5 60%,transparent); }
.journey-node { position: relative; display: grid; grid-template-columns: 58px 1fr auto; align-items: start; gap: 13px; width: 88%; min-height: 122px; margin: 0 0 25px; padding: 16px 20px 16px 0; text-align: left; color: inherit; background: rgba(255,255,255,.34); border: 1px solid rgba(82,103,96,.18); cursor: pointer; transition: transform .25s var(--ease),background .25s,box-shadow .25s; }
.journey-node:nth-child(even) { margin-left: 12%; }
.journey-node:hover { transform: translateY(-3px); background: rgba(255,255,255,.62); box-shadow: 0 12px 28px rgba(52,53,40,.1); }
.node-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto; color: #59736b; background: #f6efdc; border: 1px solid #789085; border-radius: 50%; font: 13px var(--serif-west); }
.status-done .node-marker { color: #fff0df; background: #ab4d3b; border-color: #ab4d3b; font-family: var(--serif-cn); }
.status-active .node-marker { color: #fff0df; background: #4b716d; border-color: #4b716d; }
.status-paused .node-marker { opacity: .55; }
.status-ongoing .node-marker { border-style: double; border-width: 3px; }
.node-content { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding-top: 2px; }
.node-meta { color: #9b6554; font-size: 11px; letter-spacing: .16em; }
.node-content strong { font: 400 22px/1.25 var(--serif-cn); }
.node-note { color: #66726c; font: 14px/1.5 var(--serif-cn); }
.node-edit { padding-top: 5px; color: #71827a; font-size: 11px; white-space: nowrap; letter-spacing: .08em; }
.place-page[data-realm="west"] .node-list:has(.journey-node)::before { left: 28px; background: linear-gradient(#b49b65,#b49b65 65%,transparent); }
.place-page[data-realm="west"] .journey-node { width: 100%; margin-left: 0; padding: 17px 17px 17px 0; background: #fffefa; border: 1px solid #c8c7bc; border-left: 3px solid #b69a68; border-radius: 3px; box-shadow: 0 5px 16px rgba(26,48,61,.07); }
.place-page[data-realm="west"] .journey-node:hover { background: white; box-shadow: 0 12px 24px rgba(26,48,61,.12); }
.place-page[data-realm="west"] .node-marker { color: #1d4e6b; border-color: #406c85; }
.place-page[data-realm="west"] .status-done .node-marker { color: #fef4dc; background: #ad8c53; border-color: #ad8c53; }
.place-page[data-realm="west"] .status-active .node-marker { color: white; background: #2f5b77; border-color: #2f5b77; }
.place-page[data-realm="west"] .node-meta { color: #8c724d; }
.place-page[data-realm="west"] .node-content strong { font-family: var(--serif-west); }
.place-page[data-realm="west"] .node-note { font-family: var(--serif-west); }
.empty-path { min-height: 260px; padding: 42px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed rgba(90,111,104,.45); }
.empty-symbol { color: #a6503d; font: 44px var(--serif-cn); }
.place-page[data-realm="west"] .empty-symbol { color: #a8844c; }
.empty-path p { margin: 9px 0 19px; font: 22px var(--serif-cn); }
.place-page[data-realm="west"] .empty-path p { font-family: var(--serif-west); }
.empty-path button { padding: 9px 14px; color: inherit; background: transparent; border: 1px solid currentColor; cursor: pointer; font-size: 13px; }
.prototype-note { margin: 26px 0 0; color: #77817b; font-size: 12px; line-height: 1.6; }

.node-dialog { width: min(540px,calc(100vw - 28px)); max-height: min(90svh,760px); padding: 0; color: #253a36; background: #f4eddd; border: 1px solid #c7bca7; box-shadow: 0 35px 120px rgba(1,18,24,.4); }
.node-dialog::backdrop { background: rgba(6,21,29,.7); backdrop-filter: blur(5px); }
.node-dialog[data-realm="west"] { color: #1b3850; background: #f5f4ed; border-color: #b8aa8d; border-top: 5px solid #b89a65; }
.node-dialog form { padding: 34px clamp(24px,4vw,46px) 32px; }
.dialog-heading { position: relative; padding-right: 32px; }
.dialog-eyebrow { color: #a24b3c; }
.node-dialog[data-realm="west"] .dialog-eyebrow { color: #88704b; }
.dialog-heading h2 { margin: 0 0 28px; font: 400 34px var(--serif-cn); }
.node-dialog[data-realm="west"] .dialog-heading h2 { font-family: var(--serif-west); }
.close-dialog { position: absolute; right: 0; top: 0; width: 34px; height: 34px; color: inherit; background: transparent; border: 1px solid currentColor; cursor: pointer; font-size: 22px; line-height: 1; }
.form-field { display: block; margin: 0 0 20px; font-size: 14px; letter-spacing: .04em; }
.form-field input, .form-field textarea, .form-field select { display: block; width: 100%; margin-top: 8px; padding: 12px 13px; color: inherit; background: rgba(255,255,255,.6); border: 1px solid #bab9a9; border-radius: 0; font: 16px/1.5 var(--sans); }
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 2px solid #9f6758; outline-offset: 1px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.dialog-actions button { min-height: 42px; padding: 9px 14px; cursor: pointer; font-size: 14px; }
.remove-node { margin-right: auto; color: #a3473a; background: transparent; border: 0; }
.cancel-node { color: inherit; background: transparent; border: 1px solid #89918b; }
.save-node { color: white; background: #a24b3c; border: 1px solid #a24b3c; }
.node-dialog[data-realm="west"] .save-node { background: #1c4866; border-color: #1c4866; }
.place-page button:focus-visible, .node-dialog button:focus-visible, .open-place:focus-visible { outline: 2px solid #d0a96c; outline-offset: 3px; }

@keyframes breathe { 50% { opacity:.55; transform:scale(.92) rotate(8deg); } }
@keyframes mistDrift { to { transform: translate3d(12%,3%,0) scale(1.12); opacity: .38; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes locationPulse { 50% { box-shadow:0 0 0 10px transparent; opacity:.4; } }

@media (max-width: 800px) {
  .site-header { height: 66px; padding: 0 12px; grid-template-columns: 1fr auto auto; column-gap: 12px; color: white; background: linear-gradient(180deg,rgba(6,18,23,.88),rgba(6,18,23,.64)); }
  .brand-mark { width: 30px; height: 30px; }
  .brand b { font-size: 15px; }
  .brand small, .date-range { display:none; }
  nav { gap: 12px; font-size: 12px; }
  .header-tools { gap: 0; }
  .time-control span { display: none; }
  .time-control select { max-width: 72px; font-size: 11px; }
  .home-page { padding: 92px 14px 30px; }
  .home-intro { margin-bottom: 22px; }
  .home-intro h1 { font-size: 36px; }
  .intro-note { font-size: 13px; }
  .world-gates { grid-template-columns: 1fr; }
  .world-gate { min-height: 390px; }
  .gate-copy h2 { font-size: 51px; }
  .seal,.compass { display:none; }
  .journey-counters { gap: 12px; }
  .journey-counters p { flex-direction: column; gap: 1px; }
  .journey-counters span { font-size: 9px; }
  .map-page { display: flex; flex-direction: column; height: auto; min-height: 100svh; padding-top: 66px; overflow: visible; }
  .map-intro { position: relative; inset: auto; order: 1; width: 100%; min-width: 0; height: auto; padding: 28px 22px 22px; }
  .eastern-panel { background: #192d2c; }
  .western-panel { background: #f2f1e9; }
  body[data-time="night"] .western-panel { background: #0b2840; }
  .chapter { margin: 30px 0 10px; }
  .map-intro > h1 { font-size: 47px; }
  .map-lede { margin-bottom: 22px; }
  .place-detail { max-width: none; }
  .map-stage { position: relative; inset: auto; order: 2; width: 100%; height: 68svh; min-height: 520px; }
  .map-canvas { width: max(920px, 122svh); }
  .location span { font-size: 14px; }
  .map-hint { margin-top: 15px; }
  .place-background { background-size: auto 100%; }
  .place-inner { display: block; width: 100%; min-height: 100svh; padding: 66px 0 0; }
  .place-hero { position: relative; top: auto; min-height: 47svh; padding: 26px 22px 28px; }
  .place-heading { margin: auto 0 0; }
  .place-heading h1 { font-size: clamp(46px,11vw,68px); }
  .place-subtitle { font-size: 16px; }
  .path-board { margin: 0; padding: 28px 20px 38px; backdrop-filter: none; }
  .path-head { align-items: start; }
  .path-head h2 { font-size: 31px; }
  .add-node { padding: 10px; max-width: 136px; white-space: normal; line-height: 1.4; }
  .journey-node, .journey-node:nth-child(even) { width: 100%; margin-left: 0; }
  .node-content strong { font-size: 20px; }
}

@media (max-width: 380px) {
  .brand-mark { display: none; }
  .brand { gap: 0; }
  .site-header { column-gap: 8px; }
}

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