/* Claude Code Changelog: a dot-matrix release ledger on continuous tractor-feed paper.
   One sheet runs down the page: sprocket strips with perforations at both edges, green bars
   every three printed lines, Doto for what the print head stamps large, IBM Plex Mono for reading. */

@font-face {
  font-family: 'Doto';
  src: url('fonts/doto-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
/* Round dots, as a print head strikes them. */
.wordmark,
.release-title,
.stamp,
.area-head,
.page-title,
.sec-title {
  font-variation-settings: 'ROND' 100;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

:root {
  --desk: #cfccc0;
  --paper: #f8f6ee;
  --bar: #e2ecda;
  --bars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='144'%3E%3Crect width='8' height='72' fill='%23f8f6ee'/%3E%3Crect y='72' width='8' height='72' fill='%23e2ecda'/%3E%3C/svg%3E");
  --ink: #1b1f2b;
  --ink-2: #4b5161;
  --ribbon: #b3301c;
  --ribbon-ink: #fff;
  --hole: #cfccc0;
  --perf: #b9b5a6;
  --hover: rgba(27, 31, 43, 0.06);
  --dot: 'Doto', 'IBM Plex Mono', ui-monospace, monospace;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --line: 1.5rem; /* one printed line: everything steps in these */
  --strip: 44px;
  --gutter: clamp(16px, 3vw, 40px);
  --t-huge: clamp(4.25rem, 2rem + 11vw, 11rem);
  --t-big: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);
  --t-mid: 1.375rem;
  --t-body: 1rem;
  --t-small: 0.875rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --desk: #0b0c0c;
    --paper: #171918;
    --bar: #1d2520;
    --bars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='144'%3E%3Crect width='8' height='72' fill='%23171918'/%3E%3Crect y='72' width='8' height='72' fill='%231d2520'/%3E%3C/svg%3E");
    --ink: #e6e2d3;
    --ink-2: #aaa797;
    --ribbon: #ff7b5f;
    --ribbon-ink: #171918;
    --hole: #0b0c0c;
    --perf: #3a3d39;
    --hover: rgba(230, 226, 211, 0.07);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --desk: #0b0c0c;
  --paper: #171918;
  --bar: #1d2520;
  --bars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='144'%3E%3Crect width='8' height='72' fill='%23171918'/%3E%3Crect y='72' width='8' height='72' fill='%231d2520'/%3E%3C/svg%3E");
  --ink: #e6e2d3;
  --ink-2: #aaa797;
  --ribbon: #ff7b5f;
  --ribbon-ink: #171918;
  --hole: #0b0c0c;
  --perf: #3a3d39;
  --hover: rgba(230, 226, 211, 0.07);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--t-body);
  line-height: var(--line);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color 160ms var(--ease), color 160ms var(--ease);
}
a:hover {
  color: var(--ribbon);
  text-decoration-color: var(--ribbon);
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--ribbon);
  outline-offset: 2px;
}
code {
  font-family: var(--mono);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
}
.skip:focus {
  top: 8px;
}

/* The sheet ----------------------------------------------------------------------------- */
.paper {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 calc(var(--strip) + var(--gutter)) var(--line);
  /* Green bars: three printed lines plain, three green, as on fan-fold computer paper.
     A tiny flat two-band tile repeated down the sheet (72px = three 24px lines). */
  background-color: var(--paper);
  background-image: var(--bars);
  background-size: 8px calc(var(--line) * 6);
  background-position: 0 calc(var(--line) * 2);
}
.paper-wide {
  max-width: 1320px;
}
/* Sprocket strips with their holes, torn along a perforation. */
.paper::before,
.paper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--strip);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 50% 50%, var(--hole) 0 6px, transparent 6.5px);
  background-size: var(--strip) var(--line);
  background-size: var(--strip) calc(var(--line) * 1);
  pointer-events: none;
}
.paper::before {
  left: 0;
  border-right: 2px dotted var(--perf);
}
.paper::after {
  right: 0;
  border-left: 2px dotted var(--perf);
}

/* Masthead -------------------------------------------------------------------------------- */
.masthead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: var(--line) 0 calc(var(--line) / 2);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--dot);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.01em;
}
.wordmark b {
  color: var(--ribbon);
  font-weight: 900;
}
.wordmark:hover {
  color: inherit;
}
.mark {
  width: 34px;
  height: 34px;
  flex: none;
}
.mk-sheet {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2;
}
.mk-holes {
  fill: var(--ink);
}
.mk-lines path {
  stroke: var(--ribbon);
  stroke-width: 2;
}
.masthead nav {
  margin-left: auto;
}
.masthead ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.masthead nav a {
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 3px solid transparent;
}
.masthead nav a:hover {
  border-bottom-color: var(--ribbon);
}
.masthead nav a[aria-current='page'] {
  font-weight: 600;
  border-bottom-color: var(--ink);
}
.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms var(--ease);
}
.theme-toggle:hover {
  transform: rotate(180deg);
}
.theme-toggle:active {
  transform: rotate(180deg) scale(0.92);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.theme-toggle .half {
  fill: currentColor;
}
.unofficial {
  margin: 0 0 var(--line);
  font-size: var(--t-small);
  color: var(--ink-2);
}

/* Release (the top of the home page and every version page) -------------------------------- */
.release-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0 32px;
  padding-top: var(--line);
}
.release-title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-family: var(--dot);
  font-weight: 800;
  line-height: 0.9;
}
.rt-name {
  display: block;
  font-size: var(--t-big);
  letter-spacing: -0.01em;
}
.rt-ver {
  display: block;
  font-size: var(--t-huge);
  letter-spacing: -0.03em;
  font-weight: 900;
  margin-top: 0.08em;
}
.stamp {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  margin-bottom: 1.5rem;
  display: inline-grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 16px;
  border: 3px double var(--ribbon);
  color: var(--ribbon);
  font-family: var(--dot);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.1;
  transform: rotate(-5deg);
}
.stamp-label {
  font-size: 1.5rem;
}
.release-sum {
  margin: var(--line) 0 0;
  font-size: var(--t-mid);
  line-height: calc(var(--line) * 1.5);
  font-weight: 600;
  max-width: 44ch;
}
.release-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: calc(var(--line) / 2) 0 0;
}

/* Area tally: one dot per note, the dot matrix doing the chart. */
.strip {
  margin: calc(var(--line) * 2) 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0 48px;
}
.strip-row {
  display: grid;
  grid-template-columns: 21ch 1fr;
  gap: 12px;
  align-items: baseline;
}
.strip dt,
.strip dd {
  margin: 0;
}
.strip dt a {
  text-decoration: none;
}
.strip dt a:hover {
  text-decoration: underline;
}
.strip dd {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}
.tally {
  color: var(--ribbon);
  letter-spacing: 0.12em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  min-width: 0;
}
.strip-n {
  font-weight: 600;
  margin-left: auto;
}

/* An area: a printed header line with leader dots, then numbered-free notes. */
.area {
  margin: 0 0 calc(var(--line) * 2);
  scroll-margin-top: var(--line);
}
.area-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 calc(var(--line) / 2);
  font-family: var(--dot);
  font-weight: 900;
  font-size: 1.75rem;
  line-height: calc(var(--line) * 1.5);
}
.area-fill {
  flex: 1;
  border-bottom: 3px dotted currentColor;
  opacity: 0.35;
  transform: translateY(-6px);
}
.area-count {
  color: var(--ribbon);
}
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.note {
  display: grid;
  grid-template-columns: 5ch 1fr auto;
  gap: 0 16px;
  padding: 0 8px;
  margin: 0 -8px;
  transition: background-color 120ms var(--ease);
}
.note:hover {
  background: var(--hover);
}
.note-kind {
  font-weight: 600;
  color: var(--ink-2);
}
.note-text {
  max-width: 88ch;
  min-width: 0;
  overflow-wrap: anywhere;
}
.note-ver {
  font-weight: 600;
  white-space: nowrap;
}
.k-added .note-kind,
.note-kind.k-added {
  color: var(--ribbon);
}
.k-removed .note-kind,
.note-kind.k-removed {
  color: var(--ribbon);
  text-decoration: line-through;
}
.k-fixed .note-kind,
.note-kind.k-fixed {
  color: var(--ink);
}

/* Sections and page heads -------------------------------------------------------------------- */
.page-head {
  padding: var(--line) 0 0;
  margin-bottom: calc(var(--line) * 2);
}
.page-title {
  margin: 0;
  font-family: var(--dot);
  font-weight: 900;
  font-size: var(--t-big);
  line-height: 1;
  letter-spacing: -0.02em;
}
.page-lede,
.sec-lede {
  margin: var(--line) 0 0;
  max-width: 70ch;
}
.page-lede {
  font-size: 1.125rem;
  line-height: calc(var(--line) * 1.25);
}
.sec-title {
  margin: calc(var(--line) * 3) 0 0;
  font-family: var(--dot);
  font-weight: 900;
  font-size: 2.5rem;
  line-height: calc(var(--line) * 2);
}
.sec-lede {
  margin-bottom: var(--line);
}
.prose p {
  max-width: 72ch;
  margin: 0 0 var(--line);
}

/* The ledger table ----------------------------------------------------------------------------- */
.ledger-wrap {
  overflow-x: auto;
  margin: 0 0 var(--line);
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.ledger caption {
  text-align: left;
  color: var(--ink-2);
  font-size: var(--t-small);
  padding-bottom: calc(var(--line) / 2);
}
.ledger th,
.ledger td {
  text-align: left;
  vertical-align: top;
  padding: 0 16px 0 0;
  line-height: var(--line);
}
.ledger thead th {
  font-weight: 600;
  border-bottom: 3px double var(--ink);
  padding-bottom: 4px;
}
.ledger thead abbr {
  text-decoration: none;
  cursor: help;
}
.ledger tbody th {
  font-weight: 600;
}
.ledger tbody th a {
  text-decoration: none;
}
.ledger tbody tr {
  transition: background-color 120ms var(--ease);
}
.ledger tbody tr:hover {
  background: var(--hover);
}
.ledger tbody tr:hover th a {
  color: var(--ribbon);
  text-decoration: underline;
}
.ledger .num {
  text-align: right;
}
.ledger .date {
  white-space: nowrap;
}
.ledger .nil {
  color: var(--ink-2);
}
.ledger .areas-col {
  color: var(--ink-2);
}
.ledger.rules td:nth-child(3) {
  max-width: 60ch;
}
.pct {
  color: var(--ink-2);
}
tr[hidden] {
  display: none;
}

/* Buttons ---------------------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: 600 1rem/1 var(--mono);
  padding: 12px 20px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms var(--ease), background-color 120ms var(--ease), border-color 120ms var(--ease);
}
.btn:hover {
  background: var(--ribbon);
  border-color: var(--ribbon);
  color: var(--ribbon-ink);
}
.btn:active {
  transform: translateY(2px);
}
.btn-quiet {
  background: transparent;
  color: var(--ink);
}
.more {
  margin: var(--line) 0;
}

/* The finder on "All versions" ------------------------------------------------------------------ */
.finder {
  margin: 0 0 calc(var(--line) * 2);
}
.finder-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.finder-row {
  display: flex;
  gap: 12px;
  max-width: 760px;
}
.finder input {
  flex: 1;
  min-width: 0;
  font: 1.125rem/1.4 var(--mono);
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}
.finder input:focus-visible {
  outline-offset: 0;
}
.chips {
  border: 0;
  margin: var(--line) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 8px;
}
.chip {
  font: 0.9375rem/1 var(--mono);
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 120ms var(--ease), color 120ms var(--ease), transform 120ms var(--ease);
}
.chip:hover {
  border-color: var(--ribbon);
}
.chip:active {
  transform: translateY(2px);
}
.chip[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.chip-n {
  color: var(--ink-2);
}
.chip[aria-pressed='true'] .chip-n {
  color: inherit;
  opacity: 0.75;
}
.finder-status {
  margin: var(--line) 0 0;
  font-weight: 600;
}
.results {
  margin: 0 0 calc(var(--line) * 2);
}
.notes-results .note {
  grid-template-columns: 5ch 1fr 9ch;
}
.notes-results mark {
  background: var(--ribbon);
  color: var(--ribbon-ink);
}

/* Weeks, pager ------------------------------------------------------------------------------------ */
.weeklist {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2 340px;
  column-gap: 40px;
}
.weeklist a {
  display: grid;
  grid-template-columns: 9ch 1fr;
  gap: 0 12px;
  text-decoration: none;
  padding: 0 6px;
  break-inside: avoid;
}
.weeklist a:hover {
  background: var(--hover);
}
.wl-week {
  font-weight: 600;
}
.wl-n {
  grid-column: 2;
  color: var(--ink-2);
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: calc(var(--line) * 2) 0;
  padding-top: var(--line);
  border-top: 3px double var(--ink);
}
.pager a {
  font-weight: 600;
}
.pager a span {
  font-weight: 400;
  color: var(--ink-2);
}

/* Colophon: the sheet is torn off along a perforation ---------------------------------------------- */
.colophon {
  margin-top: calc(var(--line) * 3);
}
.tear {
  margin: 0 0 var(--line);
  border-top: 3px dashed var(--perf);
}
.colophon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--line) 40px;
  font-size: var(--t-small);
  line-height: 1.375rem;
}
.colophon-grid p {
  margin: 0;
}

/* Motion: the sheet feeds up in line steps, notes print one line at a time, the stamp lands. ---- */
@media (prefers-reduced-motion: no-preference) {
  .release-title,
  .page-title {
    animation: feed 520ms steps(6, end) both;
  }
  .stamp {
    animation: stamp 420ms var(--ease) 360ms both;
  }
  .release .note,
  .digest .note,
  .strip-row {
    animation: print 90ms steps(2, end) both;
  }
  .notes-results .note {
    animation: print 90ms steps(2, end) both;
  }
}
@keyframes feed {
  from {
    transform: translateY(var(--line));
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes print {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes stamp {
  from {
    transform: rotate(-5deg) scale(1.6);
    opacity: 0;
  }
  70% {
    transform: rotate(-5deg) scale(0.96);
    opacity: 1;
  }
  to {
    transform: rotate(-5deg) scale(1);
    opacity: 1;
  }
}

/* Narrow sheets ---------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root {
    --strip: 22px;
  }
  .paper::before,
  .paper::after {
    background-image: radial-gradient(circle at 50% 50%, var(--hole) 0 4px, transparent 4.5px);
  }
  .masthead nav {
    margin-left: 0;
    width: 100%;
    order: 3;
  }
  .masthead .wordmark {
    flex: 1 1 0;
    min-width: 0;
  }
  .release-head {
    grid-template-columns: 1fr;
  }
  .stamp {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: var(--line);
  }
  .note {
    grid-template-columns: 4.5ch 1fr;
    gap: 0 10px;
  }
  .note-ver {
    grid-column: 2;
  }
  .notes-results .note {
    grid-template-columns: 4.5ch 1fr;
  }
  .k-col {
    display: none;
  }
  .ledger .areas-col {
    display: none;
  }
  .area-head {
    font-size: 1.375rem;
  }
  .sec-title {
    font-size: 1.875rem;
  }
  .strip {
    grid-template-columns: 1fr;
  }
  .strip-row {
    grid-template-columns: 20ch 1fr;
    font-size: var(--t-small);
  }
}
