/* Portfolio page: category tabs on the plum band, square client tiles on lace. */

.portfolio-open { padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.portfolio-open .story-names { margin-top: 2.5rem; }

/* ---------- category tabs ---------- */
.category-tabs { position: relative; margin-top: 2.75rem; }
.category-tabs ul {
  display: flex; flex-wrap: wrap; gap: .6rem;
  list-style: none; margin: 0; padding: 0;
}
.category-tab {
  display: inline-flex; align-items: baseline; gap: .55rem;
  padding: .7rem 1.15rem; border-radius: 999px;
  border: 1px solid rgba(248,245,247,.28);
  text-decoration: none; font-size: var(--t-sm); color: var(--mist);
  transition: background-color .2s, border-color .2s, color .2s;
}
.category-tab:hover { border-color: var(--gold); color: var(--lace); }
.category-tab[aria-current="page"] { background: var(--lace); border-color: var(--lace); color: var(--plum-deep); }
.tab-count { font-size: .75rem; color: var(--gold); }
.category-tab[aria-current="page"] .tab-count { color: var(--songket); }

/* ---------- category blocks ---------- */
.portfolio { max-width: 1380px; margin: 0 auto; padding: clamp(3.5rem, 7vw, 6rem) var(--gutter) var(--section); }
.portfolio-category + .portfolio-category { margin-top: clamp(4.5rem, 9vw, 7.5rem); }
.portfolio-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(2.5rem, 5vw, 4.5rem); }
.portfolio-head h2 { font-size: var(--t-xl); }
.portfolio-head p { margin-top: .9rem; color: var(--ink-soft); }
.portfolio-head .link { display: inline-block; margin-top: 1.1rem; font-size: var(--t-sm); }
.portfolio-empty { text-align: center; color: var(--ink-soft); }

/* ---------- square tiles ---------- */
.tile-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.6vw, 2.9rem);
  list-style: none; margin: 0; padding: 0;
}
.tile {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1 / 1; color: #fff; text-decoration: none;
  background: var(--plum-deep);
}
.tile .ph { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.tile .ph > img { transition: transform .9s var(--ease); }
.tile-overlay {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 1.1rem;
  padding: 1.5rem; text-align: center;
  background:
    radial-gradient(60% 45% at 50% 50%, rgba(20, 10, 22, .32), transparent 75%),
    rgba(28, 14, 30, .3);
  transition: background-color .4s var(--ease);
}
.tile-kind {
  font-family: var(--f-display); font-size: clamp(1.5rem, 1rem + 1.2vw, 2.1rem); line-height: 1;
  text-shadow: 0 1px 12px rgba(0,0,0,.25);
}
.tile-name {
  font: 500 clamp(.74rem, .66rem + .3vw, .9rem)/1.4 var(--f-body);
  text-transform: uppercase; letter-spacing: .34em; margin-right: -.34em;
  text-shadow: 0 1px 10px rgba(0,0,0,.45);
}
.tile-arrow { width: 32px; transition: transform .4s var(--ease); }
.tile-arrow svg { display: block; width: 100%; }
.tile:hover .tile-overlay, .tile:focus-visible .tile-overlay { background: rgba(28, 14, 30, .52); }
.tile:hover .ph > img, .tile:focus-visible .ph > img { transform: scale(1.045); }
.tile:hover .tile-arrow, .tile:focus-visible .tile-arrow { transform: translateX(6px); }
.tile:focus-visible { outline-offset: 4px; }

@media (max-width: 1000px) {
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tile-grid { grid-template-columns: 1fr; }
  .category-tabs ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: none; }
  .category-tab { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .tile .ph > img { transition: none; }
}
