/* The Almanac. The page has no fixed colour: its tone is the moon's illuminated
   fraction, night at new moon and bone paper at full. Set by almanac.js. */
:root {
  --bg: rgb(11, 12, 16); --fg: #d9d6cc; --rule: rgba(217, 214, 204, .28); --dim: rgba(217, 214, 204, .66);
  --sx: 0px; --sa: 0; --rim: 0;                  /* moonlight on things lying on the page */
  --lunacy: .2;                                  /* 0 sober .. 1 total, the dial */
  --gut: clamp(16px, 4vw, 58px);
  --ruler-h: 112px;
}
body { margin: 0; min-height: 100svh; background: var(--bg); color: var(--fg); font-family: var(--serif); font-size: 18px; line-height: 1.42;
  font-feature-settings: "onum", "liga"; -webkit-font-smoothing: antialiased; transition: background-color .5s linear, color .5s linear; overflow-x: hidden; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
.sc { font-variant-caps: all-small-caps; letter-spacing: .14em; font-size: 15px; }
.num { font-feature-settings: "tnum", "onum"; }

/* ---- the sky ---- */
#sky { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; touch-action: pan-y; opacity: 0; transition: opacity .9s; }
#sky.ready { opacity: 1; }
#sky.grab { cursor: grab; } #sky.grabbing { cursor: grabbing; } #sky.wind { cursor: ew-resize; }
.still { position: fixed; z-index: 0; left: 0; top: 0; width: 300px; height: 300px; pointer-events: none; transition: opacity .9s; }
.still.gone { opacity: 0; }
.still svg { width: 100%; height: 100%; display: block; overflow: visible; }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5; mix-blend-mode: soft-light;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"); }
.page { position: relative; z-index: 2; pointer-events: none; }
.page a, .page button, .page input, .page label, .page .card, .page .paper, .page .coupon, .page .dial, .page .sky-line, .page .lede, .page h1 { pointer-events: auto; }

/* ---- place names on the moon: the real map is the menu ---- */
/* Under the page layer (z 2), so the opaque second screen slides over the names
   as you scroll. The first screen is transparent, so they still show on the moon. */
#places { position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: opacity .35s; }
body.past-hero #places, body.past-hero .margins { opacity: 0; visibility: hidden; }
.place { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; pointer-events: auto; text-decoration: none; color: #f2efe4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 10px rgba(0, 0, 0, .7); transition: opacity .3s; visibility: hidden; opacity: 0; }
.placed .place { visibility: visible; opacity: 1; }
.place i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; margin-left: -4px; transition: transform .2s, background .2s; }
.place b { font-weight: 500; font-variant-caps: all-small-caps; letter-spacing: .12em; font-size: 14px; line-height: 1; }
.place em { font-size: 14.5px; opacity: 0; max-width: 0; overflow: hidden; transition: opacity .2s, max-width .3s; }
.place:hover i, .place:focus-visible i { background: currentColor; transform: scale(1.5); }
.place:hover em, .place:focus-visible em, .near .place em { opacity: .95; max-width: 26em; }
.placed .place.far { opacity: 0; pointer-events: none; }
.placed .place.flip { flex-direction: row-reverse; }
.placed .place.flip i { margin: 0 -4px 0 0; }
.place.ingenii { color: #f6d9a8; }

/* ---- top line ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px var(--gut) 0; }
.mark { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.mark svg { width: 26px; height: 26px; }
.mark .sc { font-size: 17px; letter-spacing: .26em; }
.top nav { display: flex; gap: 30px; align-items: baseline; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.top nav .t { font-family: var(--black); font-size: 21px; letter-spacing: .01em; font-variant-caps: normal; }

/* ---- first screen ---- */
.hero { min-height: calc(100svh - 52px); display: grid; grid-template-columns: 1fr minmax(560px, 52vw); padding: 0 var(--gut); }
.col { grid-column: 2; align-self: center; padding: 6px 0 calc(var(--ruler-h) + 30px); }
.dateline { display: flex; gap: 14px; align-items: baseline; color: var(--dim); flex-wrap: wrap; }
h1 { font-style: italic; font-size: clamp(46px, 6.1vw, 94px); line-height: .93; letter-spacing: calc(-.022em - var(--lunacy) * .012em); margin: 14px 0 0 -.04em;
  font-weight: calc(420 + var(--lunacy) * 380); transform-origin: 0 60%; transform: rotate(calc(var(--lunacy) * var(--lunacy) * -3deg)) scale(calc(1 + var(--lunacy) * var(--lunacy) * .045));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), font-weight .4s; }
h1 b { font-weight: inherit; white-space: nowrap; }
.lede { margin-top: 16px; max-width: 34em; font-size: 20px; line-height: 1.36; }
.lede span { color: var(--dim); }

.desk { margin-top: 24px; display: grid; grid-template-columns: 1.02fr .98fr; gap: 26px; align-items: start; }

/* things lying on the page are lit by the moon */
.lit { box-shadow: var(--sx) 14px 26px rgba(0, 0, 0, var(--sa)), calc(var(--sx) * .35) 3px 5px rgba(0, 0, 0, calc(var(--sa) * .8));
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotate(var(--rz, 0deg)); }

/* the folded paper */
.paper { display: block; position: relative; background: var(--newsprint); color: var(--ink); text-decoration: none; padding: 13px 16px 15px; --rz: -2.2deg; font-family: var(--news); }
.paper::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 49%, rgba(60, 48, 20, .13) 50%, rgba(255, 255, 255, .5) 50.6%, transparent 52%), linear-gradient(90deg, rgba(255, 255, 255, calc(var(--rim) * .5)), transparent 30%); mix-blend-mode: multiply; }
.paper .np { text-align: center; font-family: var(--black); font-size: 37px; line-height: 1; letter-spacing: .01em; }
.paper .dl { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; padding: 3px 0; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); font: 600 8.5px var(--gothic); letter-spacing: .12em; text-transform: uppercase; }
.paper .dl em { font-style: normal; color: var(--red); white-space: nowrap; }
.paper h2 { margin-top: 9px; font-weight: 800; font-size: 25px; line-height: 1; letter-spacing: -.012em; text-transform: uppercase; font-variation-settings: "opsz" 60; text-wrap: balance; min-height: 2em; }
.paper .row { display: grid; grid-template-columns: 1fr 104px; gap: 11px; margin-top: 8px; }
.paper p { font-size: 13.5px; line-height: 1.28; text-align: justify; hyphens: auto; }
.paper img { display: block; width: 104px; height: 76px; object-fit: cover; object-position: 70% 40%; border: 1px solid var(--ink); mix-blend-mode: multiply; }
.paper .go { display: flex; justify-content: space-between; margin-top: 9px; padding-top: 6px; border-top: 1px solid var(--ink); font: 800 9px var(--gothic); letter-spacing: .13em; text-transform: uppercase; }
.paper:hover, .paper:focus-visible { --rz: -.6deg; }
.paper:hover .go span:last-child, .paper:focus-visible .go span:last-child { color: var(--red); }

/* the coupon */
.coupon { position: relative; background: var(--newsprint); color: var(--ink); padding: 13px 15px 14px; border: 1.5px dashed var(--ink); --rz: 1.3deg; font-family: var(--news); outline: 5px solid var(--newsprint); }
.coupon::before { content: "\2702"; position: absolute; left: 12px; top: -14px; font-size: 17px; background: var(--newsprint); padding: 0 4px; line-height: 1.3; font-family: system-ui, sans-serif; }
.coupon h2 { font: 800 15px var(--gothic); letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; }
.coupon > p { font-size: 14px; line-height: 1.26; margin-top: 4px; }
.coupon .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.coupon .two .f { grid-template-columns: auto 1fr; }
.coupon .f { display: grid; grid-template-columns: 5.6em 1fr; align-items: end; gap: 6px; margin-top: 6px; font: 600 8.5px var(--gothic); letter-spacing: .12em; text-transform: uppercase; }
.coupon input[type=text], .coupon input[type=email] { font: italic 15px var(--news); border: 0; border-bottom: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 1px 2px; min-width: 0; border-radius: 0; width: 100%; }
.coupon input::placeholder { color: rgba(24, 22, 19, .48); }
.coupon .ok { display: flex; gap: 7px; align-items: flex-start; margin-top: 9px; font: 500 10.5px/1.3 var(--gothic); letter-spacing: .01em; text-transform: none; }
.coupon .ok input { margin: 1px 0 0; accent-color: var(--ink); flex: none; width: 14px; height: 14px; }
.coupon button { margin-top: 10px; width: 100%; font: 800 10.5px var(--gothic); letter-spacing: .14em; text-transform: uppercase; padding: 9px 8px 8px; border: 0; background: var(--ink); color: var(--newsprint); cursor: pointer; }
.coupon button:hover { background: var(--red); }
.coupon button:disabled { opacity: .6; cursor: progress; }
.coupon .fine { font: 600 8px var(--gothic); letter-spacing: .08em; text-transform: uppercase; margin-top: 7px; opacity: .75; line-height: 1.4; }
.coupon .said { font-size: 14px; margin-top: 8px; min-height: 0; }
.coupon .said:empty { display: none; }
.coupon .said.err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* the instruments: cards you can pick up and throw */
.entry { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { position: relative; padding: 9px 13px 10px; border: 1px solid var(--rule); border-left-color: color-mix(in srgb, var(--fg) calc(28% + var(--rim) * 60%), transparent);
  background: color-mix(in srgb, var(--fg) 5%, var(--bg)); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.card dt { color: var(--dim); }
.card dd { font-size: 22px; line-height: 1.15; margin-top: 1px; }
.card.held { cursor: grabbing; }
.card.flying { position: fixed; z-index: 30; margin: 0; transition: none; will-change: transform; }
.slot { border: 1px dashed var(--rule); }
.dial { position: absolute; right: 8px; top: 8px; width: 38px; height: 38px; touch-action: none; cursor: pointer; }
.dial svg { width: 100%; height: 100%; display: block; }
.dial input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dial:focus-within { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 50%; }
.next { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 12px; color: var(--dim); font-size: 16.5px; }
.next b { color: var(--fg); font-weight: 500; }
.sky-line { margin-top: 10px; color: var(--dim); font-size: 15.5px; font-style: italic; max-width: 40em; }
.tidy { margin-top: 10px; font: inherit; font-size: 15px; color: var(--fg); background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 0; cursor: pointer; font-variant-caps: all-small-caps; letter-spacing: .14em; }

/* ---- the ruler ---- */
.ruler { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px var(--gut) 14px; background: linear-gradient(to top, var(--bg) 62%, transparent); transition: transform .45s cubic-bezier(.3, .7, .2, 1), background-color .5s; }
.ruler.away { transform: translateY(110%); }
.ruler-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; color: var(--dim); }
.ruler-head button { font: inherit; color: var(--fg); background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 0 0 1px; cursor: pointer; font-variant-caps: all-small-caps; letter-spacing: .14em; font-size: 15px; white-space: nowrap; }
.track { position: relative; margin-top: 7px; height: 36px; }
.ticks { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(30, 1fr); align-items: center; justify-items: center; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ticks svg { width: min(16px, 82%); height: 16px; opacity: .8; }
.ticks span { display: grid; place-items: center; width: 100%; height: 100%; }
.ticks span.on { background: color-mix(in srgb, var(--fg) 13%, transparent); }
.ticks span.on svg { opacity: 1; transform: scale(1.3); }
.track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.track:focus-within { outline: 2px solid var(--fg); outline-offset: 3px; }
.steps { display: grid; grid-template-columns: repeat(30, 1fr); margin-top: 5px; color: var(--dim); font-size: 14.5px; line-height: 1.2; }
.steps li b { display: block; color: var(--fg); font-weight: 500; font-variant-caps: all-small-caps; letter-spacing: .12em; }
.steps li:nth-child(1) { grid-column: 1 / span 6; } .steps li:nth-child(2) { grid-column: 8 / span 6; } .steps li:nth-child(3) { grid-column: 15 / span 6; } .steps li:nth-child(4) { grid-column: 22 / span 6; } .steps li:nth-child(5) { grid-column: 27 / span 4; text-align: right; }

/* ---- moonlight: on dark nights the cursor is a patch of light ---- */
.margins { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s;
  -webkit-mask-image: radial-gradient(circle 150px at var(--mx, -500px) var(--my, -500px), #000 25%, transparent 72%);
  mask-image: radial-gradient(circle 150px at var(--mx, -500px) var(--my, -500px), #000 25%, transparent 72%); }
.dark-night .margins { opacity: 1; }
.margins::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle 150px at var(--mx, -500px) var(--my, -500px), rgba(236, 231, 218, .1), transparent 70%); }
.margins p { position: absolute; max-width: 15em; font-style: italic; font-size: 16px; line-height: 1.3; color: #ece7da; transform: rotate(var(--r, -2deg)); }
.margins p::before { content: "\2767  "; font-style: normal; opacity: .7; }

/* ---- second screen: the plate, the work, the gazetteer ---- */
.almanac { position: relative; z-index: 2; pointer-events: auto; padding: 110px var(--gut) 80px; display: grid; grid-template-columns: minmax(300px, 34vw) 1fr; gap: clamp(40px, 7vw, 120px); align-items: start; background: var(--bg); transition: background-color .5s linear; }
.plate img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); filter: sepia(.12); }
.dark .plate img { filter: sepia(.12) brightness(.9); }
.plate figcaption { margin-top: 12px; color: var(--dim); display: flex; justify-content: space-between; gap: 20px; font-size: 16px; }
.obs h2 { font-weight: 500; font-style: italic; font-size: clamp(38px, 4.6vw, 68px); line-height: 1; letter-spacing: -.015em; max-width: 12em; }
.obs > p { margin-top: 18px; max-width: 32em; color: var(--dim); }
.obs ol { margin-top: 34px; border-top: 1px solid var(--fg); }
.obs li { display: grid; grid-template-columns: 9.5em 1fr; gap: 24px; padding: 17px 0 18px; border-bottom: 1px solid var(--rule); }
.obs li h3 { font-weight: 500; font-style: italic; font-size: 25px; line-height: 1.1; }
.obs li p { max-width: 32em; }
.obs li a { text-underline-offset: 4px; text-decoration-color: var(--rule); }
.gate { margin-top: 30px; font-style: italic; font-size: 24px; line-height: 1.25; max-width: 24em; }

.gazetteer { position: relative; z-index: 2; background: var(--bg); padding: 30px var(--gut) 90px; transition: background-color .5s linear; }
.gazetteer h2 { font-weight: 500; font-style: italic; font-size: clamp(32px, 3.4vw, 50px); line-height: 1.02; }
.gazetteer > p { margin-top: 12px; color: var(--dim); max-width: 40em; }
.gazetteer ol { margin-top: 26px; columns: 2 380px; column-gap: 56px; border-top: 1px solid var(--fg); }
.gazetteer li { break-inside: avoid; display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 11px 0 12px; border-bottom: 1px solid var(--rule); }
.gazetteer li a { font-size: 21px; font-style: italic; text-decoration: none; }
.gazetteer li a:hover { text-decoration: underline; text-underline-offset: 4px; }
.gazetteer li span { grid-column: 1 / -1; color: var(--dim); font-size: 16px; }
.gazetteer li small { color: var(--dim); font-size: 14px; white-space: nowrap; }

.foot { position: relative; z-index: 2; background: var(--bg); padding: 26px var(--gut) 40px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; color: var(--dim); font-size: 15px; transition: background-color .5s linear; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a, .foot button { color: inherit; text-decoration: none; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.foot a:hover, .foot button:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.has-notice .notice { bottom: calc(var(--ruler-h) + 8px); }

/* ---- phones and small screens ---- */
@media (max-width: 1000px) {
  :root { --ruler-h: 76px; }
  .hero { grid-template-columns: 1fr; padding-top: 46vh; padding-top: 46svh; }
  .col { grid-column: 1; padding-bottom: calc(var(--ruler-h) + 30px); }
  .top nav, .steps, #places, .margins { display: none; }
  .desk { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr 1fr; }
  .almanac { grid-template-columns: 1fr; padding-top: 70px; }
  .obs li { grid-template-columns: 1fr; gap: 6px; }
  .ruler-head .sc:first-child { font-size: 13px; letter-spacing: .1em; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .top { padding-top: 16px; }
  .topline-wrap { display: none; }
  .lede { font-size: 18.5px; }
  .paper .np { font-size: 30px; }
  .ruler-head .sc:first-child .long, .ruler-head .sc:first-child .mid { display: none; }
  .ruler-head .sc { font-size: 12.5px; letter-spacing: .1em; }
  .ticks svg { width: 9px; height: 9px; }
  .track { height: 30px; }
}
