:root {
  --article-border: #365043;
  --article-inset-bg: #213b30;
  --commit-bg: #203a30;
  --commit-border: #557457;
  --commit-divider: #48644e;
  --commit-inner-border: #3d5b49;
  --commit-muted: #b5c7bb;
  --commit-seal-border: #718962;
  --commit-text: #e8efe6;
  --contents-border: #43604c;
  --lede-text: #e0eadf;
  --quote-border: #7f9e64;
  --reading-bg: #172d25;
  --widget-muted: #b0c2b5;
}

html[data-season='spring'] {
  --article-border: #434b3b;
  --article-inset-bg: #2e3626;
  --commit-bg: #2d3525;
  --commit-border: #656e5b;
  --commit-divider: #565e4e;
  --commit-inner-border: #4c5543;
  --commit-muted: #c7c4b5;
  --commit-seal-border: #76816a;
  --commit-text: #efeee6;
  --contents-border: #525a49;
  --lede-text: #eae8df;
  --quote-border: #9e9564;
  --reading-bg: #333c29;
  --widget-muted: #c2bfb0;
}

html[data-season='fall'] {
  --article-border: #4c423a;
  --article-inset-bg: #372d25;
  --commit-bg: #362c24;
  --commit-border: #6f645a;
  --commit-divider: #5f554d;
  --commit-inner-border: #564b42;
  --commit-muted: #c7c0b5;
  --commit-seal-border: #827569;
  --commit-text: #efebe6;
  --contents-border: #5b5148;
  --lede-text: #eae6df;
  --quote-border: #9e8764;
  --reading-bg: #30271f;
  --widget-muted: #c2bbb0;
}

html[data-season='winter'] {
  --article-border: #37474f;
  --article-inset-bg: #22323a;
  --commit-bg: #213139;
  --commit-border: #566973;
  --commit-divider: #495a63;
  --commit-inner-border: #3e515a;
  --commit-muted: #b5c3c7;
  --commit-seal-border: #647b87;
  --commit-text: #e6edef;
  --contents-border: #44565f;
  --lede-text: #dfe8ea;
  --quote-border: #64929e;
  --reading-bg: #1d2d35;
  --widget-muted: #b0bec2;
}

html[data-season='december'] {
  --article-border: #4d393c;
  --article-inset-bg: #382427;
  --commit-bg: #372326;
  --commit-border: #70595d;
  --commit-divider: #614b4f;
  --commit-inner-border: #584044;
  --commit-muted: #c7c2b5;
  --commit-seal-border: #85666b;
  --commit-text: #efece6;
  --contents-border: #5d464a;
  --lede-text: #eae7df;
  --quote-border: #9e8c64;
  --reading-bg: #3c2428;
  --widget-muted: #c2bdb0;
}

.article {
  padding-bottom: 36px;
}

.article-copy {
  overflow-wrap: anywhere;
}

.article-copy p {
  margin: 0 0 22px;
}

.article-copy a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.article-copy a:hover {
  color: var(--text);
}

.article-copy a:focus-visible {
  outline-offset: 3px;
}

.article-copy img {
  height: auto;
}

.article-copy code {
  padding: .15em .35em;
  background: var(--article-inset-bg);
  border-radius: 4px;
  font-size: .85em;
}

.article-copy pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 22px;
  padding: 20px;
  background: var(--article-inset-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.6;
}

.article-copy pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

.article-copy table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 22px;
  border-collapse: collapse;
  font-size: .9em;
}

.article-copy th, .article-copy td {
  padding: 8px 12px;
  border: 1px solid var(--article-border);
}

.article-copy th {
  background: var(--article-inset-bg);
}

.article-copy blockquote {
  margin: 0 0 22px;
  padding: 12px 20px;
  background: var(--article-inset-bg);
  border-left: 2px solid var(--quote-border);
}

.article-copy blockquote > :last-child {
  margin-bottom: 0;
}

.article-copy hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article-frame.without-contents {
  display: block;
}

.article-frame.without-contents .reading-card {
  max-width: 948px;
}

.article-lede {
  margin-bottom: 48px !important;
}

.article-copy :is(h2, h3)[id], .commit-widget {
  scroll-margin-top: 30px;
}

.article-copy :is(h1, h2, h3, h4, h5, h6) {
  margin: 30px 0 18px;
  color: var(--text);
  line-height: 1.4;
}

.article-copy :is(h1, h2) {
  line-height: 1.25;
  letter-spacing: -.65px;
}

.article-copy :is(h3, h4, h5, h6) {
  color: var(--accent);
}

.article-copy :is(ul, ol) {
  padding-left: 24px;
  margin: 0 0 26px;
}

.article-copy li {
  padding-left: 6px;
  margin-bottom: 16px;
}

.article-copy li > :is(ul, ol) {
  margin: 12px 0 0;
}

.article-copy li::marker {
  color: var(--accent);
}

.article-frame {
  width: min(1160px, calc(100% - 64px));
  max-width: 1160px;
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 32px;
  align-items: start;
}

.reading-card {
  grid-column: 1;
  grid-row: 1;
  padding: 44px;
  min-width: 0;
  background: var(--reading-bg);
  border: 1px solid var(--article-border);
  border-radius: 13px;
}

.article-index {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  min-width: 0;
  padding-right: 24px;
}

.contents {
  color: var(--muted);
  font-size: 14px;
}

.article-index .contents {
  max-width: 170px;
}

.article-index .contents details {
  border: 0;
}

.article-index .contents summary {
  cursor: pointer;
  color: var(--accent);
  padding: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
}

.article-index .contents ol {
  display: grid;
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 1px;
}

.article-index .contents li {
  padding: 0;
}

.article-index .contents a {
  display: block;
  padding: 7px 0 7px 11px;
  border-left: 1px solid var(--contents-border);
  font-size: 12px;
  line-height: 1.55;
}

.article-index .contents a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reading-card .article-copy {
  max-width: 760px;
  margin-inline: auto;
  font-size: 18px;
  line-height: 1.85;
}

.reading-card .article-lede {
  font-size: 21px;
  line-height: 1.7;
  color: var(--lede-text);
}

.reading-card .article-section {
  border-top: 1px solid var(--article-border);
  padding-top: 30px;
  margin-top: 35px;
}

.reading-card .article-copy :is(h1, h2) {
  font-size: 28px;
  margin: 0 0 22px;
}

.reading-card .article-copy h3 {
  font-size: 19px;
}

.reading-card .article-copy :is(h4, h5, h6) {
  font-size: 18px;
}

.editorial-heading {
  width: min(960px, calc(100% - 64px));
  margin: 24px auto;
  text-align: center;
}

.editorial-heading h1 {
  margin: 12px 0 18px;
  font-size: clamp(38px, 4.25vw, 58px);
  line-height: 1.1;
  letter-spacing: -1.8px;
  text-wrap: balance;
}

.editorial-heading .post-meta {
  justify-content: center;
}

.editorial-photo {
  width: min(1160px, calc(100% - 64px));
  height: 300px;
  margin-inline: auto;
}

.editorial-photo .article-photo {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.editorial-photo img {
  object-position: center 62%;
}

.post-extras {
  width: min(1160px, calc(100% - 64px));
  margin: 24px auto 0;
}

.extras-column {
  width: calc(100% - 212px);
  display: grid;
  gap: 24px;
}

.post-extras :is(.commit-widget, .author-card, .topic-section) {
  max-width: none;
  margin: 0;
  padding: 30px;
  background: var(--reading-bg);
  border: 1px solid var(--article-border);
  border-radius: 13px;
}

.widget-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.widget-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.4px;
}

.widget-heading > span {
  font-size: 12px;
  color: var(--widget-muted);
}

.commit-preview {
  display: block;
  width: min(100%, 720px);
  margin-inline: auto;
  border-radius: 9px;
}

.commit-preview:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
}

.commit-action {
  display: block;
  margin-top: 17px;
  font-size: 13px;
  color: var(--accent);
  text-align: center;
}

.commit-card {
  background: var(--commit-bg);
  border: 1px solid var(--commit-border);
  border-radius: 8px;
  padding: 22px;
  color: var(--commit-text);
  text-align: center;
  box-shadow: inset 0 0 0 5px var(--commit-bg), inset 0 0 0 6px var(--commit-inner-border);
}

.commit-card p, .commit-card h3 {
  margin: 0;
}

.commit-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.commit-identity::before, .commit-identity::after {
  content: "";
  flex: 1;
  max-width: 76px;
  height: 1px;
  background: var(--commit-border);
}

.commit-seal {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border: 1px solid var(--commit-seal-border);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--reading-bg);
}

.commit-avatar {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

.commit-repo {
  font-size: 12px;
  color: var(--commit-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  font-weight: 650;
  letter-spacing: .025em;
}

.commit-card .commit-title {
  margin-top: 15px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.commit-card .commit-changes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--commit-muted);
}

.commit-additions {
  color: #a9d795;
}

.commit-deletions {
  color: #efa9a2;
}

.commit-byline {
  font-size: 12px;
  line-height: 1.5;
  color: var(--commit-muted);
}

.commit-byline strong {
  color: var(--commit-text);
}

.commit-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 24px;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--commit-divider);
}

.commit-revision-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.commit-revision-group svg {
  width: 17px;
  height: 17px;
  color: var(--commit-muted);
}

.commit-revision {
  font: 12px/1.5 ui-monospace, monospace;
  color: var(--commit-muted);
  white-space: nowrap;
}

.post-extras .author-card {
  padding: 18px 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.post-extras .author-card > img {
  width: 64px;
  height: 64px;
}

.post-extras .author-details {
  min-width: 220px;
}

.post-extras .author-links {
  width: 100%;
  padding: 0;
  border: 0;
  flex-direction: row;
  justify-content: flex-start;
  gap: 24px;
}

.post-extras .topic-section h2 {
  font-size: 21px;
}

@media (max-width: 1200px) {
  .article-frame {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .article-index {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .article-index .contents {
    max-width: none;
  }

  .article-index .contents details {
    border-block: 1px solid var(--line);
  }

  .article-index .contents summary {
    padding-block: 16px;
  }

  .article-index .contents ol {
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
    padding-bottom: 15px;
  }

  .reading-card, .extras-column {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .editorial-photo {
    height: 270px;
  }

  .article-frame {
    margin-top: 30px;
  }
}

@media (max-width: 800px) {
  .editorial-photo, .article-frame, .post-extras {
    width: calc(100% - 48px);
  }

  .reading-card {
    padding: 32px;
  }
}

@media (max-width: 600px) {
  .editorial-heading {
    width: calc(100% - 40px);
    margin-block: 16px 20px;
  }

  .editorial-heading h1 {
    margin-block: 8px 16px;
    font-size: 35px;
    line-height: 1.13;
    letter-spacing: -1px;
  }

  .editorial-photo {
    height: 220px;
  }

  .editorial-photo .article-photo {
    border-radius: 9px;
  }

  .article-frame {
    margin-top: 24px;
  }

  .commit-card {
    padding: 16px;
  }

  .commit-identity {
    gap: 10px;
  }

  .commit-identity::before, .commit-identity::after {
    display: none;
  }

  .commit-card .commit-title {
    margin-top: 12px;
    font-size: 25px;
  }

  .commit-card .commit-changes {
    gap: 4px 14px;
    margin-top: 12px;
  }

  .commit-meta {
    gap: 6px;
    margin-top: 13px;
    padding-top: 11px;
  }

  .commit-meta .commit-byline {
    flex-basis: 100%;
  }
}

@media (max-width: 540px) {
  .editorial-photo, .article-frame, .post-extras {
    width: calc(100% - 32px);
  }

  .reading-card {
    padding: 22px;
    border-radius: 10px;
  }

  .reading-card .article-copy {
    font-size: 17px;
  }

  .reading-card .article-lede {
    font-size: 19px;
  }

  .reading-card .article-copy :is(h1, h2) {
    font-size: 25px;
  }

  .article-copy li {
    padding-left: 2px;
  }

  .article-index .contents ol {
    grid-template-columns: 1fr;
  }

  .post-extras {
    margin-top: 18px;
  }

  .extras-column {
    gap: 18px;
  }

  .post-extras :is(.commit-widget, .author-card, .topic-section) {
    padding: 22px;
    border-radius: 10px;
  }

  .post-extras .author-details {
    min-width: 140px;
  }

  .post-extras .author-card {
    padding: 18px;
  }

  .post-extras .author-card > img {
    width: 56px;
    height: 56px;
  }

  .post-extras .author-links {
    flex-wrap: wrap;
    gap: 8px 20px;
  }

  .widget-heading {
    margin-bottom: 18px;
  }
}
