.gude-refs {color:var(--navy)}
.refs-intro {background:var(--cream);padding:clamp(3rem,7vw,6rem) 1.2rem 3rem}
.refs-intro .hero-title {margin:.4rem 0 1rem;animation:none}
.refs-intro p,.refs-story p {max-width:60ch;line-height:1.65}
.refs-list {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:2rem 1.5rem;padding:2rem 0 4rem;width:min(calc(100% - 2.4rem),1200px);margin:auto}
.refs-project summary {display:block;cursor:pointer;list-style:none}
.refs-project summary::-webkit-details-marker {display:none}
.refs-project summary:focus-visible,.refs-dialog button:focus-visible {outline:3px solid var(--blue);outline-offset:4px}
.refs-cover {display:block;width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:var(--radius-xl,24px)}
.refs-caption {padding:.9rem .25rem}
.refs-meta {font-size:.85rem;font-weight:800}
.refs-caption h2,.refs-story h2 {line-height:1.12;margin:.45rem 0 .7rem;color:inherit;font-size:clamp(1.45rem,2.4vw,2.2rem)}
.refs-more {text-decoration:underline;text-underline-offset:.22em;font-weight:800}
.refs-project:first-child {grid-column:1/-1;color:white;background:var(--navy);border-radius:var(--radius-xl,24px);overflow:hidden}
.refs-project:first-child summary {display:grid;grid-template-columns:1.25fr 1fr;align-items:center}
.refs-project:first-child .refs-cover {border-radius:0;max-height:26rem}
.refs-project:first-child .refs-caption {padding:clamp(1.2rem,4vw,3.5rem)}
.refs-project:first-child .refs-caption h2 {font-size:clamp(2rem,4vw,3.6rem)}
.refs-project:first-child .refs-more {display:inline-block;margin-top:1.2rem;color:var(--yellow)}
.refs-dialog {position:fixed;inset:0;margin:auto;border:none;border-radius:1.4rem;padding:0;width:min(52rem,94vw);max-height:90vh;max-height:90dvh;overflow:auto;color:var(--navy);overscroll-behavior:contain}
.refs-dialog::backdrop {background:rgba(10,28,49,.75)}
.refs-dialog form {position:sticky;top:0;z-index:1;background:white;padding:.6rem 1.2rem;text-align:right}
.refs-dialog button {background:var(--navy);color:white;border:0;border-radius:2rem;padding:.7rem 1.1rem;font:inherit;cursor:pointer}
.refs-story {padding:1.2rem clamp(1.2rem,4vw,2.5rem) 2rem;color:var(--navy);background:white}
.refs-story p,.refs-story h3 {margin:.8rem 0}
.refs-links {display:flex;flex-wrap:wrap;gap:.5rem;list-style:none;padding:0;margin:.8rem 0 1.5rem}
.refs-links a {display:block;border-radius:2rem;background:var(--cream);padding:.5rem .9rem;color:var(--navy);font-weight:700}
.refs-gallery {display:grid;gap:1rem}
.refs-gallery img {display:block;width:100%;max-height:70vh;object-fit:contain;background:var(--cream);border-radius:1rem}
@media(max-width:900px){.refs-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.refs-list,.refs-project:first-child summary{grid-template-columns:1fr}.refs-list{gap:1.4rem}.refs-dialog{width:100%;max-width:100%;max-height:100dvh;border-radius:0}.refs-dialog form{padding-top:max(.6rem,env(safe-area-inset-top))}}

/* Project viewer: the photograph and the story share the first screen. */
.refs-dialog {width:min(65rem,94vw);background:var(--cream);box-shadow:0 20px 90px #10274355}
.refs-dialog form {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.65rem 1.3rem;background:var(--navy);color:white}
.refs-brand {font-size:.82rem;font-weight:800;letter-spacing:.04em}
.refs-brand b {margin:0 .45rem;color:var(--yellow)}
.refs-dialog form button,.refs-dialog .refs-pager button {display:grid;place-content:center;width:44px;height:44px;padding:0;border-radius:50%;background:white;color:var(--navy);font:700 1.7rem/1 sans-serif}
.refs-dialog form button:hover,.refs-dialog .refs-pager button:hover {background:var(--yellow)}
.refs-dialog .refs-story {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:center;padding:0;background:var(--cream)}
.refs-dialog .refs-media {grid-column:1;grid-row:1;min-width:0;padding:clamp(1rem,2.5vw,2rem)}
.refs-dialog .refs-gallery {place-items:center}
.refs-dialog .refs-gallery img {width:auto;height:auto;max-width:100%;max-height:min(60vh,32rem);aspect-ratio:auto;border-radius:.85rem;background:transparent}
.refs-dialog .refs-gallery img[hidden],.refs-pager[hidden]{display:none}
.refs-dialog .refs-copy {grid-column:2;grid-row:1;align-self:stretch;display:flex;flex-direction:column;justify-content:center;background:white;min-width:0;padding:clamp(1.3rem,3vw,2.8rem)}
.refs-dialog .refs-copy h2 {font-size:clamp(1.85rem,3vw,2.85rem);text-wrap:balance}
.refs-dialog .refs-copy p {margin:.4rem 0}
.refs-dialog .refs-copy h3 {margin:1.25rem 0 .4rem}
.refs-dialog .refs-links {margin:.35rem 0 0}
.refs-dialog .refs-pager:not([hidden]) {display:flex;align-items:center;justify-content:center;gap:1rem;margin:.8rem 0 0;font-weight:800}

html:has(.refs-dialog[open]) {overflow:hidden}
@media(max-width:700px){
 .refs-dialog {width:min(100%,32rem);max-height:100dvh}
 .refs-dialog .refs-story {display:flex;flex-direction:column;align-items:stretch}
 .refs-dialog .refs-media {order:-1;padding:1rem 1.2rem}
 .refs-dialog .refs-gallery img {max-height:min(44dvh,22rem)}
 .refs-dialog .refs-copy {padding:1.25rem 1.2rem max(1.5rem,env(safe-area-inset-bottom))}
 .refs-dialog form {padding:max(.45rem,env(safe-area-inset-top)) 1.2rem .45rem}
}
