:root {
  --paper: #faf8f2;
  --paper-deep: #ebe5d7;
  --ink: #292b29;
  --soft-ink: #62635e;
  --dot: rgba(64, 67, 63, 0.25);
  --blue: #315d83;
  --orange: #ed653f;
  --yellow: #efc94f;
  --green: #76957a;
  --mono: "DM Mono", "Courier New", monospace;
  --serif: "Newsreader", Georgia, serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 420ms; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.15px, transparent 1.3px);
  background-position: -1px -1px;
  background-size: 24px 24px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  overflow-x: hidden;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

a { color: inherit; }
button { font: inherit; }
.page-width { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 28px;
  padding-top: 37px;
}

.wordmark {
  width: fit-content;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.header-note {
  margin: 10px 5vw 0 0;
  color: var(--soft-ink);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: rotate(2deg);
}
.header-loop { position: absolute; top: 16px; left: 124px; width: 145px; overflow: visible; }
.header-loop path, .intro-arrow path, .margin-note path { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }

.intro {
  position: relative;
  min-height: 650px;
  padding: 175px 0 100px 8%;
}

.issue, .index {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.issue { position: absolute; top: 190px; left: 0; writing-mode: vertical-rl; transform: rotate(180deg); }
.intro h1 { margin: 0; max-width: 780px; font-size: clamp(64px, 8vw, 116px); font-weight: 400; letter-spacing: -0.055em; line-height: 0.84; }
.intro h1 em { color: var(--blue); font-weight: 400; }
.intro-copy { width: 330px; margin: 48px 0 0 48%; font-size: 19px; line-height: 1.5; transform: rotate(-1deg); }
.intro-arrow { width: 72px; position: absolute; left: 43%; bottom: 75px; transform: rotate(10deg); }

.scatter { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); row-gap: 190px; padding: 70px 0 240px; }
.piece { position: relative; color: var(--ink); }
.piece h2 { margin: 20px 0 8px; font-size: 33px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; }
.piece p { margin: 0; color: var(--soft-ink); font-size: 15px; line-height: 1.55; }
.hand-note { color: var(--blue); font-family: var(--hand); font-size: 19px; line-height: 1; }

.field-piece { grid-column: 2 / span 7; transform: rotate(-0.7deg); }
.piece-heading { display: flex; justify-content: space-between; align-items: end; margin: 0 12px 10px; }
#flow-field { display: block; width: 100%; height: 390px; border: 1.5px solid var(--ink); background: rgba(246, 242, 232, 0.5); cursor: crosshair; }
.field-piece h2, .field-piece > p { max-width: 500px; margin-left: 28px; }
.field-piece > p { margin-top: 8px; }
.tape { position: absolute; z-index: 2; width: 76px; height: 25px; background: rgba(215, 197, 135, 0.5); box-shadow: inset 0 0 12px rgba(132, 109, 60, .12); }
.tape-left { top: -9px; left: -27px; transform: rotate(-38deg); }

.margin-note { position: absolute; z-index: 3; color: var(--blue); font-family: var(--hand); font-size: 22px; line-height: 1.05; }
.margin-note svg { overflow: visible; }
.margin-note path { stroke: var(--blue); }
.note-one { top: 370px; right: 1%; transform: rotate(4deg); }
.note-one svg { display: block; width: 110px; margin-left: -95px; margin-top: -5px; }

.article-card { display: grid; text-decoration: none; }
.color-article { grid-column: 5 / span 8; grid-template-columns: 1.55fr 1fr; gap: 42px; align-items: center; }
.picture { position: relative; border: 1.5px solid var(--ink); overflow: hidden; transition: transform 300ms ease, box-shadow 300ms ease; }
.article-card:hover .picture { transform: translate(-5px, -5px) rotate(-0.5deg); box-shadow: 8px 9px 0 rgba(41, 43, 41, .14); }
.color-picture { height: 410px; background: #e6b84c; }
.color-article .color-picture, .article-hero { view-transition-name: color-study; }
.color-picture::before { content: ""; position: absolute; inset: 0; background: linear-gradient(128deg, transparent 48%, rgba(239, 101, 63, .85) 48% 70%, transparent 70%), linear-gradient(32deg, transparent 45%, rgba(49, 93, 131, .8) 45% 65%, transparent 65%); mix-blend-mode: multiply; }
.sun { position: absolute; width: 210px; height: 210px; border-radius: 50%; background: #f3e9c9; top: 80px; left: 30%; box-shadow: 0 0 0 26px rgba(246, 242, 232, .12); }
.glass { position: absolute; width: 125px; height: 275px; border: 2px solid var(--ink); border-radius: 50% 50% 18px 18px; backdrop-filter: blur(3px); }
.glass-a { left: 19%; top: 80px; transform: rotate(-14deg); background: rgba(58, 107, 138, .25); }
.glass-b { right: 13%; top: 42px; transform: rotate(18deg); background: rgba(223, 91, 58, .25); }
.picture-label { position: absolute; left: 12px; bottom: 9px; padding: 3px 6px; background: var(--paper); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; }
.article-copy h2 { font-size: 40px; }
.article-copy p { max-width: 300px; }
.read-link { display: inline-block; margin-top: 26px; font-family: var(--mono); font-size: 11px; border-bottom: 1px solid; }
.read-link i { display: inline-block; font-style: normal; transition: transform 180ms ease; }
.article-card:hover .read-link i { transform: translate(3px, -3px); }
.article-scrawl { position: absolute; right: 5px; bottom: -55px; transform: rotate(-6deg); }

.escape-piece { grid-column: 1 / span 9; display: grid; grid-template-columns: 1.5fr .85fr; gap: 38px; align-items: end; transform: rotate(.4deg); }
.escape-stage { position: relative; height: 345px; overflow: hidden; border: 1.5px solid var(--ink); background: rgba(231, 225, 211, .55); }
.escape-stage::before { content: ""; position: absolute; inset: 0; opacity: .2; background: repeating-radial-gradient(ellipse at 50% 110%, transparent 0 35px, var(--ink) 36px 37px); }
.stage-rule { position: absolute; left: 7%; right: 7%; bottom: 45px; border-top: 2px solid var(--ink); transform: rotate(-1deg); }
#launch-ball { position: absolute; left: 47%; bottom: 47px; width: 56px; height: 56px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.contained-ball, #escaped-ball { display: block; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #ffb06d 0 8%, var(--orange) 35%, #b73529 100%); box-shadow: inset -7px -8px 11px rgba(88, 25, 21, .22), 4px 7px 7px rgba(41,43,41,.18); }
.contained-ball { transition: transform 180ms ease; }
#launch-ball:hover .contained-ball { transform: translateY(-8px); }
.launch-label { position: absolute; top: -30px; left: 62px; width: 65px; color: var(--blue); font-family: var(--hand); font-size: 18px; transform: rotate(-6deg); }
.escape-copy { padding-bottom: 35px; }
.escape-copy .hand-note { display: block; margin: 20px 0 0 -75px; text-align: center; transform: rotate(4deg); }
#escaped-ball { display: none; position: absolute; z-index: 20; left: 0; top: 0; cursor: grab; touch-action: none; will-change: transform; }
#escaped-ball.dragging { cursor: grabbing; }

.code-scrap { grid-column: 6 / span 6; padding: 36px 42px 30px; background: #e9dfc9; box-shadow: 3px 7px 14px rgba(41,43,41,.13); transform: rotate(2.3deg); }
.code-scrap::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(41,43,41,.12); pointer-events: none; }
.pin { position: absolute; width: 13px; height: 13px; left: 50%; top: 8px; border-radius: 50%; background: var(--orange); box-shadow: 2px 3px 3px rgba(41,43,41,.25); }
.code-scrap pre { margin: 18px 0; font: 13px/1.8 var(--mono); white-space: pre-wrap; }
.code-scrap code span { color: var(--blue); }
.code-scrap code b { color: #9b4431; font-weight: 400; }
.scrap-caption { max-width: 390px; margin: 0 0 0 25% !important; color: var(--ink) !important; font-size: 16px !important; }

.systems-article { grid-column: 2 / span 10; grid-template-columns: 1.35fr .8fr; gap: 58px; align-items: center; }
.systems-picture { height: 420px; background: var(--blue); }
.systems-picture svg { width: 100%; height: 100%; }
.orbit-lines { fill: none; stroke: #d8d6c7; stroke-width: 1.4; opacity: .75; }
.nodes { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; }
.core { fill: var(--orange); stroke: var(--ink); stroke-width: 2; }
.note-two { bottom: 610px; right: -5px; transform: rotate(-5deg); }
.note-two svg { width: 70px; display: block; margin-left: -45px; }

.about { position: relative; max-width: 710px; margin: 0 auto 180px; padding: 65px 72px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); text-align: center; }
.about > p { margin: 20px 0 30px; font-size: 31px; line-height: 1.2; letter-spacing: -.025em; }
.about-links { display: flex; justify-content: center; gap: 32px; font: 11px var(--mono); }
.about-links a { text-underline-offset: 5px; }
.about .hand-note { position: absolute; right: -90px; bottom: 3px; transform: rotate(-7deg); }

footer { display: flex; justify-content: space-between; padding-bottom: 35px; color: var(--soft-ink); font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 800px) {
  .page-width { width: min(100% - 34px, 620px); }
  .site-header { grid-template-columns: 1fr auto; gap: 10px; }
  .header-note { display: none; }
  .header-loop { width: 100px; left: 110px; }
  .intro { min-height: 540px; padding: 160px 0 70px 20px; }
  .intro h1 { font-size: clamp(54px, 17vw, 86px); }
  .intro-copy { width: min(290px, 80%); margin: 42px 0 0 auto; font-size: 17px; }
  .issue { left: -5px; top: 175px; }
  .intro-arrow { left: 26%; bottom: 55px; }
  .scatter { display: block; padding-top: 40px; padding-bottom: 150px; }
  .piece, .code-scrap { margin-bottom: 150px; }
  .field-piece { transform: rotate(-.5deg); }
  #flow-field { height: 310px; }
  .field-piece h2, .field-piece > p { margin-left: 12px; }
  .piece h2 { font-size: 29px; }
  .color-article, .systems-article, .escape-piece { grid-template-columns: 1fr; gap: 25px; }
  .color-picture, .systems-picture { height: min(90vw, 410px); }
  .article-copy { padding-inline: 12px; }
  .article-copy h2 { font-size: 35px; }
  .escape-piece { display: flex; flex-direction: column; align-items: stretch; }
  .escape-stage { height: 280px; order: 1; }
  .escape-copy { order: 0; padding: 0 12px; }
  .escape-copy .hand-note { display: none; }
  .code-scrap { padding: 34px 25px 27px; }
  .code-scrap pre { font-size: 11px; }
  .scrap-caption { margin-left: 8% !important; }
  .margin-note { display: none; }
  .about { margin-bottom: 110px; padding: 50px 20px; }
  .about > p { font-size: 26px; }
  .about .hand-note { right: 4px; bottom: -32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
