/* Bacoia — projects page: centered hero, filters and search, a two-column grid of big framed shots whose screens change on hover. */
.p-hero { padding: calc(var(--bar) + clamp(56px, 9vh, 120px)) 0 clamp(40px, 5vw, 72px); text-align: center; }
.p-hero .h-display { max-width: 17ch; margin-inline: auto; }
.p-hero .lead { margin: 24px auto 0; }
.p-list { padding-bottom: var(--gap); }

/* Tools: type filters on the left, search on the right. Hidden without JS because they would do nothing. */
.p-tools { display: none; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-bottom: clamp(36px, 4vw, 56px); }
html.js .p-tools { display: flex; }
.chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; } /* positioned, so the hidden plain-text copies inside the chips are clipped with the scroll row */
.chip { min-height: 40px; padding: 0 18px; border-radius: 4px; background: #EFEFED; font-size: 15px; font-weight: 400; color: var(--ink-2); transition: background-color .3s var(--ease), color .3s var(--ease), transform .4s var(--ease); }
.chip:hover { background: #E4E4E1; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip:active { transform: scale(.96); }
.search { position: relative; width: min(100%, 300px); }
.search svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; min-height: 44px; padding: 0 18px 0 44px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 16px; caret-color: var(--accent); transition: border-color .3s var(--ease); }
.search input::placeholder { color: var(--muted); }
.search input:hover { border-color: var(--ink-2); }

/* Grid: two columns with aligned rows (so filtering never leaves odd gaps). */
.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(20px, 3vw, 48px); row-gap: clamp(64px, 8vw, 112px); align-items: start; }
.proj[hidden] { display: none; }
.proj { display: grid; gap: 22px; align-content: start; }
.proj.is-in { animation: projIn .8s var(--ease) both; }
@keyframes projIn { from { opacity: 0; transform: translateY(24px); } }

/* A shot sits in a cream frame, like a print on a mat. */
.proj-media { display: block; position: relative; overflow: hidden; padding: 8px; border-radius: 30px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.proj-shots { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 22px; background: var(--paper-2); }
.proj-shots img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.proj-shots img:first-child { transition: scale 1.4s var(--ease); }
/* The next screen wipes up over the previous one when you point at the project (the whole card counts, title and text included). */
.proj-shots img + img { clip-path: inset(100% 0 0 0); scale: 1.1; transition: clip-path .9s var(--ease), scale 1.4s var(--ease); }
.proj:hover .proj-shots img + img, .proj:focus-within .proj-shots img + img { clip-path: inset(0 0 0 0); scale: 1; }
.proj:hover .proj-shots img:first-child { scale: 1.05; }
/* El Puente has a third screen: it waits for the second to be seen, then wipes up too. */
.proj-shots img:nth-child(3) { transition-delay: 0s; }
.proj:hover .proj-shots img:nth-child(3), .proj:focus-within .proj-shots img:nth-child(3) { transition-delay: 1.6s; }
/* Phones: the script moves data-step along (0, 1, 2) while the project is on screen. */
.proj-shots[data-step="1"] img:nth-child(2), .proj-shots[data-step="2"] img:nth-child(-n+3) { clip-path: inset(0 0 0 0); scale: 1; }

.proj-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; padding: 0 6px; }
.proj-meta h2 { font-size: clamp(26px, 2.6vw, 40px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; }
.proj-meta .tags, .proj-meta p { grid-column: 1 / -1; }
.proj-meta p { max-width: 62ch; color: var(--ink-2); }
.proj-quote { grid-column: 1 / -1; margin: 8px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); max-width: 62ch; }
.proj-quote p { font-size: clamp(18px, 1.5vw, 21px); letter-spacing: -0.012em; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.proj-quote cite { display: block; margin-top: 8px; font-size: 14px; font-style: normal; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 5px 12px; border-radius: 3px; background: #F4F4F2; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tags li:last-child:where(:not(:first-child)) { color: var(--ink); }

/* "Ver" with an arrow disc, on the right of the title. */
.proj-go { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; text-decoration: none; color: var(--ink); }
.proj-go i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 4px; background: #EFEFED; transition: background-color .3s var(--ease), transform .5s var(--ease); }
.proj-go i svg { width: 18px; height: 18px; transition: transform .5s var(--ease); }
.proj-go:hover i, .proj:has(a.proj-media:hover) .proj-go i { background: var(--accent); }
.proj-go:hover i svg { transform: translateX(3px) rotate(-45deg); }


.proj-empty { display: grid; justify-items: center; gap: 12px; padding: clamp(48px, 8vw, 96px) 0; text-align: center; color: var(--ink-2); }
.proj-empty[hidden] { display: none; }
.proj-empty .pill { margin-top: 12px; }

@media (max-width: 900px) {
  .proj-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-media { border-radius: 24px; padding: 6px; }
  .proj-media img { border-radius: 18px; }
  .p-tools { flex-direction: column; flex-wrap: nowrap; align-items: stretch; } /* nowrap: a wrapping column would size the chip row to its content */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .search { width: 100%; }
}
