:root {
  --paper: #f2f1e8;
  --ink: #2b2b2b;
  --mute: #8a8980;
  --rule: rgba(43, 43, 43, .16);
  --tint: rgba(43, 43, 43, .06);
  --grain-op: 1;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0 0.12 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --display: var(--mono);
  --text: var(--mono);
  --gutter: clamp(18px, 4vw, 40px);
}

[data-theme="dark"] {
  --paper: #2b2b2b;
  --ink: #f2f1e8;
  --mute: #8f8e86;
  --rule: rgba(242, 241, 232, .18);
  --tint: rgba(242, 241, 232, .07);
  --grain-op: .5;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html { background: var(--paper); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.75;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
}

/* paper grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain);
  opacity: var(--grain-op);
}

a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---------- frame ---------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 22px var(--gutter);
}
.bar .name {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.02em;
  text-decoration: none;
}
.bar nav { display: flex; gap: clamp(14px, 3vw, 28px); align-items: baseline; }
.bar nav a,
.bar nav button,
.foot a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--mute);
  text-decoration: none;
  transition: color .2s;
}
.bar nav button { all: unset; cursor: pointer; font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; color: var(--mute); transition: color .2s; }
.bar nav a:hover, .bar nav button:hover, .bar nav button:focus-visible, .foot a:hover { color: var(--ink); }
.bar nav a[aria-current] { color: var(--ink); }

.foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--gutter) 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--mute);
}
.foot .links { display: flex; gap: 18px; align-items: baseline; }
.foot button { all: unset; cursor: pointer; font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; color: var(--mute); transition: color .2s; }
.foot button:hover, .foot button:focus-visible { color: var(--ink); }

/* ---------- home ---------- */
/* the wheel runs off the left edge and sits a little low; the sentence is centred in what's left */
.home {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  grid-template-areas: "art intro";
  align-items: center;
  column-gap: clamp(8px, 2vw, 32px);
  padding: 0 var(--gutter) 0 0;
}
.intro {
  grid-area: intro;
  justify-self: start;
  position: relative;
  z-index: 1;
  padding-left: clamp(0px, 1.5vw, 24px);
}
.say {
  margin: 0;
  max-width: 11.5em;
  font-family: var(--display);
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.2;
  letter-spacing: -.03em;
}
.say.name { max-width: none; font-size: clamp(30px, 3.6vw, 54px); line-height: 1.05; letter-spacing: -.045em; }
.contact {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--mute);
}
.contact a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.contact a:hover { color: var(--ink); text-decoration-thickness: 2px; }
.say a {
  font-style: italic;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .13em;
}
.say a:hover { text-decoration-thickness: 3px; }

.art { grid-area: art; margin: 0; justify-self: start; width: 100%; transform: translateY(7svh); }   /* a little below centre, without growing the page */
.art canvas {
  display: block;
  width: min(100%, calc(72svh * var(--ar, 1.4)));
  height: auto;
  margin-right: auto;
  aspect-ratio: var(--ar, 1.4);
  cursor: crosshair;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 1s ease;
}
.art canvas.ready { opacity: 1; }
.art figcaption {
  margin: 4px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--mute);
}

@media (min-width: 761px) { .intro { transform: translateY(7svh); } }   /* level with the wheel's centre */

@media (max-width: 760px) {
  /* title at the top; the wheel fills what's left, zoomed so it runs off the sides and bottom */
  .home {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "art";
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    row-gap: 0;
    padding: 0;
  }
  .intro { padding: 18px var(--gutter) 0; }
  .art { position: relative; margin: 0; transform: none; overflow: hidden; align-self: stretch; min-height: 52svh; }
  .art canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150vw;
    max-width: none;
    height: auto;
    transform: translate(-50%, -46%);
  }
}

/* ---------- writing list ---------- */
.list, .post { width: 100%; max-width: 40rem; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.list h1, .post h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.1;
  letter-spacing: -.045em;
}
.list h1 { margin-bottom: 18px; }
.year {
  margin: 34px 0 6px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--mute);
}
.row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  column-gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.row:last-child { border-bottom: 1px solid var(--rule); }
.row time { font-family: var(--mono); font-size: 12px; color: var(--mute); padding-top: .55em; }
.row .t { font-family: var(--display); font-size: clamp(19px, 2.4vw, 22px); line-height: 1.3; letter-spacing: -.03em; }
.row .s { grid-column: 2; color: var(--mute); font-size: 14px; line-height: 1.55; margin-top: 4px; }
.row:hover .t { font-style: italic; }
.empty { color: var(--mute); }
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .row .s { grid-column: 1; }
  .row time { padding-top: 0; margin-bottom: 4px; }
}

/* ---------- a post ---------- */
.post header { margin-bottom: 28px; }
.meta { margin: 0 0 14px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; color: var(--mute); }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  margin: 2em 0 .55em;
}
.prose h2 { font-size: 24px; letter-spacing: -.035em; }
.prose h3 { font-size: 19px; letter-spacing: -.03em; }
.prose h4 { font-size: 16px; font-style: italic; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .25em 0; padding-left: .2em; }
.prose blockquote { padding-left: 1.1em; border-left: 1px solid var(--ink); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--tint); padding: .12em .38em; border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 1em 1.15em; background: var(--tint); border-radius: 6px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: 14px; }
.prose img { max-width: 100%; height: auto; display: block; margin: 1.6em 0; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--rule); }
.pn a { text-decoration: none; font-family: var(--display); font-size: 17px; line-height: 1.3; letter-spacing: -.03em; }
.pn a[rel="next"] { text-align: right; }
.pn a span { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--mute); }
.pn a:hover { font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  body, .say a, .art canvas { transition: none; }
}

/* the serif pairing, if you'd rather: set "font": "serif" in site.json and rebuild */
[data-font="serif"] {
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
}
[data-font="serif"] body { font-size: 20px; line-height: 1.65; }
[data-font="serif"] .bar .name { font-size: 27px; letter-spacing: 0; }
[data-font="serif"] .say { font-size: clamp(34px, 4.3vw, 62px); line-height: 1.12; letter-spacing: -.005em; }
[data-font="serif"] .say.name { font-size: clamp(27px, 2.9vw, 42px); line-height: 1; letter-spacing: -.015em; }
[data-font="serif"] .list h1, [data-font="serif"] .post h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -.01em; }
[data-font="serif"] .row .t { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.15; letter-spacing: 0; }
[data-font="serif"] .row .s { font-size: 17px; }
[data-font="serif"] .prose h2 { font-size: 34px; letter-spacing: 0; }
[data-font="serif"] .prose h3 { font-size: 27px; letter-spacing: 0; }
[data-font="serif"] .prose h4 { font-size: 22px; }
[data-font="serif"] .prose code { font-size: .8em; }
[data-font="serif"] .pn a { font-size: 24px; letter-spacing: 0; }

.prose strong { font-weight: 600; }

/* the home page's bar carries only the links, pushed to the right */
.bar--home .name { display: none; }
.bar nav { margin-left: auto; }
