@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('urbanist-latin-700-normal-ede48e359f.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('albert-sans-latin-400-normal-59e53b4a6c.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('albert-sans-latin-400-italic-a31cbeca2d.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('albert-sans-latin-600-normal-2c9edbc223.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('albert-sans-latin-800-normal-bc4c188cab.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('ibm-plex-mono-latin-400-normal-08949f728d.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('ibm-plex-mono-latin-500-normal-01d2854474.woff2') format('woff2');
}

/* The writing section's one stylesheet. The build adds the @font-face rules
   above this and gives the file a content-hashed name, so it can cache forever.

   The section takes the site's type (Urbanist headings, Albert Sans text) and
   its own colour, butter paper, after the site's lime, sky and charcoal. The
   receipts sit on a slip of till paper, set in IBM Plex Mono. */

:root {
  --ink: #202020;
  --text: #2a2723;
  --muted: #6b6153;
  --paper: #f7f4ef;
  --butter: #ffe7a3;
  --slip: #fffdf7;
  --rule: rgba(32, 32, 32, 0.28);
  --link: #49ab44;
  --link-hover: #2f7a2b;
  --code: #26211e;
  --font-heading: 'Urbanist', 'Albert Sans', system-ui, sans-serif;
  --font-text: 'Albert Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: 24px;
  --frame: 66rem;
}

@media (min-width: 721px) {
  :root {
    --gutter: 56px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  font-optical-sizing: auto;
}

::selection {
  background: #ffd76a;
  color: var(--ink);
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid rgba(45, 63, 74, 0.85);
  outline-offset: 3px;
  border-radius: 3px;
}

.frame {
  width: min(100% - 2 * var(--gutter), var(--frame));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- The band: the header and each page's title, on butter paper ---------- */

.band {
  background:
    radial-gradient(ellipse 70% 90% at 12% 0%, #fffaea 0%, transparent 70%),
    radial-gradient(
      ellipse 60% 80% at 92% 100%,
      rgba(255, 210, 122, 0.85) 0%,
      transparent 72%
    ),
    var(--butter);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
}

.site-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.site-name:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

/* The same frosted pill as the portfolio's nav. */
.site-nav {
  display: flex;
  gap: 0.25rem;
  padding: 8px 10px;
  border: 1px solid rgba(34, 44, 52, 0.1);
  border-radius: 999px;
  background: rgba(247, 244, 239, 0.72);
  box-shadow: 0 18px 36px rgba(90, 67, 16, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: rgba(16, 16, 16, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

.site-nav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.75);
}

@media (min-width: 721px) {
  .site-header {
    padding-block: 1.75rem;
  }

  .site-nav {
    gap: 0.75rem;
    padding: 10px 14px;
  }

  .site-nav a {
    padding: 9px 12px;
    font-size: 0.84rem;
  }
}

.kicker {
  margin: clamp(2rem, 6vw, 4rem) 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker a {
  text-decoration: none;
}

.kicker a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.band h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: var(--ink);
  text-wrap: balance;
}

.dek {
  margin: 1.25rem 0 0;
  max-width: 38rem;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.4;
  color: #3d372e;
  text-wrap: pretty;
}

.post-date {
  margin: 1.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- The receipt slip ---------- */

/* The shadow sits on a wrapper, because the slip's torn edge is a mask and a
   mask would clip the slip's own shadow. */
.receipt-wrap {
  filter: drop-shadow(0 14px 22px rgba(90, 67, 16, 0.2));
}

.receipt {
  --tooth: 14px;
  padding: 1.5rem 1.35rem calc(1.5rem + var(--tooth) / 2);
  background: var(--slip);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  /* A row of small teeth along the foot, like paper torn off a till. */
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom /
      var(--tooth) calc(var(--tooth) / 2) repeat-x;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2) no-repeat,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom /
      var(--tooth) calc(var(--tooth) / 2) repeat-x;
}

.receipt-heading {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

.receipt-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  text-align: center;
}

.receipt-lines {
  margin: 1rem 0 0;
  padding: 0.85rem 0;
  border-block: 1.5px dashed var(--rule);
}

.receipt-lines div {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.receipt-lines div + div {
  margin-top: 0.45rem;
}

.receipt-lines dt {
  flex: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receipt-lines dd {
  display: flex;
  flex: 1;
  min-width: 0;
  margin: 0;
}

/* Dot leaders from the label to its value. */
.receipt-lines dd::before {
  content: '';
  flex: 1 1 1rem;
  min-width: 1rem;
  margin: 0 0.45rem;
  border-bottom: 2px dotted rgba(32, 32, 32, 0.4);
  transform: translateY(-0.3em);
}

.receipt-lines dd > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-lines a {
  text-decoration-color: var(--link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

.receipt-lines a:hover {
  color: var(--link-hover);
}

.receipt-barcode {
  display: block;
  width: 100%;
  height: 2.6rem;
  margin-top: 1rem;
  fill: var(--ink);
}

.receipt-thanks {
  margin: 0.6rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- A post ---------- */

.post-head h1 {
  max-width: 15em;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
}

.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* On phones the slip sits under the title, overlapping the band's edge. */
.post-grid > .receipt-wrap {
  width: min(100%, 21rem);
  margin: -2.25rem 0 0.5rem;
  transform: rotate(-1.25deg);
}

/* On desktop it moves to a margin column and stays in view while you read. */
@media (min-width: 1060px) {
  .band .post-head {
    max-width: calc(100% - 20rem - 4rem);
  }

  .post-grid {
    grid-template-columns: minmax(0, 40rem) 18rem;
    justify-content: space-between;
    column-gap: 4rem;
  }

  .post-grid > .receipt-wrap {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    width: auto;
    margin: -12rem 0 0;
    transform: rotate(1.25deg);
  }

  .post-grid > .post-body,
  .post-grid > .post-neighbours {
    grid-column: 1;
  }
}

.post-body {
  max-width: 40rem;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  font-size: 1.125rem;
  line-height: 1.7;
  counter-reset: section;
  overflow-wrap: break-word;
}

@media (min-width: 721px) {
  .post-body {
    font-size: 1.1875rem;
  }
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 1.25em;
}

.post-body li + li {
  margin-top: 0.35em;
}

.post-body li::marker {
  color: var(--muted);
}

/* Each heading carries its number, like the lines of a log. */
.post-body h2 {
  margin: 2.4em 0 0.6em;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
  counter-increment: section;
}

.post-body h2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.post-body h3 {
  margin: 1.8em 0 0.4em;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.post-body a {
  text-decoration-color: var(--link);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.post-body a:hover {
  color: var(--link-hover);
}

.post-body strong {
  font-weight: 600;
  color: var(--ink);
}

.post-body img,
.post-body video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border: 1px solid rgba(32, 32, 32, 0.1);
  border-radius: 12px;
  background: #fff;
}

.post-body blockquote {
  margin: 2rem 0;
  padding: 0.15rem 0 0.15rem 1.25rem;
  border-left: 3px solid #e0a92e;
  color: #3d372e;
}

.post-body blockquote > :last-child {
  margin-bottom: 0;
}

.post-body hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1.5px dashed var(--rule);
}

.post-body :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgba(47, 47, 49, 0.08);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* Code is coloured at build time by shiki; the block takes the site's charcoal. */
.post-body pre {
  margin: 2rem 0;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background-color: var(--code) !important;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 2;
}

.post-body pre code {
  font-family: inherit;
}

.post-body table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.95em;
  line-height: 1.45;
}

.post-body th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  color: var(--muted);
}

.post-body th,
.post-body td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1.5px dashed var(--rule);
  vertical-align: top;
}

.post-neighbours {
  display: grid;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1.5px dashed var(--rule);
}

@media (min-width: 600px) {
  .post-neighbours {
    grid-template-columns: 1fr 1fr;
  }
}

.post-neighbours a {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 231, 163, 0.45);
  text-decoration: none;
}

.post-neighbours a:hover {
  background: rgba(255, 231, 163, 0.8);
}

.post-neighbours [rel='next'] {
  grid-column: -2;
  text-align: right;
}

.post-neighbours span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-neighbours strong {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

/* ---------- The list ---------- */

.list-head h1 {
  font-size: clamp(3.5rem, 11vw, 6.85rem);
}

.post-list {
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 0;
  list-style: none;
}

.post-list > li {
  display: grid;
  gap: 0.35rem 2.5rem;
  padding-block: 1.75rem;
  border-bottom: 1.5px dashed var(--rule);
}

@media (min-width: 721px) {
  .post-list > li {
    grid-template-columns: 10rem minmax(0, 1fr);
  }
}

.post-list time {
  padding-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.post-list h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--ink);
}

.post-list h2 a {
  text-decoration: none;
}

.post-list h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.15em;
}

.post-list .draft {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}

.post-list p {
  margin: 0.5rem 0 0;
  max-width: 42rem;
  font-size: 1.075rem;
  line-height: 1.55;
}

/* The receipts, as small stubs of till paper. */
.receipt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.receipt-tags li {
  padding: 0.2rem 0.55rem;
  border: 1.5px dashed var(--rule);
  border-radius: 4px;
  background: var(--slip);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty {
  padding-block: 2.5rem;
  font-size: 1.15rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding-block: 1.75rem 2.5rem;
  border-top: 1.5px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration-color: var(--link);
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--ink);
}
