@font-face {
  font-family: "Funnel Display";
  src: url("/assets/funnel-display.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

@font-face {
  font-family: "Funnel Sans";
  src: url("/assets/funnel-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --p-bg: #ffffff;
  --p-surface: #f4f4f4;
  --p-ink: #111111;
  --p-muted: #6b6b6b;
  --p-accent: #1a4be0;
  --p-accent-ink: #ffffff;
  --p-action: #1a4be0;
  --p-action-ink: #ffffff;
  --p-inv-bg: #111111;
  --p-inv-surface: #1e1e1e;
  --p-inv-ink: #ffffff;
  --p-inv-muted: #9a9a9a;
  --p-inv-accent: #ffffff;
  --p-inv-accent-ink: #111111;
  --p-inv-action: #ffffff;
  --p-inv-action-ink: #111111;
  --font-display: "Funnel Display", system-ui, sans-serif;
  --font-text: "Funnel Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.03em;
  --display-tracking-xl: -0.04em;
  --ly-scale: 0.98;
  --ink: var(--p-ink);
  --surface: #dce7fe;
  --line: #dce1e8;
  --light-line: #eaedf2;
  --quiet: #525d6c;
  --soft-blue: #edf3ff;
  --paper: #f6f8fb;
  --gutter: clamp(16px, 4.2vw, 64px);
  --header-height: 67px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-text);
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: #dae5ff; }
:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}
.wrap { width: min(1240px, 100% - var(--gutter) * 2); margin-inline: auto; }
.wrap-reading { max-width: 850px; }
.skip-link {
  position: fixed;
  z-index: 5;
  inset: 8px auto auto var(--gutter);
  padding: 10px 16px;
  transform: translateY(-150%);
  background: var(--p-bg);
  color: var(--p-accent);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 3;
  top: 0;
  background: var(--p-bg);
  border-bottom: 1px solid var(--line);
}
.ad-banner, .ad-preview[data-ad-preview="banner"] {
  display: grid;
  place-items: center;
  min-height: 50px;
}
.ad-banner[hidden] { display: none; }
.ad-preview {
  width: min(100%, 728px);
  margin-inline: auto;
  border: 1px dashed var(--quiet);
  background: var(--paper);
  color: var(--quiet);
  padding: 6px 12px;
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}
.ad-preview[data-ad-preview="anchor"] {
  position: fixed;
  z-index: 4;
  inset: auto 0 0;
  pointer-events: none;
}
@media (min-width: 728px) {
  .ad-banner, .ad-preview[data-ad-preview="banner"] { min-height: 90px; }
}
@media (max-width: 299px), (scripting: none) {
  .ad-banner { display: none; }
}
.header-layout, .footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-layout { min-height: calc(var(--header-height) - 1px); }
.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  width: fit-content;
  white-space: nowrap;
  font: 650 22px/1 var(--font-display);
  letter-spacing: -0.055em;
}
.brand > span:last-child { color: var(--p-accent); }
.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-bottom: 7px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--p-accent);
}
.brand-mark i { width: 3px; height: 6px; border-radius: 1px; background: var(--p-bg); }
.brand-mark i:nth-child(2) { height: 10px; }
.brand-mark i:nth-child(3) { height: 15px; }
.site-header nav, .site-footer nav { display: flex; gap: 8px; }
.site-header nav a, .site-footer nav a {
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding-inline: 15px;
  border-radius: 5px;
  white-space: nowrap;
  font-weight: 550;
}
.site-header nav a:hover, .site-header nav a[aria-current], .site-footer nav a:hover {
  color: var(--p-accent);
  background: var(--soft-blue);
}

.masthead {
  --mo-light: #dce8ff;
  border-bottom: 1px solid #d4e0f4;
  background: #eaf1ff;
  color: #141e35;
}
.masthead > .mo-cs__light { --ink: #94a8cf; }
.masthead-layout {
  min-height: 245px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding-block: 43px 47px;
}
.masthead h1 {
  font-size: clamp(45px, 6vw, 89px);
  letter-spacing: var(--display-tracking-xl);
  line-height: 1.02;
}
.masthead p { margin-top: 13px; color: #424e66; font-size: clamp(16px, 1.45vw, 20px); }
.masthead-note {
  border-left: 2px solid #99b2ef;
  padding: 4px 0 5px 16px;
  margin-bottom: 3px;
  white-space: nowrap;
}
.masthead-note span { display: block; color: #465776; font-size: 13px; }
.masthead-note strong { font-size: 17px; font-weight: 650; }
[data-enter] { animation: enter 420ms ease-out both; }
@keyframes enter {
  from { opacity: .6; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-grid {
  padding-block: 32px 64px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 28px;
}
.feed-panel {
  min-width: 0;
  background: var(--p-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 5px #16233a07;
}
.feed-heading {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px clamp(14px, 1.8vw, 25px) 5px;
}
.feed-heading h2, .feed-heading h1 { font-size: clamp(30px, 3vw, 38px); line-height: 1.05; }
.feed-link, .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 7px;
  color: var(--p-accent);
  font-weight: 550;
  white-space: nowrap;
}
.feed-link { font-size: 14px; }
.feed-link:hover, .back-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.feed-updated {
  padding: 0 clamp(14px, 1.8vw, 25px) 10px;
  color: var(--quiet);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.feed-body[aria-busy="true"] { min-height: 110px; }
.story-list, .comment-list, .story-facts { margin: 0; padding: 0; list-style: none; }
.story-list > li { border-top: 1px solid var(--light-line); }
.story-row {
  min-height: 75px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content;
  align-items: start;
  gap: 12px;
  padding: 13px clamp(14px, 1.8vw, 25px);
  transition: background-color 160ms ease;
}
.story-list > li:last-child .story-row { border-radius: 0 0 9px 9px; }
.story-row:hover { background: #f4f8ff; }
.story-row:hover .story-title { color: var(--p-accent); text-decoration: underline; text-underline-offset: .13em; }
.story-row:focus-visible { position: relative; outline-offset: -3px; }
.rank {
  align-self: start;
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 29px;
  padding-inline: 3px;
  border: 1px solid #e2eaff;
  border-radius: 5px;
  background: var(--soft-blue);
  color: #244eb3;
  font: 500 12px/1 var(--font-mono);
}
.story-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.27;
  font-weight: 625;
}
.story-source, .story-counts { color: var(--quiet); font-size: 13px; line-height: 1.35; }
.story-source { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.story-source span { margin-inline: 3px; }
.story-counts { padding-top: 1px; text-align: right; font-variant-numeric: tabular-nums; }
.story-counts span { display: block; margin-top: 4px; }
.feed-status { padding: 16px clamp(14px, 1.8vw, 25px); color: var(--quiet); }
.feed-status .button { margin-top: 9px; }
.feed-page, .reading-page { padding-block: 26px 64px; }
.back-link { margin-bottom: 12px; }
.feed-page .story-title { font-size: 17px; }

.reader {
  padding: clamp(20px, 4.5vw, 55px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--p-bg);
}
.reader-heading { margin-bottom: 24px; }
.reader h1 {
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.04;
  letter-spacing: var(--display-tracking-xl);
  overflow-wrap: anywhere;
}
.story-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  align-items: center;
  margin-top: 19px;
  color: var(--quiet);
  font-size: 14px;
}
.story-facts li:first-child {
  padding: 4px 9px;
  border-radius: 4px;
  background: var(--soft-blue);
  color: #1f479f;
  overflow-wrap: anywhere;
}
.reader h2 { font-size: clamp(24px, 3vw, 31px); line-height: 1.18; }
.reader-note { margin-block: 10px 17px; color: var(--quiet); }
.prose { font-size: 17px; line-height: 1.64; overflow-wrap: anywhere; }
.post-text { white-space: pre-wrap; }
.source-summary {
  padding: clamp(16px, 3vw, 24px);
  margin-block: 20px;
  border: 1px solid #d4e0f4;
  border-radius: 8px;
  background: var(--soft-blue);
}
.source-summary h2 { margin-bottom: 8px; }
.source-summary .summary-credit { color: var(--quiet); font-size: 14px; margin-top: 10px; }
.post-content, .discussion-preview { border-top: 1px solid var(--line); padding-top: 20px; }
.post-content h2 { margin-bottom: 12px; }
.post-content p + p { margin-top: 1em; }
.discussion-preview { margin-top: 30px; }
.preview-list { margin-top: 13px; }
.comment-preview .prose { font-size: 16px; }
.document-text h2 { margin: 24px 0 10px; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--p-action);
  border-radius: 5px;
  background: var(--p-action);
  color: var(--p-action-ink);
  font-weight: 600;
  text-align: center;
  transition: translate 140ms ease, background-color 140ms ease;
}
.button:hover { background: #143bb7; translate: 0 -1px; }
.button:active { translate: 0 1px; }
.button-secondary { background: var(--p-bg); color: var(--p-accent); border-color: #b7c7ee; }
.button-secondary:hover { background: var(--soft-blue); }
.discuss { border-top: 1px solid var(--line); padding-top: 24px; }
.discussion-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.discussion-heading + .reader-note { margin-top: 2px; }
.comment { padding-block: 15px; border-top: 1px solid var(--line); }
.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 14px;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}
.comment-meta time { color: var(--quiet); font-size: 13px; }
.source-box {
  margin-top: 24px;
  padding: 20px;
  border-radius: 7px;
  background: var(--soft-blue);
}
.source-box .reader-actions { margin-top: 13px; }

.site-footer {
  background: var(--p-bg);
  border-top: 1px solid var(--line);
  padding-block: 27px 33px;
}
body:has(.reading-page, .feed-page) .footer-layout { max-width: 850px; }
.site-footer p { color: var(--quiet); font-size: 14px; margin-top: 7px; }
.site-footer nav a { font-size: 14px; }

@media (max-width: 760px) {
  .masthead-layout { min-height: 0; flex-direction: column; align-items: start; padding-block: 30px 33px; }
  .masthead-note { margin-bottom: 0; }
  .masthead-note span { display: none; }
  .masthead-note strong { font-size: 15px; }
  .feed-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 20px 42px; }
  .footer-layout { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer nav { flex-wrap: wrap; gap: 4px 12px; }
  .site-footer nav a { padding-inline: 0; }
}

@media (max-width: 520px) {
  :root { --header-height: 98px; }
  .header-layout { flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; }
  .header-layout .brand { align-self: flex-start; }
  .site-header nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .site-header nav a { padding-inline: 3px; font-size: 14px; }
  .masthead-layout { gap: 16px; }
  .masthead h1 { max-width: 11ch; }
  .story-row { grid-template-columns: 32px minmax(0, 1fr); gap: 5px 9px; padding-block: 12px; }
  .rank { grid-row: 1 / 3; }
  .story-counts { grid-column: 2; display: flex; gap: 10px; padding: 0; text-align: left; }
  .story-counts span { margin-top: 0; }
  .reading-page, .feed-page { padding-block: 12px 36px; }
  .reader-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  [data-enter] { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
