/* Shared presentation for the seminar and software-project case studies. */
.case-study .case-hero {
 display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
 align-items: center; gap: 56px; padding: 54px 60px 64px;
}
.case-study .case-hero h1 { font-size: clamp(3.75rem, 5.6vw, 5.5rem); line-height: 1.04; margin: 22px 0 28px; }
.case-study .case-hero h1 span { color: var(--accent); }
.case-study .case-hero .label { font-size: .75rem; line-height: 1.8; }
.case-study .case-hero-description { min-width: 0; max-width: 540px; }
.case-study .case-hero-description > p { font-size: 1.125rem; line-height: 1.9; max-width: none; margin: 0; }
.case-study .case-hero .underlined { font-size: .875rem; margin-top: 10px; }
.case-contents {
 display: flex; align-items: center; gap: 30px; padding: 18px 60px;
 overflow-x: auto; background: #f4f2ecf5; border-bottom: 1px solid var(--line);
 position: sticky; top: 0; z-index: 5; scrollbar-width: thin;
}
.case-contents a { flex-shrink: 0; font-size: .8125rem; line-height: 1.6; border-bottom: 1px solid transparent; padding: 3px 0; }
.case-contents a:hover, .case-contents a[aria-current="location"] { color: var(--accent); border-color: var(--accent); }
.case-study .case-chapter { padding: 64px 60px; scroll-margin-top: 70px; }
.case-study .case-chapter h2 { font-size: clamp(2.7rem, 4.2vw, 3.75rem); line-height: 1.12; margin: 0 0 20px; }
.case-study .ua-chapter-heading { max-width: 950px; margin-bottom: 28px; }
.case-study .case-chapter .label { font-size: .75rem; letter-spacing: .09em; margin-bottom: 17px; }
.case-study .case-copy { max-width: 840px; }
.case-study .case-copy p, .case-study p.case-copy,
.case-study .ua-report > div > p:not(.label),
.case-study .ua-limit-grid p, .case-study .ua-method-steps p {
 font-size: 1rem; line-height: 1.9;
}
.case-study .case-copy p { margin-bottom: 20px; }
.case-study .ua-copy .ua-insight { font-size: 1.8rem; line-height: 1.4; }
.case-study .ua-source-note { font-size: .875rem !important; line-height: 1.8; }
.case-study .ua-method-steps span { font-size: 1rem; font-weight: 500; }
.case-study .ua-limit-grid h3 { font-size: 1.25rem; }
.case-study .case-research-scope {
 margin: 30px 0; padding: 24px 0; background: transparent;
 border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.case-study .case-research-scope strong { font-size: 2.5rem; }
.case-study .case-research-scope span { font-size: .8125rem; }
.case-study .case-figure { min-width: 0; }
.case-study .ua-figure { margin: 32px auto 0; max-width: 1100px; }
.case-study .ua-map { max-width: 760px; }
.case-study .case-image-link {
 display: block; position: relative; padding: 12px; background: #fff;
 border: 1px solid #d7dbd2; cursor: zoom-in;
 transition: box-shadow .25s, transform .25s;
}
.case-study .case-image-link:hover { box-shadow: 0 12px 28px #293e2c15; transform: translateY(-3px); }
.case-study .case-image-link img { display: block; width: 100%; height: auto; object-fit: contain; }
.case-study .case-figure figcaption { padding-top: 12px; font-size: .875rem; line-height: 1.7; color: var(--muted); }
.case-study .case-figure figcaption a { font-size: inherit; }
.case-study .case-figure.reveal-ready { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.case-study .case-figure.reveal-ready.is-visible { opacity: 1; transform: none; }
.case-study .case-ending { background: #283d31; color: var(--paper); }
.case-study .case-ending p, .case-study .case-ending figcaption span { color: #d0dacb; }
.case-study .case-ending .label { color: #c4d0bd; }
.case-study .case-ending a { color: var(--paper); }
.case-study .case-ending .underlined { border-color: #9cad94; font-size: .875rem; }
.case-study .case-ending .certificate-card figcaption { font-size: .875rem; }
.case-study .case-ending .certificate-card figcaption strong,
.case-study .case-ending .certificate-card figcaption span,
.case-study .case-ending .certificate-card figcaption > a { font-size: inherit; }

/* The controls sit outside the image window, matching the artefacts viewer. */
.case-viewer-open { overflow: hidden; }
.case-lightbox { width: min(1420px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 32px); border: 0; padding: 0; color: var(--ink); background: transparent; overflow: visible; }
.case-lightbox[open] { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 16px; animation: case-viewer-appear .2s ease; }
.case-lightbox::backdrop { background: #13231ce8; backdrop-filter: blur(5px); }
.case-viewer-arrow, .case-viewer-close { border: 0; cursor: pointer; display: grid; place-items: center; color: var(--ink); background: var(--paper); padding: 10px; min-width: 44px; min-height: 44px; }
.case-viewer-arrow { width: 48px; height: 48px; border: 1px solid #ced8c6; border-radius: 50%; }
.case-viewer-arrow:hover { background: #d8e3cd; }
.case-viewer-arrow svg, .case-viewer-close svg { width: 24px; height: 24px; }
.case-viewer-panel { max-height: calc(100dvh - 32px); background: var(--paper); overflow: auto; box-shadow: 0 20px 80px #0005; min-width: 0; }
.case-viewer-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 20px; align-items: center; padding: 10px 14px 10px 22px; border-bottom: 1px solid var(--line); }
.case-viewer-toolbar h2 { font-family: 'DM Sans', Arial, sans-serif; font-size: 1rem; line-height: 1.5; letter-spacing: 0; font-weight: 500; margin: 0; }
#case-viewer-position { font-size: .8125rem; white-space: nowrap; }
.case-viewer-image { display: flex; justify-content: center; padding: 18px; background: #e2e6dc; overflow: auto; touch-action: pan-y pinch-zoom; }
.case-viewer-image img { display: block; max-width: 100%; max-height: calc(100dvh - 240px); object-fit: contain; width: auto; height: auto; user-select: none; -webkit-user-drag: none; }
.case-viewer-bottom { padding: 16px 22px 20px; display: flex; justify-content: space-between; align-items: start; gap: 22px; }
.case-viewer-bottom p { font-size: .875rem; line-height: 1.75; margin: 0; max-width: 850px; }
.case-viewer-bottom a { font-size: .8125rem; line-height: 1.7; text-decoration: underline; text-underline-offset: 4px; flex-shrink: 0; }
@keyframes case-viewer-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) {
 .case-study .case-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; padding-left: 35px; padding-right: 35px; }
 .case-study .case-hero h1 { font-size: 4rem; }
 .case-study .case-chapter, .case-contents { padding-left: 35px; padding-right: 35px; }
}
@media (max-width: 760px) {
 .case-study .case-hero { grid-template-columns: 1fr; padding: 35px 22px 40px; gap: 32px; }
 .case-study .case-hero h1 { font-size: clamp(3.5rem, 11vw, 4.75rem); }
 .case-study .case-hero-description { max-width: 600px; }
 .case-contents { padding: 14px 22px; gap: 24px; }
 .case-study .case-chapter { padding: 45px 22px; scroll-margin-top: 64px; }
 .case-study .case-chapter h2 { font-size: clamp(2.3rem, 8vw, 3rem); }
 .case-study .case-image-link { padding: 7px; }
 .case-study .case-research-scope { padding: 22px 0; }
 .case-study .case-research-scope > div { gap: 20px; }
 .case-lightbox { width: calc(100vw - 12px); max-height: calc(100dvh - 20px); }
 .case-lightbox[open] { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px; }
 .case-viewer-arrow { width: 40px; height: 44px; min-width: 40px; padding: 8px; border-radius: 22px; }
 .case-viewer-panel { max-height: calc(100dvh - 20px); }
 .case-viewer-toolbar { gap: 8px; padding: 8px 6px 8px 12px; }
 .case-viewer-toolbar h2 { font-size: .875rem; }
 #case-viewer-position { font-size: .75rem; }
 .case-viewer-image { padding: 8px; }
 .case-viewer-image img { max-height: 65dvh; }
 .case-viewer-bottom { display: block; padding: 14px; }
 .case-viewer-bottom a { display: inline-block; margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
 .case-study .case-figure.reveal-ready { opacity: 1; transform: none; transition: none; }
 .case-study .case-image-link:hover { transform: none; }
 .case-lightbox[open] { animation: none; }
}
@media (max-width: 760px) {
 .case-study .case-research-scope { grid-template-columns: 1fr; }
 .case-study .case-research-scope > div { display: flex; align-items: center; }
 .case-study .ua-method-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .case-study .ua-limit-grid, .case-study .ua-report { grid-template-columns: 1fr; }
 .case-study .ua-report-preview { width: 100%; max-width: 360px; justify-self: center; }
}
/* Shared flowing STARR reflections across projects and volunteering. */
.case-study .portfolio-reflection .reflection-copy {
 max-width: 840px; font-size: 1rem; line-height: 1.95; margin: 0;
}
.portfolio-reflection .reflection-copy p { margin: 0 0 20px; }
.portfolio-reflection .reflection-copy p:last-child { margin-bottom: 0; }
