:root {
  color-scheme: dark;
  --paper: #24241f;
  --ink: #eee9dc;
  --muted: #b8b2a3;
  --rule: #5b594f;
  --accent: #f39467;
  --wash: #323128;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
:root[data-theme='light'] {
  color-scheme: light;
  --paper: #f5f1e7;
  --ink: #25251f;
  --muted: #626154;
  --rule: #bbb5a6;
  --accent: #bd4823;
  --wash: #ebe4d5;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --paper: #f5f1e7;
    --ink: #25251f;
    --muted: #626154;
    --rule: #bbb5a6;
    --accent: #bd4823;
    --wash: #ebe4d5;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 17px/1.6 var(--serif); }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  /* Nah, gets too noisy, pun intended..
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23888888' filter='url(%23grain)' opacity='.32' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  */
}
::selection { color: var(--paper); background: var(--accent); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
button { color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 0; padding: 10px 13px; min-height: 44px; font: 12px/1.4 var(--mono); }
button:hover { background: var(--wash); }
button[hidden], [hidden] { display: none !important; }
.page { position: relative; width: min(100% - 96px, 1280px); margin: 0 auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--rule); padding: 25px 0 20px; }
.brand { font-size: 31px; letter-spacing: -1.4px; }
.dot { color: var(--accent); }
nav { display: flex; gap: 28px; align-items: center; font-size: 15px; }
nav a { padding: 10px 0; }
nav a:hover, .text-link:hover { color: var(--accent); }
h1, h2, h3 { font-weight: 400; }
h1 { font-size: clamp(46px, 5.3vw, 76px); line-height: 1.04; letter-spacing: -.055em; margin: 23px 0; }
h2 { font-size: 38px; line-height: 1.2; letter-spacing: -1px; margin: 0 0 5px; }
h3 { font-size: 29px; line-height: 1.2; letter-spacing: -1px; margin: 4px 0 0; }
p { margin: 0 0 16px; }
.eyebrow, .meta, .field-caption { font: 11px/1.6 var(--mono); letter-spacing: 1px; color: var(--muted); }
.eyebrow { text-transform: uppercase; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; align-items: center; padding: 62px 0 38px; }
.hero-copy { position: relative; z-index: 1; }
.intro { max-width: 460px; font-size: 19px; }
.text-link { display: inline-flex; align-items: center; gap: 24px; margin-top: 12px; padding: 10px 0; font: 13px var(--mono); }
.text-link span { color: var(--accent); font-size: 22px; }
.field { min-width: 0; }
.field-caption { display: flex; justify-content: space-between; gap: 12px; padding: 0 12px; }
.universe-stage { position: relative; }
.universe { width: 100%; height: 420px; display: block; }
.core { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 0; border-radius: 50%; width: 44px; height: 44px; padding: 0; color: var(--paper); background: transparent; font-size: 20px; }
.core:hover { color: var(--accent); background: transparent; }
.mass-drag { position: absolute; z-index: 3; width: 48px; height: 48px; transform: translate(-50%, -50%); touch-action: none; cursor: grab; border: 0; border-radius: 50%; padding: 0; background: transparent; }
.mass-drag:hover, .mass-drag:active { background: transparent; }
.mass-drag:active { cursor: grabbing; }
.mass-drag::after { content: ''; display: block; width: 12px; height: 12px; margin: auto; box-sizing: border-box; border: 2px solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.core { z-index: 2; }
.field-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--rule); padding-top: 12px; font: 11px/1.5 var(--mono); color: var(--muted); }
#field-notes { margin-top: 8px; }
.note-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s ease; }
.note-wrap.open { grid-template-rows: 1fr; }
.note-inner { overflow: hidden; }
.note { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 32px 0; margin: 10px 0 35px; }
.note h2 { font-size: 27px; }
.formula { font-size: 31px; display: flex; align-items: center; gap: 14px; padding: 12px 0; margin: 0; }
.fraction { display: inline-flex; flex-direction: column; text-align: center; line-height: 1.3; }
.fraction > :first-child { border-bottom: 1px solid var(--ink); padding: 0 6px 4px; }
.fraction > :last-child { padding-top: 3px; }
.projects { margin: 22px 0 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 21px; }
.section-heading h2::before { content: ''; display: block; width: 16px; height: 2px; background: var(--accent); margin-bottom: 13px; }
.section-heading p { margin: 0; }
.interaction-hint { color: var(--muted); font: 11px/1.6 var(--mono); text-align: right; max-width: 205px; }
.project { position: relative; display: grid; grid-template-columns: 190px 195px minmax(0, 1fr) 128px; gap: 22px; align-items: center; padding: 23px 10px; border-top: 1px solid var(--rule); transition: background-color .2s ease; }
.project:last-child { border-bottom: 1px solid var(--rule); }
.project.selected, .project:focus-within, .project.playing { background: var(--wash); }
.project.selected .meta, .project:focus-within .meta, .project.playing .meta { color: var(--accent); }
.project p { font-size: 15px; line-height: 1.6; margin: 0; }
.project .meta { font-size: 10px; letter-spacing: .7px; }
.row-trigger { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; border: 0; background: transparent; padding: 0; touch-action: manipulation; }
.row-trigger:hover { background: transparent; }
.study { width: 100%; max-width: 195px; }
.study canvas { width: 100%; height: 76px; display: block; }
.repo { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule); color: var(--accent); font: 12px/1.4 var(--mono); touch-action: manipulation; }
.repo:hover, .repo:focus-visible { border-color: var(--accent); background: var(--wash); }
.link-arrow { display: block; width: 20px; height: 20px; flex: 0 0 20px; color: var(--accent); }
.repo .link-arrow { transition: transform .2s ease; }
.project.playing .repo .link-arrow, .project.selected .repo .link-arrow { transform: translate(3px, -3px); }
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; padding: 65px 0 48px; }
.about .eyebrow { margin-bottom: 12px; }
.about p { max-width: 590px; }
.text-button { display: inline-flex; gap: 22px; border: none; padding: 10px 0; }
.text-button:hover { background: transparent; color: var(--accent); }
.text-button span { color: var(--accent); }
footer { border-top: 1px solid var(--rule); padding: 20px 0 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.back-top { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent); font-size: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 5; left: 20px; top: -90px; padding: 12px; background: var(--paper); }
.skip-link:focus { top: 12px; }
.no-script { max-width: 850px; margin: 20px auto; padding: 20px; }
@media (hover: hover) and (pointer: fine) {
  .project:hover { background: var(--wash); }
  .project:hover .meta { color: var(--accent); }
  .project:hover .repo .link-arrow { transform: translate(3px, -3px); }
}
@media (max-width: 1050px) {
  .page { width: calc(100% - 64px); }
  .project { grid-template-columns: 170px 145px minmax(0, 1fr) 128px; gap: 17px; }
  h3 { font-size: 26px; }
  .hero { gap: 22px; }
}
@media (max-width: 760px) {
  .page { width: calc(100% - 40px); }
  .masthead { padding: 17px 0; }
  .brand { font-size: 27px; }
  nav { gap: 15px; }
  nav > a { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 37px; gap: 28px; }
  h1 { font-size: clamp(42px, 8.8vw, 64px); letter-spacing: -.05em; }
  .intro { font-size: 18px; max-width: 490px; }
  .hero-copy .text-link { margin-top: 0; }
  .universe { height: 410px; }
  .field { max-width: 540px; width: 100%; margin: 0 auto; }
  .section-heading { display: block; }
  .interaction-hint { text-align: left; max-width: none; padding-top: 10px; }
  .project { grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; padding: 20px 4px; }
  .project p { grid-column: 1 / 3; grid-row: 2; font-size: 16px; }
  .repo { grid-column: 1 / -1; grid-row: 3; width: 100%; margin-top: 4px; }
  .project > .meta:last-child { display: none; }
  .study canvas { height: 65px; }
  .note, .about { grid-template-columns: 1fr; gap: 20px; }
  .about { padding: 40px 0; }
}
@media (max-width: 420px) {
  .project { grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; }
  h3 { font-size: 22px; letter-spacing: -.8px; }
  .study canvas { height: 60px; }
  .eyebrow { font-size: 10px; letter-spacing: .7px; }
}
@media (max-width: 350px) {
  .project { grid-template-columns: minmax(0, 1fr) 44px; }
  .study { grid-column: 1; grid-row: 2; max-width: 150px; }
  .project p { grid-column: 1 / 3; grid-row: 3; }
  .repo { grid-column: 1 / -1; grid-row: 4; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

