/* Works and editorial pages share the quiet paper palette and compact home cards. */
.works-view .page-intro,
.notes-view > .page-intro { padding-bottom: 28px; }

.filter-caption,
.search-caption { color: var(--ink); font-size: .78rem; font-weight: 600; letter-spacing: .01em; }
.filter-bar { gap: 8px; }
.filter-chip {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper-light);
  font-size: .84rem;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.filter-chip:hover { transform: translateY(-1px); border-color: var(--brown); color: var(--ink); background: var(--brown-wash); }
.filter-chip[aria-pressed="true"],
.filter-chip.active { border-color: var(--brown); color: #fff; background: var(--brown); }
.filter-chip:focus-visible,
.project-detail-button:focus-visible,
.project-external:focus-visible,
.note-item a:focus-visible,
.search-box:focus-within,
.article-back:focus-visible,
.load-more:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }

.works-view > .filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 15px 0 17px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.works-view > .filter-bar .filter-caption { margin-right: 6px; }
.works-view .filter-count {
  margin-left: auto;
  color: var(--muted);
  font: 500 .8rem/1.5 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}
.project-stack { max-width: 1080px; gap: 14px; margin-top: 19px; }

/* Shared by the full works list and the compact project cards on the home page. */
.project-card {
  min-width: 0;
  border-color: var(--line);
  border-radius: 18px;
  background: var(--paper-light);
  box-shadow: 0 2px 8px rgba(56,46,31,.025);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: #d4c3b5;
  background: #fffdf8;
  box-shadow: 0 10px 24px rgba(56,46,31,.07);
}
.project-stack .project-card,
.project-grid .project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  padding: 17px;
}
.works-view .project-stack .project-card.has-cover {
  grid-template-columns: minmax(175px, .37fr) minmax(0, 1fr);
  gap: 20px;
}
.project-cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--paper-deep);
}
.project-content { min-width: 0; display: flex; flex-direction: column; }
.project-top {
  flex-wrap: wrap;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 600 .76rem/1.45 var(--sans);
  letter-spacing: .035em;
  text-transform: none;
}
.project-top .project-label { color: var(--brown); font-weight: 700; }
.project-status {
  display: inline-flex;
  max-width: 100%;
  margin-left: auto;
  min-height: 30px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #ddd0c4;
  border-radius: 999px;
  color: #693b2c;
  background: var(--brown-wash);
  font-size: .76rem;
  letter-spacing: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.project-main {
  min-width: 0;
  min-height: 0;
  align-items: flex-start;
  gap: 18px;
  padding: 13px 0 17px;
}
.project-copy { min-width: 0; flex: 1 1 auto; }
.project-main h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font: 600 clamp(1.3rem, 2vw, 1.65rem)/1.4 var(--sans);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.project-main p {
  max-width: 66ch;
  margin: 0 0 13px;
  color: #6d6258;
  font-size: .96rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.project-card .tag-list { gap: 7px; }
.project-card .tag-list span {
  padding: 5px 10px;
  border: 1px solid #e6dcd2;
  border-radius: 999px;
  color: #70665c;
  background: #f3ede7;
  font: 500 .78rem/1.4 var(--sans);
}
.project-detail-button {
  min-width: 44px;
  min-height: 46px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  align-self: flex-end;
  padding: 9px 13px;
  border: 1px solid #d4c2b3;
  border-radius: 11px;
  color: #693b2c;
  background: var(--brown-wash);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.project-detail-button:hover { transform: translateY(-1px); border-color: var(--brown); color: #fff; background: var(--brown); }
.project-detail-button span:last-child { font-size: 1.05em; }
.project-bottom {
  min-height: 46px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 .79rem/1.5 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}
.project-categories { min-width: 0; overflow-wrap: anywhere; }
.project-external {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--brown-dark);
  font-size: .84rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.project-external:hover { color: #4d352a; background: #f2e9df; }

/* Keep cards used in the home preview compact while leaving useful touch targets. */
.project-grid .project-card.compact { grid-template-columns: minmax(0, 1fr); padding: 15px; }
.project-grid .project-card.compact.has-cover { grid-template-columns: minmax(0, 1fr); }
.project-grid .project-card.compact .project-cover {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
}
.project-grid .project-card.compact .project-main { display: flex; gap: 12px; padding: 10px 0 13px; }
.project-grid .project-card.compact .project-main h3 { font-size: 1.16rem; }
.project-grid .project-card.compact .project-main p { font-size: .94rem; line-height: 1.75; }
.project-grid .project-card.compact .project-detail-button { margin-top: 8px; }
.project-grid .project-card.compact .project-bottom { align-items: flex-start; }

.notes-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 13px 22px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.notes-controls .filter-bar { flex: 1 1 420px; }
.search-box {
  width: min(100%, 360px);
  min-height: 48px;
  flex: 0 1 360px;
  gap: 9px;
  padding: 5px 12px;
  border-color: #d5ccc1;
  border-radius: 12px;
  background: var(--paper-light);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search-box:focus-within { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(138,78,55,.12); }
.search-icon { color: var(--brown); font-size: 1.2rem; line-height: 1; }
.search-caption { flex: 0 0 auto; font-size: .8rem; }
.search-box input { min-width: 0; min-height: 42px; font-size: 16px; }
.search-box input::placeholder { color: #8b8178; }
.notes-result {
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 0 2px;
  color: var(--muted);
  font: 500 .82rem/1.5 var(--sans);
  letter-spacing: 0;
}
.editorial-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  border: 0;
}
.notes-view .editorial-list .note-item {
  min-width: 0;
  grid-template-columns: minmax(100px, .23fr) minmax(0, 1fr) 44px;
  gap: 17px;
  margin: 0;
  padding: 19px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-light);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.notes-view .editorial-list .note-item:hover,
.notes-view .editorial-list .note-item:focus-within {
  transform: translateY(-1px);
  border-color: #d3c3b5;
  background: #fffdf8;
  box-shadow: 0 7px 18px rgba(56,46,31,.055);
}
.note-meta { align-self: start; gap: 8px; padding-top: 4px; color: var(--muted); font: 500 .8rem/1.45 var(--sans); }
.note-meta span {
  width: fit-content;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #e3d9cf;
  border-radius: 999px;
  color: #755443;
  background: var(--brown-wash);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.note-copy { min-width: 0; }
.notes-view .note-item h3 { margin: 0 0 7px; font: 600 clamp(1.14rem, 1.65vw, 1.4rem)/1.5 var(--sans); letter-spacing: 0; overflow-wrap: anywhere; }
.note-item h3 a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.note-item h3 a:hover { color: var(--brown); text-decoration: underline; }
.notes-view .note-item p { max-width: 68ch; margin: 0 0 9px; color: #6d6258; font-size: .94rem; line-height: 1.75; overflow-wrap: anywhere; }
.notes-view .note-item small { color: #786e64; font: 500 .78rem/1.5 var(--sans); }
.note-arrow {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--brown);
  font-size: 0;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.note-arrow span { font-size: 1.22rem; line-height: 1; }
.note-arrow:hover { transform: translate(1px, -1px); border-color: #e1d2c5; color: #693b2c; background: var(--brown-wash); }
.empty-state { padding: 30px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--paper-light); font-size: .96rem; line-height: 1.7; }
.empty-state.error-state { border-color: #e4cbc4; color: #86473c; background: #fbf2ed; }
.load-more {
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid #ded4c8;
  border-radius: 11px;
  color: #755444;
  background: var(--brown-wash);
  font-size: .88rem;
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease;
}
.load-more:hover { border-color: var(--brown); background: #eee3d9; }

.article-view { max-width: 1060px; padding-top: 27px; }
.article-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin: 0 0 18px;
  padding: 4px 10px;
  border-radius: 9px;
  color: var(--brown);
  font-size: .88rem;
  font-weight: 600;
}
.article-back:hover { color: #693b2c; background: var(--brown-wash); }
.article-page {
  padding: clamp(22px, 5vw, 50px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-light);
  box-shadow: 0 8px 24px rgba(56,46,31,.035);
}
.article-page > header { max-width: 68ch; margin: 0 auto 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.article-page > header .eyebrow { font-size: .82rem; letter-spacing: .035em; text-transform: none; }
.article-page h1 {
  margin: 12px 0 13px;
  color: var(--ink);
  font: 600 clamp(1.85rem, 3.7vw, 2.8rem)/1.35 var(--sans);
  text-wrap: balance;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.article-page > header > p { margin: 0; color: #6d6258; font-size: 1.02rem; line-height: 1.75; overflow-wrap: anywhere; }
.article-meta { flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; color: var(--muted); font: 500 .82rem/1.5 var(--sans); }
.article-cover { max-height: 540px; margin-bottom: 30px; border-radius: 14px; background: var(--paper-deep); }
.article-body { max-width: 68ch; color: #34332e; font: 1.04rem/1.95 var(--sans); overflow-wrap: anywhere; }
.article-body h2,
.article-body h3,
.article-body h4 { color: var(--ink); letter-spacing: 0; overflow-wrap: anywhere; }
.article-body h2 { margin-top: 1.8em; font-size: clamp(1.55rem, 3vw, 1.9rem); }
.article-body h3 { font-size: clamp(1.28rem, 2.5vw, 1.5rem); }
.article-body p { margin: 1.05em 0; }
.article-body ul { padding-left: 1.45em; }
.article-body li { padding-left: .15em; }
.article-body blockquote { border-radius: 0 10px 10px 0; color: #755443; background: var(--brown-wash); font-size: 1em; line-height: 1.8; }
.article-body code { overflow-wrap: anywhere; }
.article-assets { max-width: 68ch; gap: 18px; margin-top: 34px; padding-top: 22px; }
.article-assets > .eyebrow { font-size: .82rem; letter-spacing: .035em; text-transform: none; }
.article-assets img,
.article-assets video { max-height: 560px; border-radius: 12px; }
.article-assets figcaption { margin-top: 9px; color: var(--muted); font-size: .86rem; line-height: 1.6; overflow-wrap: anywhere; }
.article-file { min-height: 62px; grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto; gap: 14px; padding: 14px; }
.article-file span { font: 500 .82rem/1.4 var(--sans); }
.article-file b { font-size: .94rem; line-height: 1.5; overflow-wrap: anywhere; }
.article-file i { font-size: 1rem; }
.article-state { min-height: 220px; padding: 24px; border-radius: 14px; color: var(--muted); background: var(--paper-light); font-size: .96rem; line-height: 1.7; }
.article-state.error-state { color: #86473c; background: #fbf2ed; }
.article-state .text-link { min-height: 44px; display: inline-flex; align-items: center; padding: 4px 9px; font-size: .88rem; }

@media (max-width: 930px) {
  .works-view .project-stack .project-card.has-cover { grid-template-columns: minmax(145px, .33fr) minmax(0, 1fr); gap: 16px; }
  .project-cover { min-height: 172px; }
  .notes-controls { align-items: flex-start; }
  .notes-controls .filter-bar { flex-basis: 100%; }
  .search-box { flex-basis: 100%; width: 100%; }
}

@media (max-width: 760px) {
  .works-view .project-stack .project-card.has-cover { grid-template-columns: minmax(0, 1fr); }
  .works-view .project-stack .project-cover { height: auto; min-height: 0; aspect-ratio: 16 / 9; margin-bottom: 13px; }
}

@media (max-width: 650px) {
  .works-view .page-intro,
  .notes-view > .page-intro { padding-bottom: 22px; }
  .works-view > .filter-bar { align-items: flex-start; }
  .works-view > .filter-bar .filter-caption { flex: 0 0 100%; }
  .works-view .filter-count { flex: 1 0 100%; margin: 0; padding-top: 3px; }
  .project-stack { gap: 11px; margin-top: 14px; }
  .project-stack .project-card,
  .project-grid .project-card { padding: 14px; }
  .project-main { align-items: stretch; flex-direction: column; gap: 9px; padding: 12px 0 14px; }
  .project-main h3 { font-size: 1.3rem; }
  .project-main p { font-size: .94rem; }
  .project-detail-button { width: fit-content; min-height: 46px; align-self: flex-start; }
  .project-bottom { align-items: flex-start; }
  .notes-controls { gap: 10px; padding: 13px 0; }
  .notes-controls .filter-bar { gap: 7px; }
  .notes-controls .filter-caption { flex-basis: 100%; }
  .search-box { margin-top: 0; }
  .notes-view .editorial-list .note-item {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px 10px;
    padding: 15px 12px;
  }
  .notes-view .editorial-list .note-item .note-meta { grid-column: 1 / -1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; padding: 0; }
  .notes-view .editorial-list .note-item .note-copy { grid-column: 1; grid-row: 2; }
  .notes-view .editorial-list .note-item .note-arrow { grid-column: 2; grid-row: 2; align-self: center; }
  .notes-view .note-item h3 { font-size: 1.16rem; }
  .notes-view .note-item p { font-size: .92rem; }
  .article-view { padding-top: 16px; }
  .article-back { margin-bottom: 12px; }
  .article-page { padding: 23px 18px; border-radius: 15px; }
  .article-page > header { margin-bottom: 23px; padding-bottom: 19px; }
  .article-page h1 { font-size: clamp(1.9rem, 9vw, 2.45rem); }
  .article-page > header > p { font-size: .98rem; }
  .article-body { font-size: 1rem; line-height: 1.9; }
  .article-assets { margin-top: 28px; }
  .article-file { grid-template-columns: minmax(0, 1fr) auto; }
  .article-file span { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .filter-chip:hover { transform: none; }
  .project-card,
  .project-detail-button,
  .note-item,
  .note-arrow,
  .load-more { transition: none; }
}
