.project-gallery { padding-block: 88px; overflow: clip; }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.gallery-heading[id] { scroll-margin-top: 128px; }
.gallery-heading h2 { max-width: 16ch; font-size: clamp(32px, 4vw, 52px); line-height: 1.12; }
.gallery-heading p { max-width: 40ch; font-size: 16px; margin-top: 16px; }
.gallery-heading > div { display: grid; width: 100%; grid-template-columns: minmax(0,1.1fr) auto minmax(0,.9fr); align-items: center; gap: 24px; }
.gallery-heading h2 { max-width: none; font-size: clamp(28px,3.4vw,48px); }
.gallery-heading p { margin-top: 0; }
.gallery-heading-divider { color: #7c9ab8; font-size: 48px; font-weight: 400; }
@media (max-width: 760px) { .gallery-heading > div { grid-template-columns: auto minmax(0,1fr); gap: 12px; } .gallery-heading h2 { grid-column: 1 / -1; } .gallery-heading-divider { font-size: 32px; } }
.gallery-track { display: block; overflow-x: auto; overscroll-behavior-x: contain;  scrollbar-color: var(--blue) var(--ice); scrollbar-width: thin; padding: 8px 0 24px; }
.gallery-track { touch-action: pan-y; cursor: grab; }
.gallery-track.is-dragging { cursor: grabbing; user-select: none; }
.gallery-track.is-dragging * { cursor: grabbing; }
.gallery-project { position: relative; display: flex; flex-direction: column; flex: 0 0 clamp(208px, 24vw, 288px); min-width: 0; scroll-snap-align: start; }
.project-visual { position: relative; display: grid; flex: none; place-items: center; width: 100%; aspect-ratio: 1; background: #edf5f8; overflow: hidden; border-radius: 12px; }
.project-app-icon { display: block; width: 100%; height: 100%; fill: none; }
.app-ice-circuits { fill: none; stroke: #98cee8; stroke-width: .8; opacity: .4; }
.app-pictogram { fill: none; stroke: #98cee8; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.app-icon-badge rect { fill: #10283b; stroke: #98cee8; stroke-opacity: .35; stroke-width: .7; }
.app-icon-badge text, .app-icon-sequence text { fill: #edf6fb; stroke: none; font: 700 8px/1 'Chakra Petch',Manrope,sans-serif; text-anchor: middle; dominant-baseline: middle; }
.app-icon-badge text { letter-spacing: .07em; }
.app-icon-sequence text { font-size: 8.5px; }
.gallery-project h3 { font-size: 20px; margin-top: 20px; }
.gallery-project p { font-size: 14px; margin-top: 8px; margin-bottom: 12px; }
.gallery-open { display: flex; flex: none; justify-content: space-between; align-items: center; width: 100%; padding: 12px 0; margin-top: auto; font: 500 14px/1.5 Manrope, sans-serif; color: var(--blue); background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.gallery-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform 160ms var(--ease-out); }
.project-dialog { width: min(800px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 40px; border: 0; border-radius: 16px; color: var(--ink); background: var(--snow); box-shadow: 0 24px 64px rgba(16,43,63,.28); }
.project-dialog::backdrop { background: rgba(16,43,63,.76); }
.project-dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-bottom: 24px; }
.project-dialog h2 { font-size: 32px; }
.project-dialog-close { flex: 0 0 44px; height: 44px; color: var(--ink); background: var(--ice); border: 0; border-radius: 8px; cursor: pointer; }
.project-dialog-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.project-dialog p { font-size: 16px; }
.project-dialog .caption { font-size: 14px; margin-top: 16px; }
.gallery-modal-open { overflow: hidden; }
@media (max-width: 760px) { .project-gallery { padding-block: 64px; } .gallery-heading { align-items: start; gap: 16px; } .project-dialog { padding: 24px; } .project-dialog h2 { font-size: 28px; } }
@media (max-width: 359px) { .gallery-heading { display: block; } .project-dialog { padding: 20px; } }
.gallery-rail { display: flex; align-items: stretch; width: max-content; gap: 24px; }
.gallery-track.is-looping { scrollbar-width: none; }
.gallery-track.is-looping::-webkit-scrollbar { display: none; }
.gallery-project { width: clamp(208px, 24vw, 288px); }
.gallery-open::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.gallery-open:focus-visible { outline: none; }
.gallery-open:focus-visible::after { outline: 2px solid var(--blue); outline-offset: 3px; }
.gallery-open:disabled { cursor: default; color: var(--muted); }
.project-audit-content > .audit-flow { margin-top: 24px; }
.project-audit-content[hidden], .project-case-content[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .gallery-open:not(:disabled):hover svg { transform: translate(2px,-2px); } }
@media (max-width: 760px) { .gallery-rail { gap: 16px; } }
@media (prefers-reduced-motion: reduce) { .gallery-open svg { transition: none; } }

.gallery-project h3, .gallery-open { font-family: 'Chakra Petch', Manrope, sans-serif; font-weight: 700; }

#project-dialog:not([data-active-slot="01"]) .project-dialog-header h2 { min-width: 0; overflow-wrap: anywhere; }
.project-case-content .project-scope { color: var(--muted); }
.project-case-content > .project-flow { margin-top: 24px; }
.project-flow h3 { font-family: 'Chakra Petch', Manrope, sans-serif; font-weight: 700; }
.project-flow .audit-phase strong { color: var(--snow); }
.project-flow .audit-phase p { color: #b9ccda; }
.project-canvas.audit-canvas { height: auto; }
.project-flow-diagram { display: block; width: 100%; height: auto; max-height: 300px; aspect-ratio: 9 / 7; }
.project-flow-diagram text { fill: #edf6fb; font: 700 15px/1 Manrope, sans-serif; text-anchor: middle; dominant-baseline: middle; }
.project-flow-wiring { fill: none; stroke: #98cee8; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.project-flow-diagram .diagram-node-shape { fill: #10283b; stroke: #98cee8; stroke-width: 1.25; }
.project-flow-diagram .project-flow-input .diagram-node-shape { fill: #e3eef8; }
.project-flow-diagram .project-flow-input text { fill: #202236; }
.project-flow-diagram .diagram-node--primary .diagram-node-shape { fill: #304858; stroke-width: 2; }
.project-flow-core circle, .project-flow-core > path { fill: #304858; stroke: #98cee8; stroke-width: 1.25; }
.project-flow-core .project-flow-halo { fill: none; stroke: #98cee8; stroke-width: 1; }
.diagram-paper-lines { fill: none; stroke: #304858; stroke-width: 1; }
.diagram-grid { fill: none; stroke: #98cee8; stroke-width: 1; }
.diagram-wire-muted { fill: none; stroke: #304858; stroke-width: 1.5; }
.diagram-filter { fill: #304858; stroke: #98cee8; stroke-width: 1; }
.diagram-scan-glow { stroke: #98cee8; stroke-width: 12; opacity: .18; }
.diagram-scan-line { stroke: #98cee8; stroke-width: 2.5; }
.diagram-tunnel { fill: #304858; fill-opacity: .4; stroke: #98cee8; stroke-width: 1; stroke-dasharray: 3 4; }
.diagram-funnel { fill: #304858; fill-opacity: .5; stroke: #98cee8; stroke-width: 1; }
.diagram-cut { fill: none; stroke: #304858; stroke-width: 1.5; stroke-dasharray: 4 4; }
.diagram-scissors { fill: none; stroke: #202236; stroke-width: 1.5; stroke-linecap: round; }
.diagram-sequence { fill: none; stroke: #98cee8; stroke-width: 1.25; stroke-dasharray: 3 3; }
.project-flow-diagram .audit-document { position: static; width: auto; height: auto; padding: 0; border: 0; background: none; }
.project-flow-diagram .audit-outputs { position: static; display: inline; }
.project-flow-diagram .audit-packet { fill: none; stroke: #98cee8; }
.project-flow-description { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
