.portfolio-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 8px;
}
.portfolio-tools[hidden], .portfolio-count[hidden], .portfolio-empty[hidden],
.portfolio-tools button[hidden], .portfolio-archive .archive-card[hidden] { display: none; }
.portfolio-tools .filter-row { margin: 0; }
.project-search { display: grid; gap: 3px; color: var(--muted); font: 700 13px var(--sans); }
.project-search input {
  width: min(235px, 100%);
  min-height: 44px;
  background: var(--white); color: var(--ink);
  border: 1px solid #979e9d; border-radius: 5px;
  padding: 9px 12px; font: 400 16px var(--sans);
}
.portfolio-count { color: var(--muted); font-size: 14px; margin: 0 0 15px; }
.portfolio-empty { padding: 24px 0; }
.portfolio-empty button { min-height:44px; padding: 6px 0; color: var(--navy); text-decoration: underline; font: 700 15px var(--sans); background: none; border: 0; }
.portfolio-archive .image-frame { position: relative; overflow: hidden; }
.card-photo-count, .album-open {
  position: absolute; bottom: 12px; right: 12px;
  padding: 5px 10px; border-radius: 30px;
  background: #182534eb; color: white;
  font: 700 12px/1.4 var(--sans); pointer-events: none;
}
.case-album-cover > a { display: grid; position: relative; place-items: center; width: 100%; }
.case-album-cover img { display: block; width: 100%; height: auto; max-height: min(72vh, 700px); object-fit: contain; }
.case-album-cover.portrait-cover img { width: auto; max-width: 100%; }
.album-open { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; }
.album-open svg { width: 16px; height: 16px; }
.case-planning {
  margin: 36px 0; padding: 18px 25px;
  border-inline-start: 3px solid var(--gold); background: var(--sand);
}
.case-planning h3 { margin: 0 0 7px; font-size: clamp(23px, 3vw, 32px); }
.case-planning p { max-width: 75ch; margin: 0; }
.photo-dialog .album-nav {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 6px 14px; padding: 12px 14px;
}
.album-caption { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.album-buttons { display: flex; align-items: center; gap: 4px; }
.album-position { margin-right: 4px; font-size: 13px; white-space: nowrap; }
.photo-dialog .album-step {
  min-width: 44px; padding: 6px; border: 1px solid #8394a4; background: transparent; color: white; font-size: 19px;
}
.photo-dialog .album-step:focus-visible, .photo-dialog button:focus-visible { outline: 2px solid #f0cb83; outline-offset: 2px; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .portfolio-archive .archive-card .image-frame img { transition: transform .38s ease; }
  .portfolio-archive .archive-card a:hover .image-frame img { transform: scale(1.027); }
}
@media (max-width: 800px) {
  .portfolio-tools { align-items: start; flex-direction: column-reverse; gap: 12px; }
  .project-search, .project-search input { width: 100%; }
}
@media (max-width: 640px) {
  .portfolio-tools .filter-row { gap: 5px; }
  .portfolio-tools .filter-row button { padding: 6px 13px; }
  .photo-dialog .album-nav { grid-template-columns: 1fr; }
  .album-buttons { justify-content: flex-end; }
  .album-position { margin-right: auto; }
  .photo-dialog img { max-height: 68dvh; }
  .case-planning { padding: 15px 18px; }
}
.portfolio-archive .project-notes-cover {
  position: relative; display: flex; flex-direction: column; justify-content: end;
  gap: 7px; padding: clamp(18px, 2.8vw, 40px); color: white;
  background: linear-gradient(115deg,#253854,#344d69); border: 1px solid #2d435a;
}
.project-notes-cover span { position: static; font: 700 13px var(--sans); color: #f2d5aa; }
.project-notes-cover strong { font: 400 clamp(28px, 3.4vw, 48px)/1.05 var(--serif); letter-spacing: -.04em; }
.case-switch {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;background:var(--sand);padding:8px 14px;}
.case-switch strong {font-size:.9rem;}
.case-switch>div {display:flex;border-radius:30px;background:#fff;border:1px solid #aab2aa;padding:2px;}
.case-switch button {cursor:pointer;border:0;border-radius:30px;background:transparent;color:var(--navy);font:700 .85rem var(--sans);min-height:44px;min-width:66px;padding:0 14px;}
.case-switch button[aria-pressed=true] {color:white;background:var(--navy);}
.case-comparison [hidden]{display:none!important;}
.case-comparison .case-album-cover>a {background:#203024;}
.case-comparison .case-album-cover img {height:clamp(210px,50vw,64vh);}
@media(prefers-reduced-motion:no-preference){.case-comparison .case-album-cover:not([hidden]) img{animation:case-period-enter .35s cubic-bezier(.2,.7,.2,1);}@keyframes case-period-enter{from{clip-path:inset(0 3% 0 0);opacity:.65}to{clip-path:inset(0);opacity:1}}}

.preview-options { display:flex; justify-content:flex-end; }
.preview-options button {
  display:inline-flex; gap:.55rem; align-items:center; min-height:44px; margin-bottom:.45rem; padding:0 .9rem;
  color:var(--ps-midnight,#171F48); background:var(--ps-mist,#EFF1F6); border:1px solid #aeb6cb;
  border-radius:99px; font:700 .9rem/1.2 var(--sans); cursor:pointer;
}
.preview-options button[hidden] {display:none}
.preview-options button:focus-visible,.archive-card a:focus-visible {
  outline:3px solid var(--ps-blue,#2C378C); outline-offset:3px;
}
[data-project-previews] .image-frame,.related-projects .image-frame,.case-album-cover,.detail-photo a {
  overflow:hidden; border-radius:var(--ps-radius,12px);
}
[data-project-previews] .preview-layer {
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none;
}
.card-photo-count { z-index:1; }
.related-projects { margin-block:clamp(2rem,5vw,4.75rem); }
.related-projects .archive-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.related-projects .image-frame { aspect-ratio:2.4; }
.case-video:has(.psp-video-module) {margin-block:clamp(1.75rem,4vw,4rem);}
.case-video[hidden], .case-video:not(:has(.psp-video-module)) {display:none;}
.photo-dialog[open] {
  width:min(1260px,98vw); max-height:96dvh; color:#fff; border-radius:var(--ps-radius,12px);
  background:var(--ps-midnight,#171F48); box-shadow:0 1rem 4rem #09121c60;
}
.photo-dialog img {width:100%;height:min(76dvh,830px);object-fit:contain;touch-action:pan-y pinch-zoom;}
.photo-dialog .album-close {color:var(--ps-midnight,#171F48);background:#fff;}
@media(max-width:640px) {
  .related-projects .archive-grid {grid-template-columns:1fr;}
  .photo-dialog img {height:68dvh;max-height:68dvh;}
}
@media(max-height:480px) and (orientation:landscape) {
  .photo-dialog img {height:65dvh;max-height:65dvh;}
}
