* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --row: 28px;
  --baseline: 20px;
}

html {
  font-size: 17px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-weight: 430;
  color: #23200a;
  background-color: #f2e264;
  background-image:
    linear-gradient(rgba(70, 60, 10, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 60, 10, 0.10) 1px, transparent 1px);
  background-size: var(--row) var(--row);
  /* Percentage positions resolve against area minus tile, hence the 6px offset. */
  background-position: calc(50% + 6px) var(--baseline);
  line-height: var(--row);
}

.wrapper {
  max-width: 1136px;
  margin: 0 auto;
  padding: 84px 56px 112px;
  display: grid;
  grid-template-columns: 224px 1fr;
  gap: 84px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 84px;
}

.sidebar h1 {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: var(--row);
  margin-top: -3px;
}

.sidebar .home {
  display: inline-block;
  margin-top: var(--row);
  font-size: 0.95rem;
  color: #5c4a08;
  text-decoration: none;
  border-bottom: 1px solid rgba(92, 74, 8, 0.35);
}

.sidebar .home:hover { border-bottom-color: #5c4a08; }

.content {
  max-width: 672px;
  min-width: 0;
}
.content p { margin-bottom: var(--row); }

.content a {
  color: #5c4a08;
  text-decoration: none;
  border-bottom: 1px solid rgba(92, 74, 8, 0.35);
  transition: border-color 0.15s ease;
}

.content a:hover { border-bottom-color: #5c4a08; }

a:focus-visible {
  outline: 2px solid #23200a;
  outline-offset: 3px;
}

.contact { color: #4a4413; }

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.contact code { font-size: 0.92em; }

.title,
.article .content > h1:first-child {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: calc(var(--row) * 2);
  position: relative;
  top: 7px;
  margin-bottom: 0;
}

.byline {
  color: #605a1c;
  font-size: 0.95rem;
  margin-bottom: var(--row);
}

.lede,
.article .content > blockquote:first-of-type {
  font-size: 1.02rem;
  color: #4a4413;
  border-left: 2px solid rgba(92, 74, 8, 0.35);
  padding-left: 26px;
  margin-bottom: calc(var(--row) * 2);
}

.article .content > blockquote:first-of-type {
  margin-top: var(--row);
}

.article .content > blockquote:first-of-type p { margin-bottom: 0; }

.content h2:not(.title) {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: var(--row);
  margin: calc(var(--row) * 2) 0 0;
  position: relative;
  top: -2px;
}

.article .content h2 { margin-bottom: var(--row); }

.article .content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: var(--row);
  margin: var(--row) 0;
}

.len {
  font-size: 0.8rem;
  color: #6b6428;
  margin-bottom: 0;
}

.blurb,
.bitter-lesson .slide {
  border-left: 3px solid #5c4a08;
  background: #f7eda2;
  padding: 14px 28px;
  border-radius: 0 4px 4px 0;
}

.blurb { margin-bottom: var(--row); }

.blurb p { margin: 0 0 var(--row); }
.blurb p:last-child { margin-bottom: 0; }

dl { margin: 0 0 var(--row); }

dt {
  font-size: 0.8rem;
  color: #6b6428;
  margin-top: var(--row);
}

dt:first-of-type { margin-top: 0; }
dd { margin: 0; }

hr {
  border: none;
  border-top: 1px solid rgba(92, 74, 8, 0.28);
  margin: 55px 0 56px;
}

.article .footnotes {
  border-top: 1px solid rgba(92, 74, 8, 0.28);
  margin-top: 55px;
  padding-top: 28px;
  font-size: 0.82rem;
  color: #4a4413;
  overflow-wrap: anywhere;
}

.article .footnotes hr { display: none; }
.article .footnotes ol { padding-left: var(--row); }
.article .footnotes li { margin-bottom: var(--row); }
.article .footnotes li p { margin-bottom: 0; }

.article .footnote-ref,
.article .footnote-back {
  border-bottom: 0;
  font-size: 0.8em;
}

/* Bitter Lesson keeps the talk's compressed slide / disclosed notes structure. */
.bitter-lesson .content > h1:first-child del {
  color: #6b6428;
  text-decoration-color: #5c4a08;
}

.bitter-lesson .slide {
  overflow-x: auto;
}

.bitter-lesson .slide > * { margin: 0 0 var(--row); }
.bitter-lesson .slide > :last-child { margin-bottom: 0; }

.bitter-lesson .slide ul { padding-left: var(--row); }

.bitter-lesson code { font-size: 0.88em; }

.bitter-lesson pre {
  color: #4a4413;
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bitter-lesson pre code { font-size: inherit; }

.bitter-lesson .slide blockquote {
  border-left: 2px solid rgba(92, 74, 8, 0.35);
  padding-left: 26px;
  color: #4a4413;
  font-style: italic;
}

.bitter-lesson .slide blockquote p { margin-bottom: 0; }

.bitter-lesson .slide blockquote cite {
  display: block;
  color: #6b6428;
  font-size: 0.85rem;
  font-style: normal;
}

.bitter-lesson table {
  border-collapse: collapse;
  width: 100%;
  min-width: 616px;
  font-size: 0.82rem;
}

.bitter-lesson th,
.bitter-lesson td {
  text-align: left;
  padding: 0 14px;
  border-bottom: 1px solid rgba(92, 74, 8, 0.28);
  line-height: var(--row);
}

.bitter-lesson .plus {
  color: #5c4a08;
  font-weight: 700;
}

.bitter-lesson .caption {
  color: #6b6428;
  font-size: 0.8rem;
}

.bitter-lesson .slide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.bitter-lesson details { margin-bottom: var(--row); }

/* The error code exists only as a half-cell slip in the page grid. */
.not-found .wrapper {
  min-height: 100vh;
  align-content: start;
}

.not-found .error-code {
  color: rgba(70, 60, 10, 0.10);
  font-size: clamp(9rem, 18vw, 15rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.08em;
  line-height: 0.85;
  margin: -5px 0 var(--row);
  user-select: none;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .not-found .error-code {
    color: transparent;
    background-color: #f2e264;
    background-image:
      linear-gradient(rgba(70, 60, 10, 0.10) 1px, transparent 1px),
      linear-gradient(90deg, rgba(70, 60, 10, 0.10) 1px, transparent 1px);
    background-size: var(--row) var(--row);
    background-position: calc(50% + 20px) calc(var(--baseline) + 14px);
    background-attachment: fixed;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

::selection { background: #23200a; color: #f2e264; }

/* Anchored to .content by daymark.js so it shares the grid's subpixel phase. */
.daymark {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(70, 60, 10, 0.10);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 6s linear;
}

@media (prefers-reduced-motion: reduce) {
  .daymark { transition: none; }
}

@media print {
  .daymark { display: none; }
}

@media (max-width: 768px) {
  body { background-position: 0 var(--baseline); }

  .wrapper {
    grid-template-columns: 1fr;
    gap: var(--row);
    padding: 56px 28px 84px;
  }

  .sidebar { position: static; }
  .sidebar h1 { margin-top: -2px; }
  .landing .sidebar h1 { font-size: 1.5rem; }

  .title,
  .article .content > h1:first-child {
    font-size: 1.7rem;
    top: 3px;
  }

  .not-found .error-code {
    font-size: clamp(9rem, 40vw, 12rem);
    background-position: 14px calc(var(--baseline) + 14px);
    margin-top: -8px;
  }
}
