/* Published reference catalogue and compact homepage presentation. */
.reference-intro { max-width:760px; }
.reference-intro p, .reference-note, #reference-status { color:var(--muted); line-height:1.8; }
.references-directory { padding-top:clamp(24px,3.5vw,48px); border-bottom:0; }
.reference-group + .reference-group { margin-top:38px; }
.reference-group h2 { margin:0 0 17px; font-size:clamp(20px,2vw,28px); }
.reference-note { margin:0 0 14px; font-size:13px; }
/* Borderless logo gallery: the page itself is the only background. */
.reference-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:clamp(16px,2.4vw,32px); align-items:center; }
.reference-card { min-width:0; width:100%; display:block; padding:0; appearance:none; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--ink); text-align:center; cursor:pointer; }
.reference-logo { position:relative; width:100%; height:clamp(110px,11vw,150px); padding:12px; display:flex; align-items:center; justify-content:center; background:transparent; }
.reference-logo img { display:block; position:absolute; inset:12px; width:calc(100% - 24px); height:calc(100% - 24px); opacity:0; object-fit:contain; filter:grayscale(1); transition:filter .2s; }
/* Accessible fallback for records with no usable logo. */
.reference-logo-fallback { color:var(--muted); font-weight:600; font-size:clamp(14px,1.4vw,18px); line-height:1.25; overflow-wrap:anywhere; }
.reference-card:focus-visible img,.reference-card:hover img,.reference-card:active img { filter:none; }
.home-references { padding:26px 0 30px; background:var(--surface); border-bottom:1px solid var(--line); }
.home-reference-heading { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px 20px; margin-bottom:17px; }
.home-reference-heading h2 { font-size:clamp(20px,2.1vw,28px); }
.home-reference-heading a { color:var(--gold); }
.home-references .reference-logo { height:106px; }
.reference-modal { width:min(680px,calc(100% - 32px)); max-height:88vh; max-height:88dvh; overflow:auto; padding:0; margin:auto; border:1px solid #47525f; border-radius:14px; background:#141a22; color:var(--ink); box-shadow:0 20px 70px #0007; }
.reference-modal::backdrop { background:rgba(3,6,10,.82); }
.reference-modal-body { padding:clamp(20px,3vw,32px); }
.reference-modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.reference-modal-header h2 { font-size:clamp(23px,3vw,31px); overflow-wrap:anywhere; }
.reference-modal-type { font-size:12px; color:var(--gold); margin-bottom:6px; }
.reference-modal-close { flex:none; width:40px; height:40px; border:1px solid var(--line); border-radius:8px; background:#10151d; color:var(--ink); display:grid; place-items:center; font-size:24px; line-height:1; }
.reference-modal-close:hover { border-color:var(--gold); }
.reference-modal .reference-logo { height:132px; max-width:260px; margin:0 auto 23px; }
.reference-modal .reference-logo img { filter:none; }
.reference-modal h3 { font-size:17px; margin-bottom:10px; }
.reference-modal-description { color:var(--muted); line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
body:has(.reference-modal[open]) { overflow:hidden; }
.reference-project { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:clamp(24px,5vw,68px); }
.reference-project img { width:100%; display:block; aspect-ratio:16/10; object-fit:cover; border-radius:12px; border:1px solid var(--line); }
.reference-project p { color:var(--muted); line-height:1.8; }
.reference-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:22px; }
.reference-actions .btn { white-space:normal; }
@media(max-width:1000px){.reference-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:650px){.reference-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.reference-project{grid-template-columns:minmax(0,1fr)}.reference-logo,.home-references .reference-logo{height:100px;padding:12px}.home-references{padding:22px 0}.reference-modal .reference-logo{height:115px}}
@media(prefers-reduced-motion:reduce){.reference-card,.reference-logo img{transition:none}}

.reference-logo img.is-ready{opacity:1}

.reference-project>*{min-width:0}
