@font-face { font-family: "Architects Daughter"; src: url(../fonts/architects-daughter-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url(../fonts/im-fell-english-sc-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url(../fonts/im-fell-english-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell English"; font-style: italic; src: url(../fonts/im-fell-english-latin-400-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Special Elite"; src: url(../fonts/special-elite-latin-400-normal.woff2) format("woff2"); font-display: swap; }

:root { --paper: #efe6d2; --paper2: #e6dbc3; --ink: #2a2119; --ink2: #5d5143; --red: #a23a2a; --blue: #2f5673; --line: rgba(42,33,25,.55);
  --serif: "IM Fell English", Georgia, serif; --sc: "IM Fell English SC", Georgia, serif; --hand: "Architects Daughter", "Comic Sans MS", cursive; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14110e; color: var(--ink); font-family: var(--serif); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#view:active { cursor: grabbing; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(0,0,0,0) 58%, rgba(10,6,2,.34) 100%); z-index: 0; }
button { font: inherit; color: inherit; cursor: pointer; }

.paper { background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .16 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 10px 34px rgba(0,0,0,.42), 0 2px 6px rgba(0,0,0,.3); }

/* title cartouche */
#title { position: absolute; left: 18px; top: 14px; z-index: 2; padding: 9px 16px 8px; background: var(--paper); border: 1px solid var(--line); outline: 1px solid var(--line); outline-offset: -5px; box-shadow: 0 8px 26px rgba(0,0,0,.4); width: 250px; }
#title h1 { margin: 0; font: 400 25px/1.05 var(--sc); letter-spacing: .09em; }
#title p { margin: 3px 0 0; font: italic 13.5px/1.2 var(--serif); color: var(--ink2); }

/* index of places */
#index { position: absolute; left: 18px; top: 92px; bottom: 108px; width: 250px; z-index: 2; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0,0,0,.4); }
#minimap { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--line); cursor: crosshair; }
#list { overflow-y: auto; padding: 4px 0 8px; scrollbar-width: thin; scrollbar-color: rgba(42,33,25,.35) transparent; }
.grp h3 { margin: 10px 14px 3px; font: 400 12.5px var(--sc); letter-spacing: .14em; color: var(--red); border-bottom: 1px solid rgba(162,58,42,.35); padding-bottom: 2px; }
.pl { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 3.5px 14px; line-height: 1.15; }
.pl span { font: 16.5px var(--serif); display: block; }
.pl i { font: 12.5px var(--hand); color: var(--ink2); font-style: normal; }
.pl:hover { background: rgba(42,33,25,.07); }
.pl.on { background: rgba(162,58,42,.13); box-shadow: inset 3px 0 0 var(--red); }

/* tool strip */
#tools { position: absolute; left: 286px; top: 14px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(239,230,210,.94); border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0,0,0,.36); font: 15px var(--serif); }
#tools button { background: none; border: 1px solid transparent; padding: 4px 9px; font: 15.5px var(--serif); white-space: nowrap; }
#tools button:hover, #tools button.on { border-color: var(--line); background: rgba(255,255,255,.35); }
#tools .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 3px; }
#tools .ctl { display: flex; align-items: center; gap: 6px; font: 13px var(--sc); letter-spacing: .08em; }
#tools input[type=range], #explain input[type=range] { -webkit-appearance: none; appearance: none; width: 104px; height: 16px; background: none; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--ink); }
input[type=range]::-moz-range-track { height: 2px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 17px; margin-top: -8px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 2px; cursor: ew-resize; }
input[type=range]::-moz-range-thumb { width: 9px; height: 15px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 2px; cursor: ew-resize; }
#weather button { font: 13.5px var(--hand) !important; padding: 3px 6px !important; }
.menu { position: relative; }
.drop { display: none; position: absolute; top: 34px; left: 0; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.4); min-width: 230px; padding: 4px; }
.drop.on { display: block; }
.drop button { display: block; width: 100%; text-align: left; }

/* story */
#story { position: absolute; right: 18px; top: 66px; width: 470px; max-height: calc(100% - 190px); z-index: 2; display: none; flex-direction: column; overflow: hidden; }
#story.on { display: flex; animation: rise .5s cubic-bezier(.16,1,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
#story .plate { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--line); cursor: zoom-in; background: var(--paper2); }
#story .body { padding: 11px 18px 6px; overflow-y: auto; }
.kick { font: 12.5px var(--sc); letter-spacing: .13em; color: var(--red); }
#story h2 { margin: 1px 0 2px; font: 400 29px/1.08 var(--sc); letter-spacing: .04em; }
.hook { margin: 4px 0 7px; font: italic 21px/1.22 var(--serif); color: #1c150f; }
#story ul { margin: 0; padding: 0; list-style: none; }
#story li { font: 16.5px/1.36 var(--serif); margin: 0 0 6px; padding-left: 15px; position: relative; }
#story li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 1.5px; background: var(--red); }
sup { font: 10.5px var(--hand); color: var(--blue); cursor: pointer; margin-left: 1px; }
.nums { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 9px 0 4px; }
.nums span { border: 1px solid var(--line); padding: 3px 9px 4px; font: 12px var(--hand); color: var(--ink2); display: flex; flex-direction: column; line-height: 1.15; background: rgba(255,255,255,.25); }
.nums b { font: 400 20px var(--sc); color: var(--ink); letter-spacing: .02em; }
.acts { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 6px; }
.act { background: var(--ink); color: var(--paper); border: 0; padding: 6px 13px 7px; font: 15.5px var(--serif); letter-spacing: .02em; }
.act:hover { background: var(--red); }
#story footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 5px 8px; gap: 8px; }
.nav { background: none; border: 0; font: italic 14.5px var(--serif); color: var(--ink2); padding: 3px 6px; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav:hover { color: var(--red); }
.x { position: absolute; right: 7px; top: 5px; z-index: 2; width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font: 19px/1 var(--serif); padding: 0 0 2px; }
.x:hover { background: var(--ink); color: var(--paper); }

/* explain card */
#explain { position: absolute; left: 286px; bottom: 108px; width: 430px; padding: 12px 18px 12px; z-index: 2; display: none; }
#explain.on { display: block; animation: rise .5s cubic-bezier(.16,1,.3,1); }
#explain h3 { margin: 2px 0 3px; font: 400 25px var(--sc); letter-spacing: .04em; }
#explain p { margin: 0 0 9px; font: 16.5px/1.36 var(--serif); }
#explain input[type=range] { width: 100%; }
.sl { display: flex; justify-content: space-between; font: 12px var(--hand); color: var(--ink2); margin: -2px 0 6px; }
.steps { display: flex; gap: 6px; align-items: center; }
.dot { width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--line); background: none; font: 13px var(--hand); padding: 0; }
.dot.on { background: var(--ink); color: var(--paper); }
.nx { margin-left: auto; background: var(--ink); color: var(--paper); border: 0; padding: 5px 13px 6px; font: 15px var(--serif); }

/* timeline */
#timeline { position: absolute; left: 286px; right: 18px; bottom: 16px; height: 80px; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 0 22px 0 12px; }
#tPlay { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); background: none; font-size: 13px; flex: none; padding: 0 0 0 2px; }
#tPlay:hover { background: var(--ink); color: var(--paper); }
#tYear { width: 232px; flex: none; line-height: 1.05; }
#tYear b { font: 400 34px var(--sc); letter-spacing: .03em; display: block; white-space: nowrap; }
#tYear span { font: italic 14px/1.1 var(--serif); color: var(--ink2); display: block; }
#tTrack { position: relative; flex: 1; height: 62px; cursor: ew-resize; touch-action: none; }
#tTrack::before { content: ""; position: absolute; left: 0; right: 0; top: 37px; height: 2px; background: var(--ink); }
.tick { position: absolute; top: 28px; width: 1px; height: 18px; background: var(--ink); cursor: pointer; }
.tick span { position: absolute; left: 50%; top: -17px; transform: translateX(-50%); font: 11.5px var(--hand); color: var(--ink2); display: none; white-space: nowrap; }
.tick.major { height: 24px; top: 22px; width: 1.5px; } .tick.major span { display: block; top: -16px; }
.tick::after { content: ""; position: absolute; left: -6px; right: -6px; top: -6px; bottom: -8px; }
.tick:hover { background: var(--red); } .tick:hover span { display: block; color: var(--red); z-index: 2; background: var(--paper); padding: 0 3px; }
#tHandle { position: absolute; top: 14px; width: 0; height: 40px; pointer-events: none; }
#tHandle::before { content: ""; position: absolute; left: -1px; top: 6px; width: 2px; height: 34px; background: var(--red); }
#tHandle::after { content: ""; position: absolute; left: -7px; top: 31px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* markers in the scene */
#labels { position: absolute; inset: 0; pointer-events: none !important; z-index: 1; overflow: hidden; }
.mk { position: absolute; left: 0; top: 0; background: none; border: 0; padding: 0; pointer-events: auto; will-change: transform; }
.mk i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.mk span { position: absolute; left: 11px; top: -13px; white-space: nowrap; font: 15px var(--sc); letter-spacing: .05em; background: var(--paper); border: 1px solid var(--line); padding: 1px 8px 2px; opacity: 0; transform: translateX(-4px); transition: opacity .18s, transform .18s; pointer-events: none; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.mk:hover span, .mk.on span { opacity: 1; transform: none; }
.mk.on i, .mk:hover i { background: var(--red); border-color: var(--paper); }
.lvl { position: absolute; left: 0; top: 0; display: none; font: 17px var(--sc); color: var(--paper); background: var(--red); padding: 1px 9px 2px; margin: -13px 0 0 14px; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.lvl.on { display: block; } .lvl::before { content: ""; position: absolute; left: -14px; top: 50%; width: 14px; height: 1.5px; background: var(--red); }

#compare { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none !important; z-index: 1; }
#compare.on { display: block; }
#cmpHandle { position: absolute; top: 0; bottom: 0; width: 44px; margin-left: -22px; display: none; cursor: ew-resize; z-index: 2; touch-action: none; }
#cmpHandle.on { display: block; }
#cmpHandle i { position: absolute; left: 6px; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#cmpHandle i::before { content: "‹ ›"; position: absolute; inset: 0; text-align: center; font: 15px/29px var(--serif); }
#cmpHandle span { position: absolute; top: 120px; font: 15px var(--sc); letter-spacing: .12em; white-space: nowrap; background: var(--paper); border: 1px solid var(--line); padding: 2px 9px; }
#cmpHandle span:first-child { right: 34px; } #cmpHandle span:last-child { left: 34px; }

#hint { position: absolute; left: 50%; bottom: 108px; transform: translateX(-30%); font: 14px var(--hand); color: #f3ead6; text-shadow: 0 1px 4px rgba(0,0,0,.8); transition: opacity 1s; pointer-events: none !important; z-index: 1; }
#hint.off { opacity: 0; }
#fps { position: absolute; right: 22px; top: 18px; font: 12px var(--hand); color: #f3ead6; text-shadow: 0 1px 3px #000; display: none; z-index: 3; pointer-events: none !important; }
#fps.on { display: block; }

.modal { position: fixed; inset: 0; background: rgba(15,10,6,.62); display: none; align-items: center; justify-content: center; z-index: 20; }
.modal.on { display: flex; }
.sheet { position: relative; width: min(780px, 92vw); max-height: 86vh; overflow-y: auto; padding: 22px 30px 20px; }
.sheet h2 { margin: 0 0 6px; font: 400 30px var(--sc); letter-spacing: .08em; }
.sheet .note { font: italic 15.5px/1.4 var(--serif); color: var(--ink2); margin: 0 0 10px; }
.sheet ol { margin: 0; padding-left: 26px; } .sheet li { font: 16px/1.32 var(--serif); margin-bottom: 5px; } .sheet a { color: var(--blue); }
#lightbox canvas { width: min(92vw, 160vh); height: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6); cursor: zoom-out; }

/* film intro */
#intro { position: fixed; inset: 0; z-index: 30; background: #17130f; display: flex; align-items: center; justify-content: center; transition: opacity .9s; }
#intro.gone { opacity: 0; pointer-events: none; }
#film { width: 100%; height: 100%; object-fit: contain; background: #17130f; }
#introCard { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--paper) radial-gradient(ellipse at center, rgba(255,255,255,.25), rgba(120,90,50,.22)); transition: opacity .7s; }
#introCard.gone { opacity: 0; pointer-events: none; }
.cart { text-align: center; padding: 34px 56px 30px; border: 1.5px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -8px; max-width: 760px; }
.cart h1 { margin: 0; font: 400 74px/1 var(--sc); letter-spacing: .1em; }
.cart p { margin: 12px 0 26px; font: italic 24px/1.25 var(--serif); color: var(--ink2); }
.cart button { background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); padding: 11px 26px 12px; font: 20px var(--serif); margin: 0 7px; }
.cart button + button { background: none; color: var(--ink); }
.cart button:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.cart small { display: block; margin-top: 20px; font: 15px var(--hand); color: var(--ink2); }
#skip { position: absolute; right: 26px; bottom: 26px; display: none; background: rgba(239,230,210,.92); border: 1px solid var(--ink); padding: 7px 18px 8px; font: 17px var(--serif); }
#intro.playing #skip { display: block; }

/* narrow screens: the city still works, with the index folded away */
@media (max-width: 900px) {
  #title { width: auto; left: 10px; top: 8px; padding: 6px 12px; } #title p { display: none; } #title h1 { font-size: 17px; }
  #index, #hint { display: none; }
  #tools { left: 10px; right: 10px; top: 50px; overflow-x: auto; }
  #story { left: 10px; right: 10px; width: auto; top: auto; bottom: 96px; max-height: 56%; }
  #explain { left: 10px; right: 10px; width: auto; bottom: 96px; }
  #timeline { left: 10px; right: 10px; bottom: 10px; height: 76px; padding: 0 14px 0 8px; gap: 8px; }
  #tYear { width: 92px; } #tYear b { font-size: 21px; } #tYear span { display: none; }
  .cart { padding: 22px 18px; margin: 0 16px; } .cart h1 { font-size: 38px; } .cart p { font-size: 17px; } .cart button { font-size: 16px; padding: 9px 14px; margin: 4px; }
}
