/* ===========================
   TOKENS
   =========================== */
:root {
  --desk: #efe8dc;
  --desk-2: #e7dfd1;
  --paper: #fffdf8;
  --paper-2: #f7f2e8;
  --receipt: #fbfaf6;
  --ink: #1d1b19;
  --ink-2: #57524b;
  --ink-3: #8f887d;
  --red: #d7362c;
  --red-ink: #c22a21;
  --orange: #f2592b;
  --pink: #ffd2c4;
  --yellow: #ffe68f;
  --blue: #bfd8f4;
  --kraft: #c9a878;
  --kraft-2: #b8956a;
  --line: rgba(29, 27, 25, 0.12);
  --shadow: 0 1px 1px rgba(60, 40, 20, 0.08), 0 6px 14px -4px rgba(60, 40, 20, 0.18), 0 22px 40px -18px rgba(60, 40, 20, 0.28);
  --shadow-lift: 0 2px 2px rgba(60, 40, 20, 0.08), 0 14px 24px -6px rgba(60, 40, 20, 0.22), 0 40px 60px -24px rgba(60, 40, 20, 0.35);
  --floor: #1a1714;
  --desk-ink: #1d1b19;
  --desk-ink-2: #57524b;
  --desk-ink-3: #8f887d;

  --hand: 'Caveat', 'Segoe Print', cursive;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --type: 'Special Elite', 'Courier New', monospace;

  --canvas: 1280px;
  --col: 880px;

  /* "only" stops browsers like chrome from auto-darkening the page: the lamp has its own dark mode */
  color-scheme: only light;
}

/* lamp off */
:root[data-theme="dark"] {
  color-scheme: only dark;
  --desk: #000;
  --desk-2: #111;
  --paper: #ece6da;
  --paper-2: #e2dbcd;
  --receipt: #e9e6de;
  --ink: #1d1b19;
  --ink-2: #4e4943;
  --ink-3: #7c766c;
  --line: rgba(29, 27, 25, 0.14);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 10px 20px -6px rgba(0, 0, 0, 0.6), 0 30px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 2px 2px rgba(0, 0, 0, 0.4), 0 18px 30px -8px rgba(0, 0, 0, 0.65), 0 50px 70px -26px rgba(0, 0, 0, 0.8);
  --floor: #000;
  --desk-ink: #ece4d6;
  --desk-ink-2: #b9b0a2;
  --desk-ink-3: #847c70;
}

/* ===========================
   RESET
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background-color: var(--desk);
  color: var(--desk-ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* paper grain on the desk */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* lamp off: plain black, no grain */
:root[data-theme="dark"] body::before {
  display: none;
}

:root[data-theme="dark"] .floor {
  border-top: 1px solid #1c1c1c;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.hand {
  font-family: var(--hand);
}

.small {
  font-size: 0.8em;
}

/* ===========================
   TOP BAR
   =========================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 36px) 22px;
  pointer-events: none;
  background: linear-gradient(var(--desk) 62%, transparent);
  transition: background 0.5s ease;
}

.topbar>* {
  pointer-events: auto;
}

.topnav {
  display: flex;
  gap: 22px;
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 500;
}

.topnav a {
  color: var(--ink-2);
  transition: color 0.2s;
}

:root[data-theme="dark"] .topnav a,
:root[data-theme="dark"] .live {
  color: #cfc6b8;
}

.topnav a:hover {
  color: var(--red);
}

.live {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

.live-pulse .heart {
  color: var(--red);
  display: inline-block;
  animation: beat 1.6s ease-in-out infinite;
}

@keyframes beat {

  0%,
  60%,
  100% {
    transform: scale(1);
  }

  10% {
    transform: scale(1.25);
  }

  25% {
    transform: scale(1.05);
  }

  35% {
    transform: scale(1.2);
  }
}

.lamp {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

/* touch screens keep :hover after a tap, which leaves the lamp stuck tilted */
@media (hover: hover) {
  .lamp:hover {
    transform: rotate(-12deg);
  }
}

/* ===========================
   THE COLUMN
   =========================== */
.col {
  position: relative;
  z-index: 1;
  width: min(var(--col), 100% - 40px);
  margin: 0 auto;
  padding: 120px 0 110px;
}

.hand {
  font-family: var(--hand);
}

.mono {
  font-family: var(--mono);
}

.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 244, 214, 0.62);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

/* hello */
.hello {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 48px;
  align-items: start;
}

.sig {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(48px, 6vw, 68px);
  line-height: 1;
  color: var(--red);
  margin-bottom: 26px;
}

.seal {
  display: inline-grid;
  place-items: center;
  vertical-align: 0.5em;
  /* sized from its own font-size, which is a fraction of the name's */
  font-size: 0.32em;
  width: 2.05em;
  height: 2.05em;
  margin-left: 0.35em;
  background: var(--red);
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  border-radius: 3px;
  transform: rotate(5deg);
  box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3.5px rgba(255, 255, 255, 0.85);
}

.hello-text p {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  margin-bottom: 18px;
  max-width: 560px;
}

.hello-text a {
  color: var(--red-ink);
  border-bottom: 1.5px solid rgba(215, 54, 44, 0.35);
  transition: border-color 0.2s, background 0.2s;
}

.hello-text a:hover {
  border-color: var(--red);
  background: rgba(215, 54, 44, 0.08);
}

.hello-meta {
  font-family: var(--mono) !important;
  font-size: 12.5px !important;
  color: var(--desk-ink-3);
  margin-top: 26px;
}

.hello-meta a {
  color: var(--desk-ink-2) !important;
  border-bottom-color: var(--line) !important;
}

.hello-side {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-top: 6px;
}

.polaroid {
  color: var(--ink);
  position: relative;
  background: var(--paper);
  padding: 10px 10px 0;
  box-shadow: var(--shadow);
  transform: rotate(2.5deg);
}

.polaroid img {
  aspect-ratio: 1;
  object-fit: cover;
}

.polaroid figcaption {
  font-family: var(--hand);
  font-size: 22px;
  text-align: center;
  padding: 8px 0 12px;
  color: var(--ink-2);
}

.badge {
  color: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--paper);
  border-radius: 10px;
  padding: 24px 18px 16px;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  transition: transform 0.25s, box-shadow 0.25s;
}

.badge:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.badge-hole {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 32px;
  height: 7px;
  margin-left: -16px;
  border-radius: 4px;
  background: var(--desk-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.badge-org {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  margin-bottom: 12px;
}

.badge-name {
  font-weight: 600;
  font-size: 14px;
}

.badge-role {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.badge-stamp {
  position: absolute;
  top: 46px;
  right: 12px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 1px 6px;
  transform: rotate(-14deg);
  opacity: 0.85;
}

/* commit log on graph paper */
.graph[hidden] {
  display: none;
}

.graph {
  color: var(--ink);
  margin: 56px 0 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(60, 120, 200, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 120, 200, 0.12) 1px, transparent 1px);
  background-size: 14px 14px;
  padding: 14px 20px 18px;
  box-shadow: var(--shadow);
  transform: rotate(-0.4deg);
}

.graph-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
}

.graph-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.graph-foot {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: right;
}

.graph-foot:hover {
  color: var(--red);
}

.contrib {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, auto);
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
  min-height: 60px;
}

.contrib i {
  display: block;
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(29, 27, 25, 0.07);
}

.contrib i[data-l="1"] { background: #ffd98a; }
.contrib i[data-l="2"] { background: #f9a66c; }
.contrib i[data-l="3"] { background: #ea6a3d; }
.contrib i[data-l="4"] { background: var(--red); }

/* section labels */
.scrawl {
  font-family: var(--hand);
  font-size: 36px;
  font-weight: 700;
  color: var(--red);
  margin: 90px 0 22px;
  line-height: 1;
}

/* work tiles (emmi-style grid) */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile-wide {
  grid-column: 1 / -1;
}

.tile-visual {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), box-shadow 0.3s;
}

.tile-wide .tile-visual {
  aspect-ratio: 21 / 9;
}

.tile:hover .tile-visual {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.tile-visual img {
  position: absolute;
  left: 8%;
  top: 14%;
  width: 92%;
  box-shadow: 0 8px 20px -6px rgba(40, 20, 10, 0.4);
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1);
}

.tile:hover .tile-visual img {
  transform: translateY(-6px);
}

.tile-cream { background: var(--paper-2); }
.tile-blue { background: var(--blue); }
.tile-pink { background: var(--pink); }
.tile-yellow { background: var(--yellow); }

/* hooklens: receipt beside its screenshot */
.tile-wide .tile-visual img {
  left: 34%;
  top: 16%;
  width: 70%;
}

.receipt {
  position: absolute;
  left: 5%;
  top: 8%;
  width: 240px;
  z-index: 2;
  --edge: 7px;
  background: var(--receipt);
  font-family: var(--mono);
  font-size: 11.5px;
  color: #2a2724;
  padding: 20px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: rotate(-2.5deg);
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/calc(var(--edge)*2) var(--edge) repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top/calc(var(--edge)*2) var(--edge) repeat-x,
    linear-gradient(#000 0 0) center/100% calc(100% - var(--edge)*2) no-repeat;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/calc(var(--edge)*2) var(--edge) repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top/calc(var(--edge)*2) var(--edge) repeat-x,
    linear-gradient(#000 0 0) center/100% calc(100% - var(--edge)*2) no-repeat;
  filter: drop-shadow(0 8px 10px rgba(60, 40, 20, 0.2));
}

.r-head {
  font-weight: 600;
  font-size: 19px;
  text-align: center;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.r-sub {
  text-align: center;
  font-size: 10.5px;
  color: #6d675f;
}

.r-rule {
  border-top: 1.5px dashed #b4ada2;
  margin: 7px 0;
}

.r-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.r-row.dots span:first-child {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.r-row.dots span:first-child::after {
  content: ' ..........................................';
  color: #b4ada2;
}

.r-total {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

.r-thanks {
  text-align: center;
  margin-top: 10px;
  font-size: 11px;
}

.r-code {
  height: 34px;
  margin: 10px 6px 0;
  background: repeating-linear-gradient(90deg, #2a2724 0 2px, transparent 2px 3px, #2a2724 3px 4px, transparent 4px 7px, #2a2724 7px 10px, transparent 10px 11px, #2a2724 11px 12px, transparent 12px 15px);
}

.tile-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--desk-ink-3);
}

.tile-title {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.tile:hover .tile-title {
  color: var(--red);
}

.tile-desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--desk-ink-2);
}

/* side quests as an index card */
.tile-list {
  color: var(--ink);
  background: var(--paper);
  background-image: linear-gradient(var(--red) 0 0), repeating-linear-gradient(transparent 0 71px, rgba(60, 120, 200, 0.16) 71px 72px);
  background-size: 100% 1.5px, 100% 100%;
  background-position: 0 42px, 0 43px;
  background-repeat: no-repeat, repeat;
  padding: 14px 22px 8px;
  box-shadow: var(--shadow);
  transform: rotate(0.3deg);
  gap: 0;
  align-self: start;
}

.tile-list .tile-meta {
  color: var(--red-ink) !important;
  height: 28px;
}

.tile-list a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  height: 72px;
  padding-top: 6px;
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color 0.15s;
}

.tile-list a:hover {
  color: var(--red);
}

.tile-list .mono {
  font-size: 12.5px;
  color: var(--ink);
}

/* writing cards reuse the project tiles; a post without an image gets its title instead */
.post-tile-blank {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10%;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  text-align: center;
  color: var(--red);
}

/* ===========================
   FLOOR (footer)
   =========================== */
.floor {
  position: relative;
  z-index: 1;
  background: var(--floor);
  color: #d7cfc2;
  padding: 90px clamp(16px, 4vw, 48px) 120px;
  overflow: hidden;
}

.floor-inner {
  max-width: var(--canvas);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: clamp(24px, 5vw, 64px);
  flex-wrap: wrap;
}

.ascii-me {
  font-family: var(--mono);
  font-size: 6.5px;
  line-height: 1.05;
  color: #7a7166;
  transition: color 0.3s;
}

.ascii-me:hover {
  color: var(--orange);
}

.floor-hi {
  font-size: 40px;
  color: #f1e9dc;
  line-height: 1.1;
  margin-bottom: 18px;
}

.floor-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--mono);
  font-size: 13px;
}

.floor-links a,
.floor-meta a {
  border-bottom: 1px solid rgba(215, 207, 194, 0.3);
  transition: color 0.2s, border-color 0.2s;
}

.floor-links a:hover,
.floor-meta a:hover {
  color: var(--orange);
  border-color: var(--orange);
}

.floor-meta {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #7a7166;
}

.bugs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  height: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: #8a7f70;
}

.bugs span {
  position: absolute;
  left: 0;
  white-space: nowrap;
  animation: crawl var(--d) linear infinite;
  animation-delay: var(--o);
}

.bugs span:nth-child(even) {
  bottom: 14px;
}

@keyframes crawl {
  from {
    transform: translateX(-120px);
  }

  to {
    transform: translateX(100vw);
  }
}

.bugs-note {
  position: absolute;
  right: clamp(16px, 4vw, 48px);
  bottom: 14px;
  font-family: var(--hand);
  font-size: 17px;
  color: #6c6358;
}


/* ===========================
   SMALL SCREENS
   =========================== */
@media (max-width: 720px) {
  .col {
    padding-top: 100px;
  }

  .hello {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hello-side {
    flex-direction: row;
    align-items: flex-start;
    gap: 22px;
  }

  .hello-side > * {
    flex: 1;
    max-width: 230px;
  }

  .hello-text p {
    font-size: 20px;
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  .tile-wide .tile-visual {
    aspect-ratio: auto;
    height: 440px;
  }

  .tile-wide .tile-visual img {
    display: none;
  }

  .receipt {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-2deg);
  }

  .tile-list a {
    grid-template-columns: 1fr;
    gap: 0;
    height: auto;
    padding: 6px 0;
  }

  .tile-list {
    background-image: linear-gradient(var(--red) 0 0);
    background-size: 100% 1.5px;
    background-repeat: no-repeat;
  }


  .scrawl {
    margin-top: 64px;
    font-size: 32px;
  }

  .topnav {
    gap: 14px;
    font-size: 20px;
  }

  .live-pulse {
    display: none;
  }

  .ascii-me {
    font-size: 5px;
  }

  .graph {
    padding: 14px 16px 16px;
  }

  .graph-head {
    flex-direction: column;
    gap: 6px;
  }

  .graph-title {
    white-space: nowrap;
  }

  .graph-foot {
    text-align: left;
  }

  .contrib {
    gap: 2px;
  }
}

@media (max-width: 420px) {
  .topnav a[href="patch-notes.html"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===========================
   PAPER PAGES (work + patch notes)
   =========================== */
.page {
  padding: 96px 16px 120px;
}

.doc {
  position: relative;
  color: var(--ink);
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  padding: clamp(32px, 6vw, 64px) clamp(22px, 6vw, 68px) 56px;
  box-shadow: var(--shadow);
  transform: rotate(-0.4deg);
}

.doc-file {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.doc-title {
  font-family: var(--hand);
  font-weight: 700;
  font-size: clamp(56px, 10vw, 88px);
  line-height: 1;
  color: var(--red);
  margin: 6px 0 14px;
}

.doc-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.stamp {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink-2);
  color: var(--ink-2);
  border-radius: 3px;
  padding: 2px 8px;
}

.stamp-red {
  border-color: var(--red);
  color: var(--red);
  transform: rotate(-3deg);
}

.doc-summary {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.2;
  margin-bottom: 34px;
}

.doc-print {
  position: relative;
  background: var(--paper);
  padding: 10px;
  margin: 0 -10px 40px;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.doc section {
  margin-bottom: 30px;
}

.doc h2 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 30px;
  color: var(--red);
  line-height: 1.1;
  margin-bottom: 6px;
}

.doc section p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.doc-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 40px;
}

.doc-links a {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.2s;
}

.doc-links a:hover {
  background: var(--red);
}

.doc-next {
  display: inline-block;
  font-family: var(--hand);
  font-size: 26px;
  color: var(--ink-2);
  border-top: 1.5px dashed var(--line);
  padding-top: 16px;
}

.doc-next:hover {
  color: var(--red);
}

/* writing: one long sheet of paper per article */
/* no tilt: on a page this tall it blurs the text and pushes the corners off small screens */
.article {
  max-width: 780px;
  transform: none;
}

.article-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.05;
  margin: 10px 0 12px;
  text-wrap: balance;
}

.article-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.6vw, 22px);
  color: var(--ink-2);
  margin-bottom: 18px;
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  overflow-wrap: break-word;
  border-top: 1.5px dashed var(--line);
  padding-top: 30px;
  margin-bottom: 40px;
}

.article-body > * + * {
  margin-top: 1.1em;
}

.article-body h2 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--red);
  margin-top: 1.6em;
}

.article-body h3,
.article-body h4 {
  font-weight: 600;
  font-size: 18px;
  margin-top: 1.4em;
}

.article-body a {
  color: var(--red-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 0.4em;
}

.article-body blockquote {
  border-left: 3px solid var(--red);
  padding-left: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-2);
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  border-radius: 3px;
  padding: 1px 5px;
}

.article-body pre {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}

.article-body pre code {
  font-size: inherit;
  background: none;
  padding: 0;
}

/* screenshots and diagrams sit flat so text in them stays crisp */
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow);
}

.article-body p:has(> img:only-child) {
  margin: 1.8em 0;
}

.article-body p:has(> img) + p > em:only-child {
  display: block;
  margin-top: -1em;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

.article-body hr {
  border: 0;
  border-top: 1.5px dashed var(--line);
  margin: 2em 0;
}

.article-body table {
  border-collapse: collapse;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.article-body th,
.article-body td {
  border-bottom: 1px solid var(--line);
  padding: 6px 12px 6px 0;
  text-align: left;
}

.article-origin {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 26px;
}

.article-origin a {
  text-decoration: underline;
}

.article-origin a:hover,
.article-body a:hover {
  color: var(--red);
}

/* writing index */
.writing-index {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
}

.writing-index .scrawl {
  margin-top: 30px;
  font-size: clamp(40px, 7vw, 56px);
}

.writing-intro {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--desk-ink-2);
  margin-bottom: 30px;
}

.writing-intro a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--desk-ink-3);
  text-decoration: underline;
  margin-left: 6px;
}

.posts-all {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--hand);
  font-size: 24px;
  color: var(--desk-ink-2);
}

.posts-all:hover,
.writing-intro a:hover {
  color: var(--red);
}

/* patch notes print on a receipt */
.doc-receipt {
  max-width: 460px;
  background: var(--receipt);
  font-family: var(--mono);
  font-size: 13px;
  color: #2a2724;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: rotate(0.6deg);
  --edge: 9px;
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/calc(var(--edge)*2) var(--edge) repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top/calc(var(--edge)*2) var(--edge) repeat-x,
    linear-gradient(#000 0 0) center/100% calc(100% - var(--edge)*2) no-repeat;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/calc(var(--edge)*2) var(--edge) repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top/calc(var(--edge)*2) var(--edge) repeat-x,
    linear-gradient(#000 0 0) center/100% calc(100% - var(--edge)*2) no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 10px 14px rgba(60, 40, 20, 0.2));
}

.doc-receipt .r-head {
  font-size: 26px;
}

.release {
  position: relative;
  padding: 4px 0;
}

.release-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.release-name {
  font-family: var(--hand);
  font-size: 28px;
  color: var(--red);
  line-height: 1.1;
  margin: 2px 0 6px;
}

.release ul {
  list-style: none;
  font-size: 12.5px;
  color: #4d4842;
}

.release li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 3px;
}

.release li::before {
  content: '+';
  position: absolute;
  left: 0;
}

.release a {
  display: inline-block;
  margin-top: 8px;
  color: var(--red-ink);
  border-bottom: 1px dashed currentColor;
}

.release-tag {
  position: absolute;
  top: 34px;
  right: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 3px;
  padding: 1px 6px;
  transform: rotate(-8deg);
}
