/* Shared light palette and site chrome, followed by the home page Bento layout. */
body.paper-site {
  --site-bg: #f5f7fa;
  --site-card: #ffffff;
  --site-border: #e1e6ec;
  --site-text: #1b2737;
  --site-muted: #5d6d82;
  --site-accent: #24745b;
  --site-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: var(--site-bg);
  color: var(--site-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

.paper-site *,
.paper-site *::before,
.paper-site *::after {
  box-sizing: border-box;
}

.paper-site ::selection {
  background: var(--site-accent);
  color: var(--site-bg);
}

.paper-site a,
.paper-site a:hover {
  color: inherit;
  border-bottom: 0;
  text-decoration: none;
}

.paper-site a:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 5px;
}

.paper-site h1,
.paper-site h2,
.paper-site p {
  margin: 0;
}

.paper-site svg {
  display: block;
  flex-shrink: 0;
}

.paper-site .home-shell {
  width: min(1200px, calc(100% - 80px));
  max-width: none;
  margin-inline: auto;
}

.paper-site .home-skip {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 20px;
  padding: 9px 16px;
  border-radius: 6px;
  background: var(--site-accent);
  color: var(--site-bg);
  transform: translateY(-180%);
}

.paper-site .home-skip:focus {
  transform: translateY(0);
}

.paper-site .home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid var(--site-border);
}

.paper-site .home-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.65px;
  line-height: 1;
}

.paper-site .home-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #c1d9cf;
  border-radius: 8px;
  color: var(--site-accent);
}

.paper-site .home-brand-mark svg {
  width: 23px;
  height: 23px;
}

.paper-site .home-brand-period {
  margin-left: -.5em;
  color: var(--site-accent);
}

.paper-site .home-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  line-height: 1.4;
}

.paper-site .home-nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--site-muted);
  transition: color 160ms ease;
}

.paper-site .home-nav > a:hover,
.paper-site .home-nav > a[aria-current="page"] {
  color: var(--site-text);
}

.paper-site .home-nav > a[aria-current="page"]::before {
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--site-accent);
  content: "";
}

.paper-site .home-nav > .home-rss {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--site-border);
  border-radius: 7px;
}

.paper-site .home-rss svg {
  width: 15px;
  height: 15px;
}

.paper-site main.home-shell {
  padding: 30px 0 0;
}

.paper-site .home-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
  color: var(--site-muted);
  font-family: var(--site-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 1.8px;
}

.paper-site .home-edition {
  color: var(--site-muted);
  font-size: 12px;
  letter-spacing: 1.2px;
}

.paper-site .bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.paper-site .bento-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 6px;
  background: var(--site-card);
}

.paper-site a.bento-card {
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.paper-site a.bento-card:hover {
  border: 1px solid #a4c9ba;
  background-color: #f9fcfb;
  transform: translateY(-3px);
}

.paper-site .bento-intro {
  grid-column: span 7;
  min-height: 366px;
  padding: 34px 38px;
  background: #edf2f6;
}

.paper-site .card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--site-muted);
  font-family: var(--site-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: .65px;
}

.paper-site .bento-intro > :not(.intro-grid) {
  position: relative;
  z-index: 1;
}

.paper-site .small-square {
  width: 6px;
  height: 6px;
  background: var(--site-accent);
}

.paper-site .bento-intro h1 {
  margin: 24px 0 17px;
  font-size: clamp(36px, 3.9vw, 54px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -2.2px;
}

.paper-site .bento-intro h1 span {
  color: #61748b;
}

.paper-site .intro-description {
  max-width: 440px;
  color: var(--site-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
}

.paper-site .intro-bottom {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding-top: 28px;
  color: var(--site-muted);
  font-size: 12px;
  line-height: 1.7;
}

.paper-site .terminal-prompt {
  color: var(--site-accent);
  font-family: var(--site-mono);
  font-size: 15px;
  letter-spacing: 1px;
}

.paper-site .intro-author {
  color: #536e64;
  font-family: var(--site-mono);
}

.paper-site .intro-grid {
  position: absolute;
  right: -54px;
  bottom: -72px;
  width: 330px;
  height: 330px;
  pointer-events: none;
  background-image: linear-gradient(#6c928f20 1px, transparent 1px), linear-gradient(90deg, #6c928f20 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(135deg, transparent 15%, #000 85%);
  -webkit-mask-image: linear-gradient(135deg, transparent 15%, #000 85%);
}

.paper-site .intro-grid::before,
.paper-site .intro-grid::after {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 1px solid #50847440;
  content: "";
}

.paper-site .intro-grid::before {
  right: 89px;
  bottom: 119px;
}

.paper-site .intro-grid::after {
  right: 119px;
  bottom: 89px;
  border-color: #50847428;
}

.paper-site .bento-feature {
  grid-column: span 5;
  min-height: 366px;
  padding: 27px 30px 25px;
}

.paper-site .card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.paper-site .bento-feature .card-kicker {
  color: var(--site-accent);
}

.paper-site .card-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid #dbe3e8;
  border-radius: 50%;
  color: #5d6d82;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.paper-site .card-arrow svg {
  width: 14px;
  height: 14px;
}

.paper-site .bento-card:hover .card-arrow {
  color: var(--site-accent);
  border-color: #75a28f;
  transform: rotate(45deg);
}

.paper-site .feature-trace {
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: center;
  margin: 9px 0 13px;
  color: #537f71;
  opacity: .9;
}

.paper-site .feature-trace svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.paper-site .feature-trace .trace-muted {
  stroke: #c4d8d0;
  stroke-width: 1;
}

.paper-site .feature-trace .trace-active {
  stroke: #5c927b;
  stroke-width: 1.2;
}

.paper-site .feature-trace circle {
  fill: var(--site-card);
  stroke: var(--site-accent);
  stroke-width: 1.3;
}

.paper-site .article-content {
  min-width: 0;
}

.paper-site .article-category {
  margin: 0 0 8px;
  color: #44765f;
  font-family: var(--site-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.paper-site .article-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--site-text);
  font-size: 23px;
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: -.45px;
  overflow-wrap: anywhere;
  text-wrap: balance;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.paper-site .article-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 0;
  color: var(--site-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.9;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.paper-site .article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 25px;
  color: var(--site-muted);
  font-family: var(--site-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .25px;
}

.paper-site .article-meta > span {
  color: #536e64;
}

.paper-site .bento-article {
  grid-column: span 4;
  min-height: 281px;
  padding: 26px 29px 25px;
}

.paper-site .article-number {
  color: var(--site-muted);
  font-family: var(--site-mono);
  font-size: 12px;
  line-height: 1;
}

.paper-site .bento-article .article-content {
  margin-top: 25px;
}

.paper-site .bento-article .article-title {
  font-size: 20px;
  line-height: 1.5;
}

.paper-site .bento-article .article-summary {
  margin-top: 9px;
}

.paper-site .bento-explore {
  grid-column: span 4;
  min-height: 281px;
  padding: 28px 29px 25px;
  background: #eaf4ee;
  border-color: #cfe1d7;
}

.paper-site .bento-explore > .card-kicker {
  color: #4b715b;
}

.paper-site .archive-link {
  display: block;
  width: fit-content;
  margin-top: 17px;
}

.paper-site .archive-count {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.paper-site .archive-count strong {
  color: var(--site-accent);
  font-family: var(--site-mono);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -3px;
}

.paper-site .archive-count span {
  color: #425e4d;
  font-size: 14px;
  line-height: 1.6;
}

.paper-site .bento-explore > p {
  margin-top: 12px;
  color: #567261;
  font-size: 14px;
  line-height: 1.8;
}

.paper-site .topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.paper-site .topic-chip {
  padding: 3px 9px;
  border: 1px solid #bed6c8;
  border-radius: 5px;
  color: #3d6952;
  font-family: var(--site-mono);
  font-size: 12px;
  line-height: 1.6;
  transition: border-color 160ms ease, color 160ms ease;
}

.paper-site .topic-chip:hover {
  border: 1px solid #75a28f;
  color: var(--site-accent);
}

.paper-site .topic-chip > span {
  margin-left: 4px;
  color: #52715f;
}

.paper-site .archive-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--site-accent);
  font-size: 14px;
  line-height: 1.7;
}

.paper-site .archive-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.paper-site .archive-cta:hover svg {
  transform: translateX(4px);
}

.paper-site .home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 32px;
  color: var(--site-muted);
  font-size: 12px;
  line-height: 1.8;
}

.paper-site .home-footer-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.paper-site .home-footer-info > :first-child {
  font-family: var(--site-mono);
}

.paper-site .home-footer-credit {
  font-family: var(--site-mono);
  font-size: 12px;
}

.paper-site .home-footer-credit a {
  color: #4a6c5c;
}

.paper-site .home-footer-credit a:hover {
  color: var(--site-accent);
}

@media (max-width: 780px) {
  .paper-site .home-shell {
    width: calc(100% - 40px);
  }

  .paper-site .home-header {
    min-height: 80px;
  }

  .paper-site .home-nav {
    gap: 22px;
  }

  .paper-site .home-edition {
    display: none;
  }

  .paper-site .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .paper-site .bento-intro,
  .paper-site .bento-feature,
  .paper-site .bento-explore {
    grid-column: 1 / -1;
  }

  .paper-site .bento-intro {
    padding: 32px;
  }

  .paper-site .bento-intro h1 {
    font-size: clamp(38px, 6.5vw, 49px);
  }

  .paper-site .bento-article {
    grid-column: span 1;
    padding-inline: 24px;
  }

  .paper-site .archive-cta {
    max-width: 280px;
  }

  .paper-site .home-footer-info {
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .paper-site .home-shell {
    width: calc(100% - 32px);
  }

  .paper-site .home-header {
    min-height: 76px;
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: 14px;
    padding-block: 18px;
  }

  .paper-site .home-brand {
    gap: 8px;
    font-size: 16px;
  }

  .paper-site .home-brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 7px;
  }

  .paper-site .home-brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .paper-site .home-nav {
    gap: 14px;
  }

  .paper-site .home-nav > a[aria-current="page"]::before {
    display: none;
  }

  .paper-site .home-nav > .home-rss {
    width: 28px;
    min-height: 28px;
  }

  .paper-site main.home-shell {
    padding-top: 25px;
  }

  .paper-site .home-heading {
    margin-bottom: 16px;
    letter-spacing: 1.5px;
  }

  .paper-site .bento-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .paper-site .bento-card {
    grid-column: 1;
    padding: 25px 24px;
    border-radius: 6px;
  }

  .paper-site .bento-intro h1 {
    margin-top: 28px;
    font-size: clamp(32px, 8.4vw, 44px);
    line-height: 1.38;
    letter-spacing: -1.7px;
  }

  .paper-site .intro-grid {
    right: -112px;
    opacity: .65;
  }

  .paper-site .bento-article .article-content {
    margin-top: 20px;
  }

  .paper-site .archive-cta {
    max-width: none;
  }

  .paper-site .home-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 23px 0 28px;
  }

  .paper-site .home-footer-info {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .paper-site *,
  .paper-site *::before,
  .paper-site *::after {
    transition: none !important;
    animation: none !important;
  }

  .paper-site a.bento-card:hover,
  .paper-site .bento-card:hover .card-arrow,
  .paper-site .archive-cta:hover svg {
    transform: none;
  }
}
