/* Reference portfolios; retain the existing REDRA palette and page structure. */
.hero-reference{text-decoration:none;min-height:32px;display:inline-flex;align-items:center}
.hero-reference:hover{background:#fff}
.hero-image{object-position:center 48%}
.references.portfolio{display:block;margin-top:22px;padding-block:40px 54px}
.portfolio-heading{display:grid;grid-template-columns:1.1fr 1fr;gap:70px;align-items:end;margin-bottom:28px}
.portfolio-heading h2{font-size:clamp(29px,3vw,42px);line-height:1.15;letter-spacing:-1px;margin-top:15px}
.portfolio-heading>p{font-size:16px;color:var(--muted);line-height:1.7;max-width:460px}
.reference-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.reference-filters{display:flex;flex-wrap:wrap;gap:8px}
.reference-filters button{min-height:46px;border:1px solid #cbd0d4;border-radius:5px;background:#fff;padding:10px 15px;font-size:13px;font-weight:bold;color:#34404b}
.reference-filters button span{margin-left:9px;color:#65707b}
.reference-filters button:hover{border-color:#17232f}
.reference-filters button[aria-pressed=true]{background:#17232f;color:#fff;border-color:#17232f}
.reference-filters button[aria-pressed=true] span{color:#c7d0d8}
#reference-count{font-size:12px;color:#5a646f}
.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px 22px}
.project-card{min-width:0;border:1px solid #e1e4e7;border-radius:8px;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.project-photo{display:block;position:relative;aspect-ratio:3/2;overflow:hidden;background:#e7eaed}
.project-photo>img{width:100%;height:100%;object-fit:cover;transition:transform .25s ease}
.project-photo:hover>img{transform:scale(1.025)}
.project-photo-count{position:absolute;right:12px;bottom:12px;color:#fff;background:#17232feb;border:1px solid #ffffff40;border-radius:4px;font-size:12px;font-weight:700;padding:6px 9px}
.project-copy{padding:21px;display:flex;flex-direction:column;flex:1}
.project-copy .project-brand{font-size:10px;font-weight:800;letter-spacing:.7px;color:#b90c1a;text-transform:uppercase;line-height:1.5}
.project-brand span{color:#59636e;font-weight:500;letter-spacing:.3px}
.project-copy h3{font-size:23px;line-height:1.2;letter-spacing:-.4px;margin:9px 0 11px}
.project-copy>p:not(.project-brand){color:var(--muted);font-size:14px;line-height:1.6;margin-bottom:17px}
.project-open{font-size:13px;min-height:44px;margin-top:auto;align-self:flex-start}
.portfolio-footer{display:flex;justify-content:space-between;align-items:center;gap:20px;border-top:1px solid var(--line);padding-top:26px;margin-top:30px}
.portfolio-footer p{font-size:15px;color:var(--muted)}
body.gallery-open{overflow:hidden}
.gallery-dialog{width:min(1120px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 32px);padding:20px;margin:auto;border-radius:9px;overscroll-behavior:contain}
.gallery-header{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:16px}
.gallery-header h2{font-size:23px;line-height:1.25;margin:4px 0 0}
.gallery-dialog .gallery-brand{text-align:left;font-size:11px;letter-spacing:.4px;color:#c5cdd4;margin:0}
.gallery-dialog .dialog-close{position:static;flex-shrink:0;width:44px;height:44px;border:1px solid #71808e;border-radius:5px;line-height:1}
.gallery-dialog .dialog-close:hover{background:#283a49}
.gallery-stage{height:min(58dvh,660px);display:flex;align-items:center;justify-content:center;background:#0b1219;border-radius:5px;overflow:hidden}
.gallery-dialog .dialog-image{width:100%;height:100%;max-height:none;max-width:100%;object-fit:contain}
.gallery-controls{display:flex;align-items:center;justify-content:center;gap:24px;margin-top:12px}
.gallery-controls button{background:#263747;color:white;border:1px solid #657584;border-radius:5px;width:48px;height:44px;font-size:22px}
.gallery-controls button:hover{background:#3a5063}
.gallery-dialog #photo-position{font-size:12px;color:#c5cdd4;min-width:104px;margin:0}
.gallery-dialog #photo-caption{font-size:14px;margin:12px 0 0;line-height:1.5}
.gallery-thumbnails{display:flex;gap:10px;overflow-x:auto;padding:7px 4px;margin:12px auto 0;max-width:100%;width:max-content}
.gallery-thumbnails button{padding:2px;border:2px solid transparent;border-radius:4px;background:none;flex:0 0 auto;min-height:48px}
.gallery-thumbnails button[aria-pressed=true]{border-color:white}
.gallery-thumbnails img{width:80px;height:56px;object-fit:cover;border-radius:2px}
.gallery-image-error{padding:24px;color:#fff}
@media(max-width:1000px){.project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portfolio-heading{gap:30px}.portfolio-heading>p{font-size:15px}}
@media(max-width:700px){
  .references.portfolio{padding-block:20px 32px;margin-top:10px}
  .portfolio-heading{grid-template-columns:1fr;gap:17px;margin-bottom:22px}
  .portfolio-heading h2{font-size:30px;letter-spacing:-.7px}
  .portfolio-heading>p{font-size:14px}
  .reference-tools{gap:12px;margin-bottom:18px}
  .reference-filters{gap:7px;width:100%}
  .reference-filters button{font-size:12px;padding:9px 11px;flex-grow:1}
  .reference-filters button span{margin-left:5px}
  .project-grid{grid-template-columns:1fr;gap:20px}
  .project-copy{padding:19px}
  .project-copy h3{font-size:22px}
  .project-photo{aspect-ratio:3/2}
  .portfolio-footer{display:grid;gap:16px;margin-top:25px}
  .portfolio-footer p{font-size:14px}
  .hero-reference{font-size:10px}
  .hero-image{object-position:center}
  .gallery-dialog{width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - 16px);padding:14px 10px}
  .gallery-header{gap:10px}
  .gallery-header h2{font-size:19px}
  .gallery-dialog .gallery-brand{font-size:10px;max-width:230px}
  .gallery-stage{height:48dvh;min-height:150px}
  .gallery-dialog #photo-caption{font-size:12px}
  .gallery-controls{gap:18px;margin-top:10px}
  .gallery-thumbnails{gap:6px;margin-top:8px}
  .gallery-thumbnails img{width:62px;height:46px}
}
@media(max-height:500px) and (orientation:landscape){.gallery-stage{height:45dvh;min-height:0}.gallery-thumbnails{display:none}.gallery-header{margin-bottom:8px}.gallery-controls{margin-top:5px}.gallery-dialog #photo-caption{margin-top:5px}}
@media(prefers-reduced-motion:reduce){.project-photo>img{transition:none}.project-photo:hover>img{transform:none}}

.reference-more{display:flex;justify-content:center;margin-top:28px}.reference-more:has(button[hidden]){display:none}
