@font-face { font-family: Inter; src: url(fonts/inter-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/inter-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/jbmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Archivo; src: url(fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Newsreader; src: url(fonts/newsreader.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Newsreader; src: url(fonts/newsreader-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root { --ink: #1c1917; --mute: #7d828b; --rule: #e4e2de; --verm: #e2391d; --gold: #b88a35; --pad: 6vw; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; color: var(--ink); }
body { font: 16px/1.5 Newsreader, Georgia, serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* the painting: one canvas behind everything, fixed; the text scrolls over it */
#gpu { position: fixed; inset: 0; }
#gpu canvas { display: block; width: 100%; height: 100%; }

/* two columns side by side; opening a project slides the track left, so the page goes out to the right */
#track { position: fixed; top: 0; left: 0; height: 100svh; width: 200vw; display: flex; will-change: transform; }
.col { width: 100vw; height: 100svh; overflow-y: auto; overflow-x: hidden; flex: none; position: relative; scrollbar-width: none; }
.col::-webkit-scrollbar { display: none; }

section { min-height: 100svh; box-sizing: border-box; padding: 14svh var(--pad); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 2vw; align-items: center; }
section .text { grid-column: 1 / span 5; }
section .art { grid-column: 7 / span 6; }
section.flip .text { grid-column: 8 / span 5; grid-row: 1; }
section.flip .art { grid-column: 1 / span 6; grid-row: 1; }
section .text.wide { grid-column: 1 / span 8; }
section.hero { padding-top: 10svh; }
section.hero .text { grid-column: 2 / span 5; }
section.write { min-height: 100svh; align-items: end; padding-bottom: 8svh; }
section.write .text { align-self: start; padding-top: 6svh; }
section.write .art { grid-column: 4 / span 9; }

.plane { width: 100%; aspect-ratio: 1; }
.plane.half { aspect-ratio: 2; }
.mon { width: 76px; height: 76px; margin-bottom: 28px; }
.mon.sm { width: 34px; height: 34px; margin: 0; }
.mon.lg { width: 120px; height: 120px; margin: -60px 0 36px; }
.cloud { height: 90px; width: 58%; margin: -45px 0; }
.cloud.r { margin-left: auto; }

/* display: the links' own face, Archivo in tracked capitals, at a middle weight: the modernist half of the page */
h1, h2 { font-family: Archivo, "Helvetica Neue", sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 .5em; }
h1.name { font-size: clamp(40px, 5.1vw, 92px); line-height: 1.02; }
h2 { font-size: clamp(30px, 3.8vw, 66px); line-height: 1.05; }
h2 .title { text-decoration: none; background: linear-gradient(var(--verm), var(--verm)) 0 100% / 0 2px no-repeat; transition: background-size .35s cubic-bezier(.33, 1, .68, 1); }
h2 .title:hover, h2 .title:focus-visible { background-size: 100% 2px; outline: none; }
.lede { font-size: clamp(19px, 1.45vw, 24px); line-height: 1.45; max-width: 30em; margin: 0 0 1.2em; }
.aside { font: 400 13px/1.5 Archivo, sans-serif; letter-spacing: .02em; color: var(--mute); max-width: 34em; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0 0 32px; font: 400 14px/1.45 Archivo, sans-serif; }
dl.facts dt, dl.facts dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rule); }
dl.facts dt { color: var(--mute); text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; padding-right: 28px; padding-top: 12.5px; }

.open, .back { font: 600 12px Archivo, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: none; border: 0; border-bottom: 2px solid var(--verm); padding: 6px 0; cursor: pointer; }
.open::after { content: " →"; letter-spacing: 0; }
.back { position: absolute; top: calc(28svh + 22px); right: var(--pad); z-index: 2; font-size: 14.5px; padding: 6px 0; border: 0; }
.back::before { content: "← "; letter-spacing: 0; }
.back { transition: opacity .3s; }
body.down .back:not(.end) { opacity: 0; pointer-events: none; }
.back.end { position: static; display: block; margin: 0 var(--pad) 14svh calc(var(--pad) + 8vw); border-bottom: 2px solid var(--verm); padding: 6px 0; }


/* a project's own page */
#detail { background: transparent; }
#detail .band { height: 28svh; }
#detail .body { padding: 0 var(--pad) 18svh calc(var(--pad) + 8vw); max-width: 44em; }
#detail h1 { font-size: clamp(36px, 4.6vw, 80px); line-height: 1.05; }
.visit { display: inline-block; margin: 6px 0 34px; font: 600 12px Archivo, sans-serif; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid var(--verm); padding: 6px 0; }
.visit::after { content: "→"; display: inline-block; margin-left: .45em; letter-spacing: 0; transform: rotate(-45deg); }   /* no face here has ↗ */
#detail .body p:not(.lede) { font-size: 18px; line-height: 1.6; max-width: 36em; }

/* the rail: the page's sections, a hairline down the right edge */
#rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--ink); padding-right: 12px; transition: opacity .4s; z-index: 5; }
#rail a { font: 500 10px Archivo, sans-serif; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; color: transparent; text-align: right; position: relative; transition: color .25s; background: none; }
#rail:hover a { color: var(--mute); }
#rail:hover a.on { color: var(--ink); }
#rail a::after { content: ""; position: absolute; right: -16px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; background: #fff; border: 1px solid var(--ink); box-sizing: border-box; }
#rail a.on::after { background: var(--verm); border-color: var(--verm); }
body.away #rail { opacity: 0; pointer-events: none; }

/* entrance: only with JS, and never for reduced motion. While the painting measures the layout, the entrance
   offsets are lifted, or every ornament placed beside the text lands where the text is about to leave; only
   for sections not yet in, so an entrance already playing (the hero's, from the first frame) isn't cut short */
.measuring section:not(.on) .text > * { transform: none !important; transition: none !important; }
.js section .text > * { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1); }
.js section.on .text > * { opacity: 1; transform: none; }
.js section.on .text > :nth-child(2) { transition-delay: .06s; }
.js section.on .text > :nth-child(3) { transition-delay: .12s; }
.js section.on .text > :nth-child(4) { transition-delay: .18s; }
.js section.on .text > :nth-child(5) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .js section .text > * { opacity: 1; transform: none; transition: none; } }

/* phones have their own composition (site.js paints it from the same breakpoint): sections stack text over
   art; the hero's garland runs along the top, so the name starts below it; the last page's arch is larger than
   the screen, runs off its left edge (only the left: see arch() in paint.js) and sits low, with room under it
   for the spray */
@media (max-width: 820px) {
  section { display: block; padding: 12svh 22px; }
  section .art { margin-top: 48px; }
  section.hero { padding-top: 150px; }
  section.write { display: flex; flex-direction: column; padding-bottom: 130px; }
  section.write .text { padding-top: 40px; }
  section.write .art { width: 160vw; margin: auto 0 0 calc(-68vw - 34px); padding-top: 64px; align-self: flex-start; }   /* its gear reaches .08vw past its right; 12px clear of the edge */
  .cloud { width: 80%; }
  #rail { display: none; }
  #detail .body { padding: 0 22px 14svh; }
}

/* the seafaring map's demonstration: the chart pins while the page scrolls past, and the steps beside it
   advance; the chart builds with them, and unbuilds going back */
.pin { position: relative; display: block; height: 470svh; min-height: 0; padding: 0; margin: 4svh 0 12svh; }
.pin .stage { position: sticky; top: 6svh; height: 88svh; margin: 0 var(--pad); display: grid; grid-template-columns: 8.8fr 3.2fr; column-gap: 2.6vw; align-items: center; }
.pin .map { position: relative; width: 100%; aspect-ratio: 1.4945; max-height: 84svh; }
.pin .copy { align-self: center; }
.pin h3 { font: 600 13px Archivo, sans-serif; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 18px; }
.pin .steps li { padding: 7px 0 7px 14px; border-left: 1px solid var(--rule); color: #a3a7ad; font: 400 15.5px/1.45 Newsreader, serif; transition: color .3s, border-color .3s; }
.pin .steps li.on { color: var(--ink); border-left-color: var(--verm); }
.pin .goal { font: italic 400 13px Newsreader, serif; color: var(--mute); margin: 18px 0 0; }
.lab { position: absolute; white-space: nowrap; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.lab.on { opacity: 1; }
.lab.deg { font: 500 10px Archivo, sans-serif; letter-spacing: .08em; color: var(--mute); transform: translate(-50%, -50%); }
.lab.deg.l { transform: translate(-100%, -50%); }
.lab.site { font: 600 11.5px Archivo, sans-serif; letter-spacing: .02em; color: var(--ink); transform: translate(9px, -50%); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; }
.lab.site.up { transform: translate(-50%, -170%); }
.lab.sea { font: italic 400 16px Newsreader, serif; letter-spacing: .06em; color: #fff; transform: translate(-50%, -50%); }
.lab.land { font: 500 10px Archivo, sans-serif; letter-spacing: .32em; text-transform: uppercase; color: var(--mute); transform: translate(-50%, -50%); }
.lab.land.sm { font-size: 9px; letter-spacing: .22em; }

/* MAGI's insert: a sheet of another stock tipped into the page, in MAGI's own grammar (its tokens.css): the
   dark ground, Inter at three sizes, amber only for meaning, no radius, no shadow. It pins while the page
   scrolls past it, and the scroll walks the pipeline. */
.insert { position: relative; display: block; height: 340svh; min-height: 0; padding: 0; margin: 2svh 0 10svh; }
.insert .sheet { position: sticky; top: 7svh; height: 86svh; margin: 0 calc(var(--pad) + 30px); background: #0b0e11; color: #c7cfd9; display: grid; grid-template-columns: minmax(340px, 4.3fr) 7.7fr; grid-template-rows: minmax(0, 1fr); overflow: hidden; font: 400 15px/1.5 Inter, sans-serif; }
.sheet .copy { padding: 34px 32px 30px; min-height: 0; border-right: 1px solid rgba(200, 215, 235, .12); display: flex; flex-direction: column; }
.sheet h3 { font: 600 20px/1.25 Inter, sans-serif; margin: 0 0 20px; color: #c7cfd9; letter-spacing: 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { padding: 7px 0 7px 15px; border-left: 1px solid rgba(200, 215, 235, .12); color: #66707e; transition: color .24s cubic-bezier(.33, 1, .68, 1), border-color .24s cubic-bezier(.33, 1, .68, 1); }
.steps li.on { color: #c7cfd9; border-left-color: #ffb000; }
.sheet .goal { margin: auto 0 0; color: #c7cfd9; }
.sheet canvas { width: 100%; height: 100%; display: block; }
/* once the scroll has walked the whole pipeline, the sheet offers the record itself */
.sheet .go { align-self: flex-start; margin-top: 22px; padding: 10px 14px; border: 1px solid #ffb000; color: #ffb000; font: 600 13px/1 Inter, sans-serif; text-decoration: none; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .3s cubic-bezier(.33, 1, .68, 1), transform .3s cubic-bezier(.33, 1, .68, 1), background .2s, color .2s; }
.sheet .go::after { content: "→"; display: inline-block; margin-left: .5em; font-family: Archivo, sans-serif; transform: rotate(-45deg); }
.sheet .go.on { opacity: 1; transform: none; pointer-events: auto; }
.sheet .go:hover, .sheet .go:focus-visible { background: #ffb000; color: #0b0e11; outline: none; }

/* the ways out of the opening, one weight, one arrow: mixed directions read as noise beside each other. The
   first, writing to me, is underlined at rest: it is what the page is for */
.ways { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-top: 7svh; }
.way { position: relative; display: inline-block; font: 500 clamp(13px, 1vw, 16px) Archivo, sans-serif; letter-spacing: .26em; text-transform: uppercase; text-decoration: none; color: var(--ink); padding: 4px 0; background: linear-gradient(var(--verm), var(--verm)) 0 100% / 0 2px no-repeat; transition: background-size .35s cubic-bezier(.33, 1, .68, 1); }
.way::after { content: "→"; display: inline-block; margin-left: .7em; letter-spacing: 0; color: var(--verm); transition: transform .3s cubic-bezier(.33, 1, .68, 1); }
.way:hover, .way:focus-visible, .way.first { background-size: 100% 2px; outline: none; }
.way:hover::after { transform: translateX(4px); }

/* the making-of reel: it pins, and scrolling down carries it sideways; the words for whichever picture is
   current sit in one place, in the lower third, and the current plate plays live */
.reelpin { position: relative; display: block; min-height: 0; padding: 0; margin: 2svh 0 8svh; }
.reelstage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.reel { position: absolute; top: 11svh; left: 0; display: flex; gap: 3.5vw; padding: 0 var(--pad) 0 calc(var(--pad) + 8vw); will-change: transform; }
.card { flex: none; height: 50svh; margin: 0; position: relative; }
.card img { height: 100%; width: auto; aspect-ratio: 1.6; display: block; }
.card img[src$="mood.jpg"] { aspect-ratio: 1.4265; }
.card img[src$="10s.jpg"] { aspect-ratio: 1.98; }
.card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; background: #fff; }
.card video.on { opacity: 1; }
.card p { font: 400 18px/1.5 Newsreader, serif; max-width: 30em; margin: 16px 0 0; }
.js .card:not(.words) p { display: none; }
.card.words { height: 50svh; width: 34vw; display: flex; align-items: center; }
.card.words p { font-size: clamp(20px, 1.7vw, 27px); line-height: 1.45; }
.reeltext { position: absolute; top: 67svh; left: calc(var(--pad) + 8vw); right: var(--pad); max-width: 34em; margin: 0; font: 400 clamp(21px, 1.8vw, 29px)/1.42 Newsreader, serif; transition: opacity .25s; }
.reeltext.out { opacity: 0; }
.reeltext a { text-decoration-thickness: 1px; text-underline-offset: 4px; }



/* phones: desktop is the design, but nothing should break. The MAGI sheet stops pinning and stacks; the chart
   stacks above its steps and shows only the current one; the reel's cards shrink */
@media (max-width: 820px) {
  .insert { height: auto; margin: 4svh 0 8svh; }
  .insert .sheet { position: static; height: auto; margin: 0 10px; grid-template-columns: 1fr; grid-template-rows: auto max(620px, 84svh); }
  .sheet .copy { border-right: 0; border-bottom: 1px solid rgba(200, 215, 235, .12); }
  .pin .stage { grid-template-columns: 1fr; align-content: center; row-gap: 20px; margin: 0 14px; }
  .pin .steps li:not(.on) { display: none; }
  .pin .goal { display: none; }
  /* the reel: one card to a screen's width, its words just under it */
  .reel { top: 14svh; gap: 22px; padding: 0 22px; }
  .card { height: calc((100vw - 44px) / 1.6); }
  .card img[src$="mood.jpg"] { width: calc(100vw - 44px); height: auto; }
  .card.words { width: calc(100vw - 44px); height: calc((100vw - 44px) / 1.6); }
  .card.words p { font-size: 18px; }
  .reeltext { top: calc(14svh + (100vw - 44px) / 1.6 + 26px); left: 22px; right: 22px; font-size: 19px; }
  /* the chart: no degree ticks or land names at this size, smaller site names */
  .lab.deg, .lab.land { display: none; }
  .lab.site { font-size: 9.5px; }
  .ways { margin-top: 5svh; }
}

/* MAGI's record: the prose reads down the left; beside it a desk pinned in place, where a page of the real
   record lands for each kind of document the prose names. The third paragraph scatters them across the desk,
   the fourth gathers them into a neat block, ready for the pipeline below. Without JS the pile simply shows. */
.docs { position: relative; display: grid; grid-template-columns: minmax(0, 31em) minmax(0, 1fr); column-gap: 4vw; margin: -12svh var(--pad) 6svh calc(var(--pad) + 8vw); }
.docs .prose { padding: 4svh 0 34svh; }
.docs .prose p { font-size: clamp(19px, 1.4vw, 23px); line-height: 1.55; margin: 0 0 52svh; }
.docs .prose p:last-child { margin-bottom: 0; }
.desk { position: sticky; top: 8svh; height: 84svh; align-self: start; }
.desk img { position: absolute; left: 50%; top: 50%; height: 64svh; width: auto; transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)); filter: drop-shadow(0 1px 1px rgba(28, 25, 23, .18)) drop-shadow(0 10px 18px rgba(28, 25, 23, .12)); transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .45s ease; will-change: transform; }
.desk img.wide { height: auto; width: min(36vw, 600px); }
.js .desk img { opacity: 0; transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) + 9svh)) rotate(calc(var(--r) * 2.5)); }
.js .desk img.in { opacity: 1; transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)); }
.js .desk.apart img.in { transform: translate(-50%, -50%) translate(var(--ax), var(--ay)) rotate(var(--ar)) scale(.5); }
.js .desk.gather img.in { transform: translate(-50%, -50%) translate(var(--gx), var(--gy)) scale(.3); }
@media (prefers-reduced-motion: reduce) { .desk img { transition: opacity .2s; } }
/* on a phone the desk is a band pinned across the top of the screen and the prose scrolls up under it; the
   offsets that spread the pages across a desktop's desk are scaled to the band */
@media (max-width: 820px) {
  .docs { display: flex; flex-direction: column; margin: 0 0 6svh; }
  .desk { order: -1; align-self: stretch; top: 0; height: 40svh; z-index: 2; background: #fff; box-shadow: 0 16px 16px -16px rgba(28, 25, 23, .14); }
  .desk img { height: 29svh; }
  .desk img.wide { width: 58vw; }
  .docs .prose { padding: 6svh 22px 30svh; }
  .docs .prose p { font-size: 19px; margin-bottom: 46svh; }
  .js .desk img { transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) * .5 + 6svh)) rotate(calc(var(--r) * 2.5)); }
  .js .desk img.in { transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) * .5)) rotate(var(--r)); }
  .js .desk.apart img.in { transform: translate(-50%, -50%) translate(calc(var(--ax) * 2.3), calc(var(--ay) * .36)) rotate(var(--ar)) scale(.5); }
  .js .desk.gather img.in { transform: translate(-50%, -50%) translate(calc(var(--gx) * 2.5), calc(var(--gy) * .5)) scale(.3); }
}
