:root {
  --gh-canvas: #ffffff;
  --gh-canvas-subtle: #f6f8fa;
  --gh-border: #d0d7de;
  --gh-border-muted: #d8dee4;
  --gh-fg: #24292f;
  --gh-muted: #57606a;
  --gh-accent: #0969da;
  --gh-success: #1a7f37;
  --gh-button: #f6f8fa;
  --gh-button-hover: #f3f4f6;
  --gh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gh-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

html {
  background: var(--gh-canvas);
}

body {
  background: var(--gh-canvas);
  color: var(--gh-fg);
  font-family: var(--gh-font);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--gh-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.masthead {
  background: var(--gh-canvas-subtle);
  border-bottom: 1px solid var(--gh-border);
}

.masthead__inner-wrap {
  max-width: 1280px;
  padding: 16px 24px;
}

.greedy-nav {
  background: transparent;
}

.greedy-nav .site-title,
.greedy-nav a {
  color: var(--gh-fg);
}

.greedy-nav .site-title {
  font-weight: 600;
}

.greedy-nav .visible-links a::before {
  display: none;
}

.greedy-nav .visible-links a {
  border-radius: 6px;
  color: var(--gh-fg);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 8px;
}

.greedy-nav .visible-links a:hover {
  background: rgba(208, 215, 222, 0.32);
  color: var(--gh-fg);
  text-decoration: none;
}

.page,
.archive {
  color: var(--gh-fg);
}

.page__inner-wrap,
.archive {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
  padding: 24px;
}

.archive {
  margin-top: 24px;
}

.archive__item {
  border-bottom: 1px solid var(--gh-border-muted);
  padding: 16px 0;
}

.archive__item--has-teaser {
  align-items: flex-start;
  display: grid;
  gap: 14px;
  grid-template-columns: 128px minmax(0, 1fr);
}

.archive__item-teaser-link {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  display: block;
  overflow: hidden;
}

.archive__item-teaser-link:hover {
  border-color: #54aeff;
}

.archive__item-teaser-image {
  aspect-ratio: 16 / 10;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.archive__item-body {
  min-width: 0;
}

.archive__item:last-child {
  border-bottom: 0;
}

.archive__item-title,
.page__title {
  color: var(--gh-fg);
  font-weight: 600;
  letter-spacing: 0;
}

.archive__item-title {
  font-size: 20px;
  margin-bottom: 6px;
}

.page__title {
  border-bottom: 1px solid var(--gh-border-muted);
  font-size: 32px;
  margin-bottom: 8px;
  padding-bottom: 10px;
}

.page-header--image {
  margin: -24px -24px 0;
}

.page-header__hero {
  align-items: flex-end;
  aspect-ratio: 16 / 7;
  background-position: center 38%;
  background-size: cover;
  border-bottom: 1px solid var(--gh-border);
  border-radius: 6px 6px 0 0;
  display: flex;
  max-height: 340px;
  min-height: 220px;
  overflow: hidden;
  position: relative;
}

.page-header__hero::before {
  background: linear-gradient(180deg, rgba(36, 41, 47, 0.08), rgba(36, 41, 47, 0.78));
  content: "";
  inset: 0;
  position: absolute;
}

.page-header__overlay {
  color: #ffffff;
  padding: 28px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.page-header__overlay .page__title {
  border-bottom: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 10px;
  max-width: 760px;
  padding: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.page-header__overlay .page__title a {
  color: #ffffff;
}

.page-header__overlay .page__meta {
  margin: 0;
}

.page-header__overlay .page__meta-date,
.page-header__overlay .page__meta-readtime {
  background: rgba(246, 248, 250, 0.92);
  border-color: rgba(208, 215, 222, 0.85);
  color: var(--gh-fg);
}

.page-header--image .post-taxonomy {
  margin: 0;
  padding: 14px 24px;
}

.archive__subtitle,
.page__meta,
.archive__item-excerpt,
.page__lead,
.taxonomy__section-count {
  color: var(--gh-muted);
}

.page__inner-wrap > header .page__meta,
.archive__item .page__meta {
  align-items: center;
  color: var(--gh-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.62rem;
  gap: 6px;
  line-height: 1.25;
  margin: 0 0 8px;
}

.page__inner-wrap > header .page__meta-date,
.page__inner-wrap > header .page__meta-readtime,
.archive__item .page__meta-date,
.archive__item .page__meta-readtime {
  align-items: center;
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  padding: 2px 6px;
}

.page__inner-wrap > header .page__meta i,
.archive__item .page__meta i {
  color: var(--gh-muted);
  font-size: 0.58rem;
}

.page__inner-wrap > header .page__meta-sep,
.archive__item .page__meta-sep {
  display: none;
}

.page__inner-wrap > footer.page__meta .page__date {
  display: none;
}

.post-taxonomy {
  align-items: center;
  border-bottom: 1px solid var(--gh-border-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
  padding: 2px 0 14px;
}

.post-taxonomy__label {
  color: var(--gh-muted);
  font-size: 0.62rem;
  font-weight: 600;
  margin-right: 1px;
  text-transform: uppercase;
}

.post-taxonomy__pill {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: 999px;
  color: var(--gh-muted);
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 2px 7px;
}

.post-taxonomy__pill--category {
  background: #dafbe1;
  border-color: #4ac26b;
  color: #1a7f37;
}

.post-tags-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.post-tags-footer__label {
  color: var(--gh-muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
}

.post-tags-footer__tag {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: 999px;
  color: var(--gh-muted);
  display: inline-flex;
  font-size: 0.58rem;
  line-height: 1.2;
  padding: 2px 7px;
}

.page__content h1,
.page__content h2 {
  border-bottom: 1px solid var(--gh-border-muted);
  color: var(--gh-fg);
  font-weight: 600;
  padding-bottom: 0.3em;
}

.page__content h3,
.page__content h4,
.page__content h5,
.page__content h6 {
  color: var(--gh-fg);
  font-weight: 600;
}

.page__content code,
.page__content pre,
.highlighter-rouge {
  font-family: var(--gh-mono);
}

.page__content code {
  background: rgba(175, 184, 193, 0.2);
  border-radius: 6px;
  color: var(--gh-fg);
  font-size: 85%;
  padding: 0.2em 0.4em;
}

.page__content pre {
  background: var(--gh-canvas-subtle);
  border-radius: 6px;
  border: 1px solid var(--gh-border-muted);
  color: var(--gh-fg);
  padding: 16px;
}

.page__content blockquote {
  border-left: 0.25em solid var(--gh-border);
  color: var(--gh-muted);
  padding-left: 1em;
}

.page__content .image-figure {
  display: table;
  margin: 1.5rem auto;
  max-width: 100%;
}

.page__content .image-figure img {
  display: block;
  margin: 0 auto;
}

.page__content .image-caption,
.page__content figcaption {
  color: var(--gh-muted);
  font-size: 0.5rem;
  line-height: 1.3;
  caption-side: bottom;
  display: table-caption;
  margin: 0.35rem 0 0;
  max-width: min(100%, 720px);
  text-align: left;
}

.page__content .image-caption a,
.page__content figcaption a {
  color: var(--gh-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-card-group {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}

.link-card {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border-muted);
  border-radius: 6px;
  color: var(--gh-fg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  min-height: 124px;
  overflow: hidden;
  text-decoration: none;
}

.link-card:hover {
  border-color: var(--gh-accent);
  box-shadow: 0 1px 2px rgba(27, 31, 36, 0.08);
  text-decoration: none;
}

.link-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-width: 0;
  padding: 16px 18px;
}

.link-card__title {
  color: var(--gh-fg);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.link-card__excerpt {
  color: var(--gh-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.link-card__domain {
  color: var(--gh-muted);
  font-size: 0.75rem;
}

.link-card__thumb {
  align-items: center;
  color: #ffffff;
  display: flex;
  font-size: 0.78rem;
  font-weight: 600;
  justify-content: center;
  min-height: 124px;
  text-align: center;
}

.link-card__thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.link-card__thumb--neuro {
  background: linear-gradient(135deg, #2f3747, #7a8599);
}

.link-card__thumb--learning {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #24292f;
}

.link-card__thumb--inc {
  background: linear-gradient(135deg, #2da44e, #54aeff);
}

.link-card__thumb--wsj {
  background: linear-gradient(135deg, #24292f, #57606a);
}

.link-card__thumb--source {
  background: linear-gradient(135deg, #f6f8fa, #d8dee4);
  color: var(--gh-muted);
}

.video-embed {
  aspect-ratio: 16 / 9;
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border-muted);
  border-radius: 6px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.video-embed iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.video-link {
  color: var(--gh-muted);
  font-size: 0.82rem;
  margin-top: -0.75rem;
  text-align: center;
}

.page__content table {
  border-collapse: collapse;
}

.page__content th,
.page__content td {
  border: 1px solid var(--gh-border);
  padding: 6px 13px;
}

.page__content tr:nth-child(2n) {
  background: var(--gh-canvas-subtle);
}

.btn,
.btn--primary,
.btn--inverse,
.pagination--pager {
  background: var(--gh-button);
  border: 1px solid rgba(27, 31, 36, 0.15);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
  color: var(--gh-fg);
  font-family: var(--gh-font);
  font-weight: 500;
}

.btn:hover,
.btn--primary:hover,
.btn--inverse:hover,
.pagination--pager:hover {
  background: var(--gh-button-hover);
  color: var(--gh-fg);
  text-decoration: none;
}

.btn--primary {
  background: #2da44e;
  border-color: rgba(27, 31, 36, 0.15);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--gh-success);
  color: #ffffff;
}

.sidebar,
.author__content,
.author__urls-wrapper {
  color: var(--gh-muted);
}

.author__avatar img {
  border: 1px solid var(--gh-border);
  border-radius: 50%;
}

.taxonomy__index a,
.taxonomy__section a {
  border-radius: 6px;
}

.search-content {
  background: var(--gh-canvas);
}

.search-input {
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-fg);
  font-family: var(--gh-font);
}

.notice,
.notice--primary,
.notice--info,
.notice--warning,
.notice--success,
.notice--danger {
  background: var(--gh-canvas-subtle);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  color: var(--gh-fg);
}

.footer {
  background: var(--gh-canvas);
  border-top: 1px solid var(--gh-border);
  color: var(--gh-muted);
}

.page__related {
  border-top: 1px solid var(--gh-border);
  margin-top: 28px;
  padding-top: 18px;
}

.page__related-title {
  color: var(--gh-fg);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.related-title__strike {
  color: var(--gh-muted);
  text-decoration: line-through;
}

.page__related .grid__item {
  margin-bottom: 10px;
}

.page__related .archive__item {
  background: var(--gh-canvas);
  border: 1px solid var(--gh-border);
  border-radius: 6px;
  display: block;
  padding: 12px;
}

.page__related .archive__item-title {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .masthead__inner-wrap {
    padding: 12px 16px;
  }

  .page__inner-wrap,
  .archive {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    padding: 20px 16px;
  }

  .page__title {
    font-size: 26px;
  }

  .archive__item--has-teaser {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .link-card {
    grid-template-columns: 1fr;
  }

  .link-card__thumb {
    min-height: 64px;
    order: -1;
  }

  .page-header--image {
    margin: -20px -16px 0;
  }

  .page-header__hero {
    aspect-ratio: 4 / 3;
    max-height: 280px;
    min-height: 180px;
  }

  .page-header__overlay {
    padding: 20px 16px;
  }
}
