:root {
  --notes-bg: var(--bg);
  --notes-paper: var(--white);
  --notes-ink: var(--ink);
  --notes-text: var(--ink-2);
  --notes-muted: var(--ink-3);
  --notes-line: var(--line-2);
  --notes-accent: var(--green-deep);
  --notes-accent-soft: var(--green-mist);
}

.articles-page {
  min-height: 100vh;
  color: var(--notes-ink);
  font-family: var(--font-sans);
  font-weight: 400;
  background:
    linear-gradient(90deg, rgba(10, 31, 20, 0.025) 1px, transparent 1px),
    var(--notes-bg);
  background-size: 72px 72px;
}

.articles-page .site-nav a[aria-current="page"] {
  color: var(--green-deep);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.article-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding-right: 48px;
  padding-left: 48px;
}

.article-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.82);
  border-bottom: 1px solid var(--notes-line);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}

.article-nav-shell {
  width: min(100%, 1500px);
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.article-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.article-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--notes-ink);
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
}

.article-brand > span:last-child {
  display: grid;
  gap: 2px;
}

.article-brand strong {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.article-brand small {
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.2px;
}

.article-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: var(--notes-text);
  font-size: 13px;
  white-space: nowrap;
}

.article-nav a {
  transition: color 0.18s ease;
}

.article-nav a:hover,
.article-nav a:focus-visible,
.article-nav .is-current {
  color: var(--notes-ink);
}

.article-nav .is-current {
  font-weight: 700;
}

.article-home-link {
  padding: 10px 14px;
  color: #fff !important;
  background: var(--notes-ink);
  border-radius: 999px;
}

.notes-masthead {
  background: linear-gradient(135deg, #f7f8f4 0%, #fafaf7 56%, #eff7f2 100%);
}

.notes-masthead-inner {
  min-height: 250px;
  padding-top: 62px;
  padding-bottom: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 24px;
}

.notes-masthead-inner > div {
  min-width: 0;
}

.article-kicker,
.article-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--notes-accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.article-kicker span {
  width: 34px;
  height: 2px;
  background: var(--notes-accent);
}

.notes-masthead h1 {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(36px, 3.6vw, 56px);
  font-weight: 700;
  letter-spacing: -2.4px;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes-masthead-inner > p {
  max-width: 880px;
  padding-bottom: 0;
  color: var(--notes-text);
  font-size: 15px;
  line-height: 1.9;
  text-align: left;
}

.article-library {
  padding: 58px 0 104px;
  background: rgba(239, 247, 242, 0.42);
}

.article-library-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: clamp(48px, 6vw, 92px);
}

.article-sidebar {
  position: sticky;
  top: 106px;
  min-width: 0;
}

.article-search-form {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--notes-line);
}

.article-search {
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--notes-line);
  border-radius: 16px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.article-search:focus-within {
  border-color: rgba(30, 177, 120, 0.58);
  box-shadow: 0 0 0 3px rgba(30, 177, 120, 0.1);
}

.article-search-icon {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1.6px solid var(--notes-muted);
  border-radius: 50%;
}

.article-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 1.6px;
  background: var(--notes-muted);
  transform: rotate(45deg);
}

.article-search input {
  min-width: 0;
  width: 100%;
  color: var(--notes-ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
}

.article-search input::placeholder {
  color: var(--notes-muted);
}

.article-search kbd {
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  white-space: nowrap;
}

.article-sidebar-section {
  margin-top: 34px;
}

.article-sidebar-label {
  display: block;
  margin-bottom: 16px;
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
}

.article-tags {
  display: grid;
  gap: 6px;
}

.article-tag {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--notes-text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.article-tag:hover,
.article-tag:focus-visible {
  color: var(--notes-ink);
  background: rgba(242, 250, 245, 0.92);
}

.article-tag:focus-visible {
  outline: 2px solid rgba(30, 177, 120, 0.38);
  outline-offset: 2px;
}

.article-tag.is-active {
  color: var(--green-deep);
  background: var(--notes-accent-soft);
  font-weight: 700;
}

.article-tag.is-active::before {
  content: "";
  width: 4px;
  height: 20px;
  margin-right: 2px;
  background: var(--green);
  border-radius: 999px;
}

.article-tag-name {
  min-width: 0;
  flex: 1;
}

.article-tag-count {
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.article-tag.is-active .article-tag-count {
  color: var(--green-deep);
}

.article-year-section {
  padding-top: 28px;
  border-top: 1px solid var(--notes-line);
}

.article-year-section select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  color: var(--notes-text);
  background: transparent;
  border: 1px solid var(--notes-line);
  border-radius: 8px;
  outline: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.article-year-section select:focus-visible {
  border-color: var(--notes-accent);
  box-shadow: 0 0 0 3px rgba(30, 177, 120, 0.1);
}

.article-list-panel {
  min-width: 0;
  padding: 26px 32px 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(211, 221, 215, 0.9);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(8, 48, 35, 0.045);
}

.article-library-header {
  min-height: 86px;
  padding-bottom: 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid var(--notes-line);
}

.article-library-header h2 {
  margin: 14px 0 0;
  font-family: var(--font-sans);
  font-size: clamp(34px, 3.3vw, 48px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-result-count {
  padding-bottom: 4px;
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
}

.article-grid {
  display: grid;
}

.article-card {
  border-bottom: 1px solid var(--notes-line);
}

.article-card-link {
  min-height: 178px;
  padding: 20px 0;
  display: grid;
  grid-template-columns: minmax(240px, 32%) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.article-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 543;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: rgba(36, 35, 31, 0.36);
  background:
    radial-gradient(circle at 24% 25%, rgba(30, 177, 120, 0.14), transparent 26%),
    linear-gradient(140deg, var(--green-mist), var(--green-tint));
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
}

.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.32s ease;
}

.article-card-index {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 8px;
  color: var(--notes-ink);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.article-card-content {
  min-width: 0;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.9px;
}

.article-card-meta span {
  color: var(--notes-accent);
  text-transform: uppercase;
}

.article-card-meta span::after {
  content: "·";
  margin-left: 12px;
  color: var(--notes-line);
}

.article-card-content h3 {
  max-width: 900px;
  margin: 11px 0 0;
  font-family: var(--font-sans);
  font-size: clamp(21px, 1.6vw, 25px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s ease;
}

.article-card-excerpt {
  max-width: 880px;
  margin-top: 6px;
  color: var(--notes-text);
  font-size: 13px;
  line-height: 1.65;
}

.article-card-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
}

.article-card-footer span:last-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--notes-accent);
  border: 1px solid var(--notes-line);
  border-radius: 50%;
  font-size: 13px;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.article-card:hover .article-card-media img,
.article-card:focus-within .article-card-media img {
  transform: none;
}

.article-card:hover .article-card-index,
.article-card:focus-within .article-card-index {
  opacity: 1;
}

.article-card:hover h3,
.article-card:focus-within h3 {
  color: var(--notes-accent);
}

.article-card:hover .article-card-footer span:last-child,
.article-card:focus-within .article-card-footer span:last-child {
  color: #fff;
  background: var(--notes-accent);
  border-color: var(--notes-accent);
  transform: translate(2px, -2px);
}

.article-empty {
  min-height: 300px;
  margin-top: 28px;
  padding: 52px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--notes-paper);
  border: 1px solid var(--notes-line);
  border-radius: 18px;
}

.article-empty[hidden] {
  display: none;
}

.article-empty-copy > p {
  color: var(--notes-accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.article-empty-copy h3 {
  margin: 18px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.2vw, 44px);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.article-empty-copy > div {
  max-width: 570px;
  margin-top: 18px;
  color: var(--notes-text);
  font-size: 14px;
  line-height: 1.9;
}

.article-pagination {
  margin-top: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.article-pagination button {
  min-width: 110px;
  height: 42px;
  padding: 0 16px;
  color: var(--notes-ink);
  background: var(--notes-paper);
  border: 1px solid var(--notes-line);
  border-radius: 999px;
  cursor: pointer;
}

.article-pagination button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.article-pagination span {
  color: var(--notes-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.article-footer {
  padding: 28px 0;
  color: rgba(255, 255, 255, 0.66);
  background: var(--notes-ink);
}

.article-footer .article-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.article-footer p {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
}

.article-footer a {
  color: #fff;
  font-size: 12px;
}

@media (max-width: 1040px) {
  .article-shell,
  .article-nav-shell {
    padding-right: 30px;
    padding-left: 30px;
  }

  .article-library-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 42px;
  }

  .article-card-link {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 820px) {
  .article-nav {
    gap: 18px;
  }

  .article-nav a:not(.article-home-link):not(.is-current) {
    display: none;
  }

  .notes-masthead-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .article-library-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .article-sidebar {
    position: static;
  }

  .article-list-panel {
    padding: 28px 30px 18px;
  }

  .article-search-form {
    padding-bottom: 24px;
  }

  .article-tags {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-year-section {
    max-width: 280px;
  }
}

@media (max-width: 620px) {
  .article-shell,
  .article-nav-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .article-site-header {
    position: relative;
  }

  .article-nav-shell {
    min-height: 68px;
  }

  .article-brand small,
  .article-nav .is-current {
    display: none;
  }

  .article-brand-mark {
    width: 34px;
    height: 34px;
  }

  .article-home-link {
    padding: 9px 12px;
    font-size: 12px;
  }

  .notes-masthead-inner {
    min-height: 0;
    padding-top: 48px;
    padding-bottom: 42px;
  }

  .notes-masthead h1 {
    margin-top: 24px;
    font-size: clamp(36px, 10vw, 48px);
  }

  .notes-masthead-inner > p {
    font-size: 14px;
  }

  .article-library {
    padding: 38px 0 72px;
  }

  .article-list-panel {
    padding: 24px 18px 14px;
    border-radius: 14px;
  }

  .article-tags {
    grid-template-columns: 1fr;
  }

  .article-library-header {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .article-card-link {
    padding: 18px 0 20px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-card-media {
    aspect-ratio: 1280 / 543;
  }

  .article-card-content h3 {
    font-size: 21px;
  }

  .article-empty {
    min-height: 0;
    padding: 34px 20px;
  }

  .article-footer .article-shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card-media img,
  .article-card-content h3,
  .article-card-footer span:last-child {
    transition: none;
  }
}
