/* Scoped to the portfolio index; project pages and the homepage keep their own layouts. */
.portfolio-index .project-index {
  width: min(1200px, calc(100% - 64px));
  margin: 0 auto;
  padding: 48px 0 72px;
  scroll-margin-top: 100px;
}
.project-index [hidden] { display: none !important; }
.project-index-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 28px; }
.project-index-heading h1 { margin: 0; font: 500 clamp(2rem, 3vw, 2.375rem)/1.15 "General Sans", system-ui, sans-serif; letter-spacing: -.035em; }
.project-index-tools { display: flex; gap: 12px; align-items: center; margin: 0 0 30px; }
.project-index-search { display: flex; align-items: center; gap: 10px; width: min(340px, 100%); min-height: 46px; padding: 0 5px 0 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; }
.project-index-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent); }
.project-index-search > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.project-index-search input { width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.project-index-search input:focus, .project-index-search input:focus-visible { outline: none; border: 0; box-shadow: none; }
.project-index-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.project-index-clear { display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
.project-index-clear:hover { background: var(--soft); color: var(--ink); }
.project-index-types { position: relative; min-width: 160px; max-width: min(100%, 330px); }
.project-index-types summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 46px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.project-index-types summary::-webkit-details-marker { display: none; }
.project-index-types summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg) translateY(-2px); flex: none; }
.project-index-types[open] summary { border-color: var(--accent); }
.project-index-types[open] summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.project-index-type-options { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: max(100%, 260px); max-width: min(330px, calc(100vw - 32px)); max-height: 320px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 14px 38px #27292516; }
.project-index-type-options button { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.4; cursor: pointer; }
.project-index-type-options button:hover { background: var(--soft); }
.project-index-type-options button[aria-pressed="true"] { background: var(--accent-soft); }
.project-index-type-options button[aria-pressed="true"]::after { content: '✓'; flex: none; }
.project-index-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 28px; outline: none; }
.project-index-card { min-width: 0; }
.project-index-link { display: block; color: inherit; text-decoration: none; border-radius: 10px; }
.project-index-image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); border-radius: 10px; }
.project-index-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.project-index-image[data-kind="plan"] img, .project-index-image[data-kind="model"] img { object-fit: contain; }
.project-index-card-copy { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 15px; }
.project-index-card-copy h2 { margin: 0; color: var(--ink); font: 500 20px/1.3 "General Sans", system-ui, sans-serif; letter-spacing: -.025em; overflow-wrap: anywhere; }
.project-index-card-copy p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.project-index-arrow { flex: none; padding-top: 1px; color: var(--muted); font-size: 23px; line-height: 1; transition: color .18s, transform .18s; }
.project-index-capabilities { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; line-height: 1.5; }
.project-index-capabilities li + li::before { content: '·'; margin-right: 14px; }
.project-index-empty { padding: 70px 16px; text-align: center; }
.project-index-empty p { margin: 0 0 18px; font-size: 16px; }
.project-index-empty .button { min-height: 44px; }
.project-index-pagination { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.project-index-page-summary { color: var(--muted); font-size: 14px; white-space: nowrap; }
.project-index-page-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.project-index-page { display: grid; place-items: center; min-width: 44px; height: 44px; padding-inline: 10px; border: 1px solid transparent; border-radius: 50%; color: var(--ink); font-size: 14px; text-decoration: none; }
.project-index-page:hover { background: var(--soft); }
.project-index-page[aria-current="page"] { color: var(--surface); background: var(--accent); }
.project-index-page-arrow { font-size: 20px; }
.project-index-page.is-disabled { opacity: .3; }
.project-index-ellipsis { min-width: 18px; text-align: center; color: var(--muted); }
.project-index-noscript { margin: 30px 0 0; padding: 0; list-style: none; columns: 2; }
.project-index-noscript a { display: inline-block; padding-block: 10px; color: inherit; }
.project-index :is(a, button, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (hover: hover) {
  .project-index-link:hover .project-index-image img { transform: scale(1.025); }
  .project-index-link:hover .project-index-arrow { transform: translate(2px, -2px); color: var(--ink); }
}
@media (max-width: 699px) {
  .portfolio-index .project-index { width: calc(100% - 32px); padding: 30px 0 44px; }
  .project-index-heading { margin-bottom: 22px; }
  .project-index-tools { align-items: stretch; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
  .project-index-search { width: 100%; }
  .project-index-types { min-width: 0; width: 100%; max-width: none; }
  .project-index-type-options { width: 100%; max-width: none; }
  .project-index-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .project-index-card-copy { margin-top: 13px; }
  .project-index-card-copy h2 { font-size: 19px; }
  .project-index-capabilities { margin-top: 9px; }
  .project-index-pagination { flex-direction: column; margin-top: 32px; gap: 12px; }
  .project-index-page-links { gap: 2px; }
  .project-index-page { min-width: 40px; padding-inline: 8px; }
  .project-index-empty { padding: 44px 10px; }
  .project-index-noscript { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .project-index-image img, .project-index-arrow { transition: none; }
}
