:root {
  --bg: #e9e7e1;
  --surface: #f4f3ef;
  --ink: #15171a;
  --muted: #5c5a54;
  --line: #cfccc3;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --measure: 720px;
  --page: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --rainbow: linear-gradient(90deg, #ed1c24 0 16.6%, #f7941d 0 33.3%, #f7ec2f 0 50%, #39b54a 0 66.6%, #00aeef 0 83.3%, #92278f 0);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); }
img, video { max-width: 100%; height: auto; }
a { color: inherit; }
main { max-width: var(--page); margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) 80px; }
:focus-visible { outline: 3px solid #00aeef; outline-offset: 2px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.site-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  max-width: var(--page); margin: 0 auto; padding: 18px var(--gutter);
}
.site-header::after {
  content: ""; grid-column: 1 / -1; height: 3px; background: var(--rainbow); border-radius: 2px;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-weight: 550; font-size: 15px; }
.site-nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { border-bottom-color: currentColor; }
.site-logo { display: block; line-height: 0; grid-column: 2; grid-row: 1; }
.site-logo img { width: 56px; height: 56px; border-radius: 12px; }
.site-name { margin: 0; text-align: right; font-weight: 700; letter-spacing: -0.01em; grid-column: 3; grid-row: 1; }
.site-name a { text-decoration: none; }

/* Shared text pieces */
.eyebrow { display: block; font-size: 13px; font-weight: 650; letter-spacing: 0.02em; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.eyebrow:hover { color: var(--ink); text-decoration: underline; }
time, .archive-count { display: block; font-size: 14px; color: var(--muted); }
.card-title a, .highlight-title a, .side-title a { text-decoration: none; }
.card-title a:hover, .highlight-title a:hover, .side-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-excerpt {
  margin: 0 0 10px; font: 400 16px/1.5 var(--serif); color: #33332f;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* Image frames */
.card-media, .highlight-media, .side-media { display: block; background: #000; overflow: hidden; border-radius: 6px; }
.card-media img, .highlight-media img, .side-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
img.placeholder { object-fit: contain !important; padding: 6%; }

/* Home highlight */
.highlight { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(28px, 4vw, 56px); padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.highlight-media { aspect-ratio: 16 / 10; margin-bottom: 18px; }
.highlight-title { margin: 0 0 10px; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 750; }
.highlight-lead .card-excerpt { font-size: 19px; -webkit-line-clamp: 4; line-clamp: 4; }
.highlight-side { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.highlight-side li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line); }
.highlight-side li:first-child { padding-top: 0; border-top: 0; }
.side-media { aspect-ratio: 4 / 3; }
.side-title { margin: 0 0 6px; font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }

/* Grid */
.section-heading { margin: 40px 0 24px; font-size: 15px; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(20px, 3vw, 36px); }
.card-media { aspect-ratio: 16 / 10; margin-bottom: 14px; }
.card-title { margin: 0 0 8px; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -0.012em; }

/* Archive headers */
.archive-header { max-width: var(--measure); margin: 0 auto 44px; text-align: center; }
.archive-header h1 { margin: 0 0 10px; font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
.archive-header p { margin: 0 0 8px; font-family: var(--serif); font-size: 19px; }
.archive-header .archive-count { font-family: var(--sans); font-size: 14px; }
.avatar { border-radius: 50%; object-fit: cover; width: 96px; height: 96px; margin-bottom: 12px; }

/* Article */
.article-header { max-width: var(--measure); margin: 0 auto 32px; }
.article-title { margin: 0 0 14px; font-size: clamp(34px, 5.4vw, 56px); line-height: 1.06; letter-spacing: -0.022em; font-weight: 750; overflow-wrap: anywhere; }
.article-excerpt { margin: 0 0 14px; font: 400 21px/1.45 var(--serif); }
.article-meta { margin: 0; font-size: 14px; color: var(--muted); }
.article-meta time { display: inline; }
.article-feature { max-width: 1040px; margin: 0 auto 40px; }
.article-feature.narrow { max-width: var(--measure); }
.article-feature img { display: block; width: 100%; border-radius: 6px; }
.article-feature figcaption, .article-content figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }

.article-content { max-width: var(--measure); margin: 0 auto; font: 400 19px/1.65 var(--serif); overflow-wrap: break-word; }
.article-content > * { margin-top: 0; margin-bottom: 1.25em; }
.article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 { font-family: var(--sans); line-height: 1.2; letter-spacing: -0.012em; margin-top: 1.7em; margin-bottom: 0.6em; font-weight: 700; }
.article-content h2 { font-size: 30px; }
.article-content h3 { font-size: 24px; }
.article-content h4 { font-size: 20px; }
.article-content h5, .article-content h6 { font-size: 17px; }
.article-content a { text-underline-offset: 2px; }
.article-content li { margin-bottom: 0.4em; }
.article-content blockquote:not(.twitter-tweet) { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--ink); font-style: italic; }
.article-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.article-content table { width: 100%; border-collapse: collapse; font: 15px/1.45 var(--sans); display: block; overflow-x: auto; }
.article-content th, .article-content td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.article-content iframe { max-width: 100%; border: 0; }
.article-content iframe.video-embed { display: block; width: 100%; height: auto; border-radius: 6px; background: #000; }
.article-content .twitter-tweet { margin-inline: auto !important; }

.kg-card { margin: 2em 0; }
.kg-image { display: block; margin: 0 auto; border-radius: 4px; }
.kg-width-wide { position: relative; width: min(1040px, calc(100vw - 2 * var(--gutter))); left: 50%; transform: translateX(-50%); }
.kg-width-wide .kg-image { width: 100%; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.kg-gallery-row { display: flex; gap: 8px; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }

.kg-bookmark-container { display: flex; min-height: 130px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-decoration: none; font-family: var(--sans); }
.kg-bookmark-container:hover { border-color: var(--ink); }
.kg-bookmark-content { flex: 1 1 60%; min-width: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kg-bookmark-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.kg-bookmark-description { font-size: 14px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: auto; min-width: 0; }
.kg-bookmark-icon { width: 18px; height: 18px; flex: none; }
.kg-bookmark-author, .kg-bookmark-publisher { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-bookmark-thumbnail { position: relative; flex: 0 0 32%; min-height: 130px; }
.kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.article-tags { max-width: var(--measure); margin: 44px auto 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags a { font-size: 14px; font-weight: 550; text-decoration: none; padding: 4px 12px; border: 1px solid var(--ink); border-radius: 99px; }
.article-tags a:hover { background: var(--ink); color: var(--bg); }

/* Footer */
.site-footer { max-width: var(--page); margin: 0 auto; padding: 28px var(--gutter) 44px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0; max-width: 60ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { text-underline-offset: 2px; }

/* Responsive */
@media (max-width: 960px) {
  .highlight { grid-template-columns: minmax(0, 1fr); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .site-header { grid-template-columns: 1fr; justify-items: center; gap: 12px; padding-top: 14px; }
  .site-header::after { width: 100%; grid-column: 1; }
  .site-logo { grid-column: 1; }
  .site-name { display: none; }
  .site-nav { grid-row: 2; justify-content: center; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .kg-bookmark-container { flex-direction: column-reverse; }
  .kg-bookmark-thumbnail { flex-basis: 150px; }
  .article-content { font-size: 18px; }
  .highlight-side li { grid-template-columns: 96px 1fr; }
}
