:root {
  --paper: #f7f2e8;
  --cell: #ece2cd;
  --ink: #1c1712;
  --muted: #6b6053;
  --line: #dccfb8;
  --blood: #c2321a;
  --on-blood: #fff7ec;
  --honey: #e9a820;
  --dot: #e0d8c6;
  --comb-cell: #ece2cd;
  --comb-min: 0;
  --display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15110d;
    --cell: #241c14;
    --ink: #f3ebdd;
    --muted: #a89a86;
    --line: #3a3025;
    --blood: #f0563a;
    --on-blood: #15110d;
    --honey: #f0b53a;
    --dot: #2c251c;
    --comb-cell: #3a2f22;
    --comb-min: .35;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.4px);
  background-size: 19px 19px;
  color: var(--ink);
  font: 400 1.125rem/1.65 var(--text);
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration-color: var(--blood); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--blood); }
:focus-visible { outline: 2px solid var(--blood); outline-offset: 3px; }
img, video, iframe, embed { max-width: 100%; }

/* Bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 2rem; max-width: 76rem; margin: 0 auto; padding: 1.25rem 1.5rem;
  font: 500 .875rem/1.2 var(--mono);
}
.brand { display: inline-flex; align-items: center; gap: .625rem; text-decoration: none; }
.mark { width: 1.125rem; height: auto; display: block; }
.mark-wall { fill: none; stroke: var(--blood); stroke-width: 16; }
.mark-cursor { fill: var(--ink); }
.bar nav { display: flex; gap: 1.25rem; }
.bar nav a { text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.bar nav a[aria-current] { border-color: var(--blood); }

/* Hero */
.hero { max-width: 76rem; margin: 0 auto; padding: 4.5rem 1.5rem 3.5rem; }
.hero h1 { margin: 0; font: 800 clamp(3rem, 8vw, 5.5rem)/1 var(--display); letter-spacing: -.03em; }
.hero .standfirst { font-size: clamp(1.375rem, 2.6vw, 1.875rem); line-height: 1.35; color: var(--ink); margin-top: 1.25rem; max-width: 36rem; }
.hero-role { font: 500 clamp(.9375rem, 1.4vw, 1.0625rem)/1.5 var(--mono); color: var(--muted); margin: 1rem 0 0; max-width: 36rem; }
.hero-photo { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2.5rem 3.5rem; }
.portrait { position: relative; margin: 0; width: clamp(10rem, 22vw, 15rem); aspect-ratio: 13 / 15; }
.portrait::before { content: ""; position: absolute; inset: 0; background: var(--blood); clip-path: var(--hex); transform: translate(.75rem, .6rem); }
.portrait img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; clip-path: var(--hex); }
.standfirst { font-size: 1.375rem; line-height: 1.4; color: var(--muted); margin: 1.5rem 0 0; max-width: 32rem; }
.comb { display: block; width: 100%; height: auto; }
.comb .lit { fill: var(--blood); animation: rise .5s both cubic-bezier(.2, .8, .2, 1); transform-box: fill-box; transform-origin: center; }
.comb .c { fill: var(--comb-cell); opacity: calc(var(--comb-min) + (1 - var(--comb-min)) * var(--f, 1)); transition: fill .4s; }
.comb .c.honey { fill: var(--honey); }
.comb .c:hover { fill: var(--blood); transition-duration: 0s; }
@keyframes rise { from { opacity: 0; transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) { .comb .lit { animation: none; } .comb .c { transition: none; } }

/* Home sections */
.home-body, .recent { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; }
.home-body > p { max-width: 38rem; font-size: 1.3125rem; line-height: 1.5; }
.recent { padding-top: 4rem; }
h2 { font: 800 1.75rem/1.15 var(--display); letter-spacing: -.015em; margin: 2.5rem 0 .75rem; }
.recent h2 { margin-top: 0; }
.more, .home-body > p.more { font: 500 .9375rem/1.3 var(--mono); margin: 1.25rem 0 0; }
.home-body > h2:first-child { margin-top: 0; }
.recent .entries, .recent .more { max-width: 42rem; }

/* Projects widget: cards, each marked with a hexagon in its own colour. */
ul.projects {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem;
}
.page ul.projects { grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 2.5rem; }
.projects li { margin: 0; padding: 0; }
.projects li::before { content: none; }
.projects a {
  display: flex; flex-direction: column; height: 100%; padding: 1.5rem;
  background: var(--paper); border: 1px solid var(--line); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.projects a:hover { color: inherit; border-color: var(--blood); transform: translateY(-2px); }
.projects img { display: block; width: calc(100% + 3rem); max-width: none; margin: -1.5rem -1.5rem 1.25rem; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); }
.project-hex { display: block; width: 1.75rem; height: 2rem; margin-bottom: 1.25rem; background: var(--ink); clip-path: var(--hex); }
.project-lit .project-hex { background: var(--blood); }
.project-honey .project-hex { background: var(--honey); }
.project-kicker { font: 500 .8125rem/1.3 var(--mono); color: var(--muted); }
.project-title { font: 800 1.75rem/1.1 var(--display); letter-spacing: -.02em; margin: .25rem 0 .625rem; }
.project-text { font-size: 1.0625rem; line-height: 1.5; }
.project-status { margin-top: auto; padding-top: 1.25rem; font: 400 .8125rem/1.3 var(--mono); color: var(--muted); }

/* Credits widget: a filmography, newest first. */
ol.credits { list-style: none; margin: 1rem 0 0; padding: 0; max-width: 52rem; border-top: 1px solid var(--line); }
.credit { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.credit-years { font: 400 .875rem/1.9 var(--mono); color: var(--muted); }
.credit-body { display: flex; flex-direction: column; }
.credit-org { font: 800 1.375rem/1.2 var(--display); letter-spacing: -.01em; }
.credit-role { font: 500 .9375rem/1.4 var(--mono); color: var(--blood); margin-top: .25rem; }
.credit-text { font-size: 1.0625rem; line-height: 1.5; margin-top: .5rem; max-width: 40rem; }
ul.credit-also { list-style: none; margin: .625rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font: 400 .8125rem/1.4 var(--mono); color: var(--muted); }
ul.credit-also li { margin: 0; padding: 0; }
ul.credit-also li::before { content: none; }

/* Hive widget: pointy-top cells; each row tucks into the one above. */
.prose ul.hive, ul.hive {
  list-style: none; margin: 3rem auto 0; padding: 0; max-width: 58rem;
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
}
.hive .cell { grid-column: span 2; margin: 0; padding: 0; }
.hive .cell::before { content: none; }
.hive .cell:nth-child(5) { grid-column: 2 / span 2; }
.hive .cell:nth-child(-n+4) { margin-bottom: calc(-28.87% + 9.24px); }
.hive .cell > * {
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  aspect-ratio: 1 / 1.1547; width: calc(100% - 8px); margin: 0 auto;
  background: var(--cell); clip-path: var(--hex); padding: 0 14%;
  text-decoration: none; transition: background .15s, color .15s;
}
.hive small { font: 500 .8125rem/1.2 var(--mono); color: var(--muted); margin-bottom: .375rem; transition: color .15s; }
.hive b { font: 800 clamp(1.125rem, 2.4vw, 1.875rem)/1.05 var(--display); letter-spacing: -.015em; }
.hive .cell-lit > * { background: var(--blood); color: var(--on-blood); }
.hive .cell-lit small { color: inherit; }
.hive .cell-honey > * { background: var(--honey); }
.hive .cell-empty > * { background: none; position: relative; }
.hive .cell-empty > *::before { content: ""; position: absolute; inset: 0; background: var(--line); clip-path: var(--hex); opacity: .35; }
.hive a:hover { background: var(--blood); color: var(--on-blood); }
.hive a:hover small { color: inherit; }
.hive .cell-lit a:hover { background: var(--ink); color: var(--paper); }

/* Lists of writing */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entries a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: .875rem 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.entry-title { font: 600 1.25rem/1.25 var(--display); letter-spacing: -.01em; }
.entries time { font: 400 .8125rem/1.3 var(--mono); color: var(--muted); white-space: nowrap; }
.year h2 { font: 500 .9375rem/1.3 var(--mono); color: var(--blood); letter-spacing: 0; margin: 2.5rem 0 .75rem; }

/* Pages */
.page { max-width: 42rem; margin: 0 auto; padding: 2.5rem 1.5rem 0; }
.crumb { font: 500 .875rem/1.3 var(--mono); margin: 0 0 1rem; }
.crumb-end { margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--blood); }
.page-head h1 { font: 800 clamp(2.5rem, 7vw, 4rem)/1.05 var(--display); letter-spacing: -.025em; margin: 0; }
.prose h1 { font: 800 clamp(2.5rem, 7vw, 4rem)/1.05 var(--display); letter-spacing: -.025em; margin: 0 0 1.5rem; }
.meta { font: 400 .875rem/1.3 var(--mono); color: var(--muted); margin: 0 0 .875rem; }
.prose { margin-top: 2rem; }
.home-body.prose { margin-top: 0; }
.prose h3 { font: 800 1.3125rem/1.2 var(--display); margin: 2rem 0 .5rem; }
.prose > ul:not(.hive):not(.w-cards):not(.projects):not(.credits) { list-style: none; padding: 0; }
.prose > ul:not(.hive):not(.w-cards):not(.projects):not(.credits) > li { position: relative; padding-left: 1.5rem; margin: .375rem 0; }
.prose > ul:not(.hive):not(.w-cards):not(.projects):not(.credits) > li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: .6875rem; height: .8rem;
  background: var(--blood); clip-path: var(--hex);
}
.prose blockquote { margin: 1.75rem 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--blood); font-size: 1.1875rem; line-height: 1.55; }
.prose hr { border: 0; width: .875rem; height: 1rem; margin: 2.5rem auto; background: var(--blood); clip-path: var(--hex); }
.prose code { font: 400 .875em/1.5 var(--mono); }
.prose :not(pre) > code { background: var(--cell); border: 1px solid var(--line); padding: .05em .35em; white-space: nowrap; }
.prose pre { overflow-x: auto; background: var(--cell); padding: 1rem 1.25rem; font-size: 1rem; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .5rem .875rem .5rem 0; text-align: left; }
.prose td small { display: inline-block; margin-top: .25rem; font: 400 .8125rem/1.4 var(--mono); color: var(--muted); }

/* Cards widget, as a ruled list */
ul.w-cards { list-style: none; margin: 2rem 0; padding: 0; border-top: 1px solid var(--line); }
li.w-card { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
p.w-card-title { font: 800 1.5rem/1.15 var(--display); margin: 0 0 .375rem; }
p.w-card-text { margin: 0; color: var(--muted); }

/* Timeline widget */
ol.w-timeline { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
ol.w-timeline li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: .625rem 0; border-bottom: 1px solid var(--line); }
.w-when { font: 400 .875rem/1.4 var(--mono); color: var(--muted); }
.w-what { font-size: 1.0625rem; line-height: 1.4; }

.tags { display: flex; flex-wrap: wrap; gap: .75rem; font: 400 .875rem/1.3 var(--mono); margin: 2.5rem 0 0; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; font: 600 1.0625rem/1.25 var(--display); }
.pager small { display: block; font: 400 .8125rem/1.3 var(--mono); color: var(--muted); margin-bottom: .25rem; }
.pager .newer { grid-column: 2; text-align: right; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  max-width: 76rem; margin: 5rem auto 0; padding: 1.5rem; border-top: 1px solid var(--line);
  font: 400 .875rem/1.4 var(--mono); color: var(--muted);
}
.foot p { margin: 0; }
.foot-home { text-decoration: none; }
.foot-links { display: flex; gap: 1.25rem; }

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .hero { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  ul.projects { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .credit { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .prose ul.hive, ul.hive { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hive .cell:nth-child(n) { grid-column: span 2; margin-bottom: calc(-28.87% + 9.24px); }
  .hive .cell:nth-child(4) { grid-column: 2 / span 2; }
  .hive .cell:nth-child(n+5) { margin-bottom: 0; }
  .hive .cell:nth-child(3), .hive .cell:nth-child(6) { display: none; }
  .hive b { font-size: 1.1875rem; }
  .entries a { flex-direction: column; gap: .25rem; }
}

@media (max-width: 40rem) {
  .hero-photo { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .portrait { width: 9rem; }
}

/* About: the photo to download */
.bio-photo { margin: 1rem 0 0; }
.bio-photo a { display: inline-block; }
.bio-photo img { display: block; width: 15rem; height: auto; border: 1px solid var(--line); }

/* Reels: screen recordings on project pages */
.reel { margin: 2rem 0; }
.reel video { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--cell); }
.reel figcaption { margin-top: .625rem; font: 400 .8125rem/1.4 var(--mono); color: var(--muted); }
