/* qxavier v1. the page is ordinary html first. when the grain engine runs, the marked parts of it (data-gt text, data-gf frames, data-gr rules)
   are drawn as matter instead, and the real text stays in place, transparent, so it can still be read aloud, selected, searched and tabbed through.
   plain mode (or no webgl, or no script) shows this same page as it is here. */
:root {
  color-scheme: light;
  --bone: #ECE6DA; --haze: #DED4C2; --sand: #C8B08A; --ochre: #A8692F; --umber: #5A4636; --basalt: #231D19; --moss: #5E6E3F;
  --tyrian: #66023C; --byzantium: #702963; --mulberry: #C54B8C; --amaranth: #E52B50;
  --ink: #231D19; --ink-soft: #4A3F36; --surface: rgba(236,230,218,.92); --edge: #231D19; --on-edge: #ECE6DA; --rule: rgba(35,29,25,.3);
  --wide: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gut: clamp(16px, 4vw, 44px);
  --rail: 0px;
}
@media (min-width: 1000px) { :root { --rail: 232px; } }
body.dusk { --ink: #EDE5D6; --ink-soft: #BDB19F; --rule: rgba(237,229,214,.3); --surface: rgba(40,33,28,.94); --edge: #EDE5D6; --on-edge: #231D19; }
body.dusk-shift, body.dusk-shift * { transition: background-color 3s, color 3s, border-color 3s !important; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; }
html, body { margin: 0; min-height: 100%; }
body { background: #DDD0B8; color: var(--ink); font-family: var(--gh-font-body, var(--serif)); font-size: 19px; line-height: 1.65; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body.plain { background: var(--haze); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; background: var(--edge); color: var(--on-edge); padding: 10px 14px; font: 500 13px var(--mono); }
.skip:focus { top: 8px; }

/* the field */
#haze { position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(ellipse 55% 45% at 16% 12%, rgba(255,250,238,.95), transparent 70%), linear-gradient(180deg, #EAE2D2 0%, #E3D6BF 52%, #D2B98F 84%, #BE9E70 100%); }
#haze::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 3.2s; background: radial-gradient(ellipse 55% 45% at 16% 12%, rgba(86,70,56,.9), transparent 70%), linear-gradient(180deg, #25201C 0%, #2A231D 52%, #382C21 84%, #473725 100%); }
body.dusk #haze::before { opacity: 1; }
body.plain #haze { background: var(--haze); z-index: -1; }
body.plain #haze::before { display: none; }
#backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; opacity: 0; transition: opacity 3.2s; pointer-events: none; }
#backdrop.on { opacity: .42; }
#backdrop iframe { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.78vh); height: max(100vh, 56.25vw); transform: translate(-50%, -50%); border: 0; filter: saturate(.6) contrast(1.05); }
body.plain #backdrop, body:not(.dusk) #backdrop { display: none; }
#matter { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; pointer-events: none; }
#grab { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
body.plain #matter, body.plain #grab { display: none; }

/* the page above the field */
#view { position: relative; z-index: 3; padding: 96px var(--gut) 160px calc(var(--gut) + var(--rail)); max-width: 1500px; transition: opacity .35s; }
body.going #view { opacity: .35; }
body.plain #view { max-width: 1100px; }
h1, h2, h3 { font-family: var(--gh-font-heading, var(--wide)); font-stretch: 125%; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: .98; margin: 0 0 .4em; }
h1 { font-size: clamp(36px, 7.4vw, 108px); }
h2 { font-size: clamp(30px, 5.6vw, 82px); }
h3 { font-size: clamp(17px, 2vw, 24px); line-height: 1.1; letter-spacing: .02em; }
p { margin: 0 0 1em; max-width: 60ch; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--tyrian); }
body.dusk a:hover { color: #E6A3C6; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--amaranth); outline-offset: 3px; }
.eyebrow, .num, .meta, .crumb, .go { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5; color: var(--ink-soft); margin: 0 0 14px; }
.go { display: inline-block; margin-top: 8px; color: var(--ink); text-decoration: none; border-bottom: 1px solid currentColor; }
.lede { font-size: clamp(21px, 2.3vw, 31px); line-height: 1.38; font-style: italic; max-width: 34em; }
.cue { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--ink-soft); }
hr.sep { border: 0; border-top: 1px solid var(--rule); margin: 0 0 clamp(28px, 5vh, 56px); height: 0; }

/* the descent: a station for each dimension */
.open { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; padding: 6vh 0 8vh; }
.open h1 { margin-bottom: .22em; }
.up { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 34px); margin: .2em 0 1.2em; }
.st { padding: clamp(40px, 9vh, 110px) 0 clamp(30px, 6vh, 70px); min-height: 78vh; }
.st .intro, .dim .intro { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.4; max-width: 30em; margin-bottom: 1.6em; }
.num i, .rail i { font-style: normal; }
.cards { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.card { position: relative; padding: 16px 18px 12px; min-height: 124px; }
.card h3 { margin-bottom: .45em; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card .meta { margin-bottom: 8px; font-size: 11px; }
.card .ex { font-size: 15.5px; line-height: 1.5; margin: 0; max-width: none; }
.card.is-featured { grid-column: span 2; }
@media (max-width: 640px) { .card.is-featured { grid-column: auto; } }
body.plain .card { border: 1px solid var(--edge); background: var(--surface); }
body.plain .st, body.plain .open { min-height: 0; }
.join, .foot { padding: clamp(40px, 8vh, 90px) 0 30px; }
.foot { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.foot p { max-width: 70ch; }
.signoff { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 4vw, 54px); margin: 0 0 .6em; }

/* an entry */
.entry { max-width: 50rem; }
.entry h1 { font-size: clamp(32px, 5.8vw, 84px); }
.feature { margin: 0 0 2.2em; }
.feature img { display: block; width: 100%; max-height: 62vh; object-fit: contain; object-position: left; }
.feature.as-grains img { opacity: 0; }
.feature figcaption { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin-top: 10px; }
.gh-content { font-size: clamp(18px, 1.5vw + 12px, 21px); }
.gh-content > * + * { margin-top: 1.1em; margin-bottom: 0; }
.gh-content h2 { font-size: clamp(24px, 3.2vw, 40px); margin-top: 1.6em; }
.gh-content h3 { font-size: clamp(17px, 2vw, 22px); margin-top: 1.4em; }
.gh-content blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--edge); font-style: italic; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; max-width: 60ch; }
.gh-content li + li { margin-top: .4em; }
.gh-content hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.gh-content img, .gh-content video, .gh-content iframe, .gh-content audio { max-width: 100%; }
.gh-content a { color: var(--tyrian); }
body.dusk .gh-content a { color: #E6A3C6; }
.gh-content .kg-width-wide { max-width: 100%; }
.gh-content .kg-width-full { max-width: 100%; width: 100%; }
.stage { margin: 0 0 2em; }
.stage-box { width: 100%; aspect-ratio: 16 / 9; max-height: 62vh; }
.stage figcaption { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.neighbors { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; margin-top: 4em; padding-top: 1.2em; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 13px; }
.neighbors a { max-width: 24em; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-family: var(--mono); font-size: 13px; }
.cta-box { margin-top: 2em; padding: 18px 20px; max-width: 34em; border: 1px solid var(--edge); background: var(--surface); }
.cta-box p { margin: 0 0 .8em; }
.cta-box .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.err { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }

/* chrome: wordmark, the depth rail, account */
.chrome { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.chrome > * { pointer-events: auto; }
.mark { position: fixed; left: var(--gut); top: 20px; font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 19px; letter-spacing: .02em; text-transform: lowercase; text-decoration: none; }
.acct { position: fixed; right: var(--gut); top: 22px; display: flex; gap: 14px; align-items: baseline; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.acct a, .mapbtn { text-decoration: none; text-transform: lowercase; font: inherit; color: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.rail { position: fixed; left: var(--gut); top: 50%; transform: translateY(-48%); display: none; flex-direction: column; gap: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; width: 188px; border-left: 1px solid var(--rule); padding-left: 0; }
.rail a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.2; }
.rail a[aria-current="true"] { border-left-color: var(--tyrian); }
body.dusk .rail a[aria-current="true"] { border-left-color: #E6A3C6; }
.rail i { opacity: .62; font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) { .rail { display: flex; } .mapbtn { display: none; } }
/* small screens: the rail lives behind a map button */
.map { position: fixed; inset: 0; z-index: 12; background: var(--bone); padding: 80px var(--gut) 40px; overflow-y: auto; font-family: var(--mono); }
body.dusk .map { background: #2A231D; }
.map ol { list-style: none; margin: 0 0 24px; padding: 0; }
.map li a { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-family: var(--wide); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: 22px; line-height: 1.05; }
.map li i { font: 500 12px var(--mono); font-style: normal; opacity: .6; padding-top: 6px; }
.map .x { position: fixed; right: var(--gut); top: 18px; }

/* matter: marked parts of the page are drawn by the grains and left in place, transparent */
body.mx [data-gt], body.mx [data-gt] * { color: transparent !important; text-decoration-color: transparent !important; }
body.mx [data-gt] li::marker { color: transparent; }
body.mx [data-gf] { border-color: transparent !important; background: transparent !important; }
body.mx hr[data-gr], body.mx [data-gr] { border-color: transparent !important; }
body.mx .gh-content > blockquote { border-left-color: transparent; }
body.mx ::selection { background: rgba(94,110,63,.4); color: transparent; }
body.mx .rail a[aria-current="true"] { border-left-color: transparent; }
body.mx .neighbors, body.mx .pager { border-top-color: transparent; }
body.mx .map [data-gt], body.mx .map [data-gt] * { color: var(--ink) !important; }

/* controls */
.ctl, button.ctl { font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--edge); padding: 7px 12px; cursor: pointer; line-height: 1.2; border-radius: 0; text-decoration: none; display: inline-block; }
.ctl:hover { background: var(--edge); color: var(--on-edge); }
.ctl[aria-pressed="true"] { background: var(--edge); color: var(--on-edge); }
.cta { font-family: var(--wide); font-stretch: 125%; font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; background: var(--edge); color: var(--on-edge); border: 0; padding: 13px 18px; cursor: pointer; box-shadow: 2px 4px 0 rgba(35,29,25,.25); text-decoration: none; display: inline-block; }
.cta:hover { background: var(--tyrian); color: #fff; }
.note { margin: 0; font-size: 11.5px; font-family: var(--mono); color: var(--ink-soft); }
select.ctl { padding-right: 6px; }
input[type="range"] { accent-color: var(--tyrian); }
.panel { background: var(--surface); border: 1px solid var(--edge); border-top: 6px solid var(--edge); padding: 14px 16px; }
.panel h3 { font-size: 15px; margin-bottom: 8px; }
#sense { position: fixed; left: var(--gut); bottom: 56px; z-index: 9; width: min(340px, calc(100% - 2 * var(--gut))); }
#sense .btns { display: flex; gap: 8px; margin-top: 10px; }
#tools { position: fixed; right: 10px; bottom: 10px; z-index: 8; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 20px); font-family: var(--mono); font-size: 11px; }
#tools label { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--edge); padding: 4px 6px; }
#tools select { font: inherit; color: var(--ink); background: transparent; border: 0; }
#tele { position: fixed; left: var(--gut); bottom: 12px; z-index: 4; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-soft); display: none; gap: 14px; pointer-events: none; }
@media (min-width: 900px) { #tele { display: flex; } }
body.plain #tele { display: none; }
#dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 54px; z-index: 8; width: min(640px, calc(100% - 20px)); border-top-width: 4px; }
#dock .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
#dock .row.main { flex-wrap: nowrap; }
#dock input[type="range"] { flex: 1; min-width: 60px; width: auto; }
#dock time { font: 12px var(--mono); font-variant-numeric: tabular-nums; min-width: 88px; text-align: right; }
#dock .lab { font: 11px var(--mono); color: var(--ink-soft); }
#caption { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-size: 15px; min-height: 1.2em; }
body.plain #dock { position: static; transform: none; margin: 20px auto; }
body.going #dock { opacity: .6; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { #matter, #grab, #haze, #tools, #tele, .chrome, #dock, #sense { display: none !important; } body.mx [data-gt], body.mx [data-gt] * { color: #000 !important; } #view { padding: 0; } }

/* ghost adds its own prompt under members-only entries; this theme has its own */
.gh-post-upgrade-cta { display: none; }
.card:focus-within { outline: 2px solid var(--amaranth); outline-offset: 4px; }
.card h3 a:focus-visible { outline: 0; }
body.plain .chrome::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 64px; background: var(--bone); border-bottom: 1px solid var(--rule); z-index: -1; }
