/* Portfolio and its service views: the gallery wall.
   The covers hang whole, each in its own proportions and at its own size, in a twelve-column grid whose
   rows are never shared by more than two pieces. Every piece owns its cell, caption included: nothing is
   positioned, so no cover can ever reach another cover, a caption, the heading or the filter. What moves
   (depth on scroll, the lean towards the pointer) moves the whole piece by a few pixels inside the gap
   that belongs to its cell; the script (work.js) keeps those few pixels under half a gap. */

.od-gal { padding: calc(var(--od-header-h) + clamp(20px, 3.4vw, 52px)) var(--od-gutter) clamp(96px, 11vw, 170px); background: var(--od-bg); }
.od-gal__wall {
	--od-gal-x: clamp(28px, 4.6vw, 76px);
	--od-gal-y: clamp(64px, 7.6vw, 120px);
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--od-gal-x);
	row-gap: var(--od-gal-y);
	align-items: start;
	max-width: var(--od-max);
	margin-inline: auto;
}

/* Heading, introduction and filter: the first cell of the wall */
.od-gal__head { grid-column: 1 / 7; min-width: 0; }
.od-gal__head > * { margin: 0; }
.od-gal__title { margin-top: clamp(14px, 1.6vw, 22px); font-size: clamp(3rem, 7.1vw, 7rem); line-height: 0.98; font-weight: 600; letter-spacing: var(--od-track-display); text-wrap: balance; overflow-wrap: break-word; }
.od-gal[data-od-gal-view="service"] .od-gal__title { font-size: clamp(2.5rem, 5.2vw, 5.25rem); line-height: 1.02; hyphens: auto; }
.od-gal__lead { margin-top: clamp(18px, 2vw, 28px); max-width: 26em; font-size: var(--od-fs-h6); line-height: 1.4; font-weight: 500; color: var(--od-grey-900); }
.od-gal__aside { margin-top: 12px; max-width: 32em; font-size: var(--od-fs-b3); line-height: 1.6; color: var(--od-fg-soft); }
.od-gal__filter { margin-top: clamp(18px, 2.2vw, 30px); }
.od-gal__filter ul { display: flex; flex-wrap: wrap; gap: 0 clamp(16px, 1.7vw, 24px); margin: 0; padding: 0; list-style: none; }
.od-gal__filter a { position: relative; display: inline-flex; align-items: center; min-height: 44px; font-size: var(--od-fs-b4); line-height: 1.3; font-weight: 500; color: var(--od-fg-mute); text-decoration: none; white-space: nowrap; transition: color 0.3s var(--od-ease); }
.od-gal__filter a::before { content: ">"; flex: none; width: 0; overflow: hidden; font-family: var(--od-mono); font-weight: 500; letter-spacing: 0; color: var(--od-brand-text); transition: width 0.45s var(--od-ease), margin-right 0.45s var(--od-ease); }
.od-gal__filter a:hover, .od-gal__filter a[aria-current] { color: var(--od-fg); }
.od-gal__filter a[aria-current]::before { width: 0.62em; margin-right: 0.45em; }
.od-gal__filter a:focus-visible { outline: 2px solid var(--od-brand); outline-offset: 2px; }

/* The pieces. The list itself takes no box: its items are cells of the wall. */
.od-gal__list { display: contents; }
.od-gal__piece { min-width: 0; margin: 0; padding: 0; list-style: none; }
/* A cover that is square or upright does not take the full width of a wide place: no picture stands taller than three quarters of the window. */
.od-gal__link { display: block; max-width: min(100%, calc(76vh * var(--od-gal-ar, 1.5))); color: inherit; text-decoration: none; }
.od-gal__link:focus-visible { outline: 2px solid var(--od-brand); outline-offset: 8px; }
.od-gal__frame { display: block; overflow: hidden; background: var(--od-grey-40); }
.od-gal__frame img { display: block; width: 100%; height: auto; }
.od-gal__frame--empty { aspect-ratio: 3 / 2; }
.od-gal__cap { position: relative; display: flex; flex-direction: column; gap: 4px; padding-top: 16px; }
.od-gal__cap::before { content: ">"; position: absolute; left: 0; top: -4px; font-family: var(--od-mono); font-weight: 500; letter-spacing: 0; font-size: 13px; line-height: 1; color: var(--od-brand-text); opacity: 0; translate: -6px 0; transition: opacity 0.3s var(--od-ease), translate 0.5s var(--od-ease); }
.od-gal__client { font-size: var(--od-fs-b4); line-height: 1.4; font-weight: 600; color: var(--od-fg); }
.od-gal__name { font-size: clamp(1.125rem, 0.95rem + 0.55vw, 1.5rem); line-height: 1.22; font-weight: 600; letter-spacing: var(--od-track); color: var(--od-grey-900); text-wrap: pretty; overflow-wrap: break-word; transition: color 0.3s var(--od-ease); }
.od-gal__meta { margin-top: 2px; font-size: var(--od-fs-b5); line-height: 1.7; color: var(--od-fg-mute); }
.od-gal__meta data:not(.od-gal__tag) + data:not(.od-gal__tag)::before { content: ", "; }
.od-gal__tag { display: inline-block; margin-left: 10px; padding: 0 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.86em; line-height: 1.55; font-weight: 500; white-space: nowrap; }
.od-gal__place { margin-left: 10px; }
.od-gal__meta time { margin-left: 10px; font-variant-numeric: tabular-nums; }

/* Places on the wall, wide screens. The first piece stands beside the heading; the others follow a run of
   nine: two, two, one alone, two, two. A piece is never as wide as its row, and each steps down a little
   from its neighbour, so no line runs through a row. */
.od-gal__piece:nth-child(1) { grid-column: 7 / 13; }
.od-gal__piece:nth-child(9n + 2) { grid-column: 1 / 6; }
.od-gal__piece:nth-child(9n + 3) { grid-column: 8 / 12; margin-top: clamp(40px, 7vw, 120px); }
.od-gal__piece:nth-child(9n + 4) { grid-column: 1 / 5; margin-top: clamp(30px, 5vw, 90px); }
.od-gal__piece:nth-child(9n + 5) { grid-column: 6 / 13; }
.od-gal__piece:nth-child(9n + 6) { grid-column: 3 / 11; }
.od-gal__piece:nth-child(9n + 7) { grid-column: 1 / 8; }
.od-gal__piece:nth-child(9n + 8) { grid-column: 9 / 13; margin-top: clamp(50px, 9vw, 150px); }
.od-gal__piece:nth-child(9n + 9) { grid-column: 2 / 6; margin-top: clamp(20px, 3vw, 56px); }
.od-gal__piece:nth-child(9n + 10) { grid-column: 7 / 12; }

/* The pointed piece comes forward: its picture draws nearer inside its frame, the others stand back. */
.od-gal__frame img { transition: scale 0.9s var(--od-ease), opacity 0.45s var(--od-ease); }
.od-gal__cap { transition: opacity 0.45s var(--od-ease); }
@media (hover: hover) and (pointer: fine) {
	.od-gal__wall.has-lit .od-gal__piece:not(.is-lit) .od-gal__frame img { opacity: 0.4; }
	.od-gal__wall.has-lit .od-gal__piece:not(.is-lit) .od-gal__cap { opacity: 0.55; }
	.od-gal__piece.is-lit .od-gal__frame img { scale: 1.04; }
}
.od-gal__piece.is-lit .od-gal__cap::before, .od-gal__link:focus-visible .od-gal__cap::before { opacity: 1; translate: none; }
.od-gal__piece.is-lit .od-gal__name, .od-gal__link:focus-visible .od-gal__name { color: var(--od-fg); }

/* Arrival. Pieces still below the screen wait closed; the script opens each one as it comes into view,
   with the wipe and the settling of every other picture on the site. What is on screen when the page
   opens is simply there. */
.od-gal--live .od-gal__frame img { transition: clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--od-gal-wait, 0ms), scale 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--od-gal-wait, 0ms), opacity 0.45s var(--od-ease); }
.od-gal--live .od-gal__cap { transition: opacity 0.5s var(--od-ease) var(--od-gal-wait, 0ms), translate 0.7s cubic-bezier(0.16, 1, 0.3, 1) var(--od-gal-wait, 0ms); }
.od-gal--live .od-gal__piece.is-wait .od-gal__frame { background: transparent; }
.od-gal--live .od-gal__piece.is-wait .od-gal__frame img { clip-path: inset(100% 0 0 0); scale: 1.06; }
.od-gal--live .od-gal__piece.is-wait .od-gal__cap { opacity: 0; translate: 0 10px; }
/* A filter change: the wall is taken down, then hung again. */
.od-gal__wall.is-leaving .od-gal__piece { opacity: 0; transition: opacity 0.22s linear; }
.od-gal__wall.is-leaving .od-gal__more { opacity: 0; transition: opacity 0.22s linear; }

/* More projects */
/* "Load more": the site's plain arrow link, on the left (the owner, 21 October 2026) */
.od-gal__more { grid-column: 1 / -1; display: flex; justify-content: flex-start; margin: 0; padding-top: 28px; border-top: 1px solid var(--od-line); }
.od-gal__next[aria-busy="true"] { color: var(--od-fg-mute); cursor: progress; }
@keyframes od-gal-loading { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* The way back from a case study: the hero shrinks to the picture it came from (named by the head script). */
@media (prefers-reduced-motion: no-preference) {
	::view-transition-group(od-cs-hero) { overflow: clip; animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.4, 0, 0.1, 1); }
	::view-transition-old(od-cs-hero), ::view-transition-new(od-cs-hero) { height: 100%; object-fit: cover; mix-blend-mode: normal; animation-duration: 0.6s; animation-timing-function: linear; }
	::view-transition-old(od-cs-hero) { animation-name: od-gal-hero-out; }
	::view-transition-new(od-cs-hero) { animation-name: od-gal-hero-in; }
}
/* The hero's picture is cut to its frame; it gives way to the whole cover once the frame is nearly home, when the two are cut alike. */
@keyframes od-gal-hero-out { 0%, 62% { opacity: 1; } 86%, 100% { opacity: 0; } }
@keyframes od-gal-hero-in { 0%, 62% { opacity: 0; } 86%, 100% { opacity: 1; } }
/* On that arrival nothing on the wall waits or moves by itself. */
html.od-gal-back .od-gal__piece.is-wait .od-gal__frame img { clip-path: none; scale: 1; }
html.od-gal-back .od-gal__piece.is-wait .od-gal__cap { opacity: 1; translate: none; }
html.od-gal-back .od-gal__piece[data-od-first] { animation: none !important; }

/* Tablets: six columns. The heading takes a row, then one piece, then pairs and single pieces in turn. */
@media (max-width: 1024px) {
	.od-gal__wall { grid-template-columns: repeat(6, minmax(0, 1fr)); --od-gal-x: clamp(24px, 4vw, 40px); --od-gal-y: clamp(56px, 8vw, 80px); }
	.od-gal__head { grid-column: 1 / -1; }
	.od-gal__piece:nth-child(n) { grid-column: 1 / -1; margin-top: 0; }
	.od-gal__piece:nth-child(3n + 2) { grid-column: 1 / 4; }
	.od-gal__piece:nth-child(3n + 3) { grid-column: 4 / 7; margin-top: clamp(40px, 9vw, 90px); }
	.od-gal__piece:nth-child(3n + 4) { grid-column: 2 / 7; }
}
/* Phones: one column, each piece its own row, at changing widths and sides. */
@media (max-width: 600px) {
	.od-gal { padding-top: calc(var(--od-header-h) + 28px); }
	.od-gal__wall { grid-template-columns: minmax(0, 1fr); --od-gal-y: 52px; }
	.od-gal__head, .od-gal__piece:nth-child(n) { grid-column: 1; margin-top: 0; }
	.od-gal__piece:nth-child(4n + 2) { width: 84%; justify-self: end; }
	.od-gal__piece:nth-child(4n + 3) { width: 74%; }
	.od-gal__piece:nth-child(4n + 4) { width: 92%; justify-self: end; }
	.od-gal__filter ul { column-gap: 18px; }
	.od-gal__name { font-size: 1.125rem; }
}

@media (prefers-reduced-motion: reduce) {
	.od-gal__frame img, .od-gal__cap, .od-gal__cap::before, .od-gal__name, .od-gal__filter a, .od-gal__filter a::before, .od-gal__next, .od-gal__next::after { transition: none; animation: none; }
	.od-gal__piece.is-lit .od-gal__frame img { scale: none; }
	.od-gal__link { transform: none !important; }
}

/* Printed: the wall whole, in place, without the link to more. */
@media print {
	.od-gal { padding-top: 0; }
	.od-gal__piece { break-inside: avoid; }
	.od-gal__link { transform: none !important; }
	.od-gal__piece.is-wait .od-gal__frame img { clip-path: none !important; scale: 1 !important; }
	.od-gal__piece.is-wait .od-gal__cap { opacity: 1 !important; translate: none !important; }
	.od-gal__more { display: none !important; }
}


/* More air on the wall (8 November 2026). */
.od-gal__wall { --od-gal-y: clamp(64px, 11vw, 190px); }
@media (max-width: 999px) { .od-gal__wall { --od-gal-y: clamp(56px, 10vw, 104px); } }

/* The Portfolio as a gallery (the owner's mock-up of 8 November 2026): the heading across the page with an orange line,
   the introduction and the filter under it, three upright pictures to a row, the words over a picture under the pointer. */
.od-gal { padding: calc(var(--od-header-h) + clamp(24px, 2.6vw, 40px)) clamp(20px, 2.1vw, 30px) clamp(96px, 11vw, 170px); }
.od-gal__wall { --od-gal-x: 12px; --od-gal-y: 12px; }
.od-gal__head { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(14px, 1.2vw, 20px); align-items: center; margin-bottom: clamp(16px, 1.8vw, 28px); }
.od-gal__head .od-label, .od-gal__aside { display: none; }
.od-gal__title, .od-gal[data-od-gal-view="service"] .od-gal__title { grid-column: 1; grid-row: 1; margin: 0; font-family: var(--od-mono); font-size: clamp(30px, 3.5vw, 54px); line-height: 1.15; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; hyphens: none; }
.od-gal__head::after { content: ""; grid-column: 2; grid-row: 1; height: 1px; background: var(--od-brand); }
.od-gal__lead { grid-column: 1 / span 2; grid-row: 2; margin-top: clamp(18px, 1.8vw, 28px); max-width: 34em; font-family: var(--od-mono); font-size: clamp(13px, 1.05vw, 17px); line-height: 1.4; font-weight: 400; letter-spacing: 0.03em; color: var(--od-fg); }
.od-gal__filter { grid-column: 1 / span 2; grid-row: 2; justify-self: end; align-self: end; margin: 0; }
.od-gal__filter ul { gap: 0 clamp(14px, 1.3vw, 22px); justify-content: flex-end; }
.od-gal__filter a { font-family: var(--od-mono); font-size: clamp(13px, 1.05vw, 17px); font-weight: 400; letter-spacing: 0.03em; color: var(--od-fg); }
.od-gal__filter a[aria-current] { font-weight: 500; box-shadow: inset 0 -1px 0 var(--od-brand); }
.od-gal__filter a[aria-current]::before { margin-right: 0.1em; color: var(--od-fg); }
.od-gal__wall .od-gal__piece:nth-child(n) { grid-column: span 4; grid-row: auto; justify-self: stretch; margin: 0; width: auto; translate: none !important; transform: none !important; }
.od-gal__wall .od-gal__link { position: relative; max-width: none; }
.od-gal__wall .od-gal__frame { position: relative; aspect-ratio: 390 / 466; background: #111; }
.od-gal__wall .od-gal__frame img, .od-gal__wall .od-gal__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.od-gal__wall .od-gal__link[href*="da-fonk"] .od-gal__frame img { object-position: 22% 50%; }
.od-gal__wall .od-gal__cap { position: absolute; inset: auto 0 0; gap: 10px; padding: clamp(40px, 5vw, 80px) clamp(16px, 1.3vw, 22px) clamp(16px, 1.5vw, 24px); background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.55) 55%, transparent); color: var(--od-white); opacity: 0; transition: opacity 0.35s var(--od-ease); pointer-events: none; }
.od-gal__wall .od-gal__cap::before, .od-gal__wall .od-gal__client, .od-gal__wall .od-gal__tag, .od-gal__wall .od-gal__place, .od-gal__wall .od-gal__meta time { display: none; }
.od-gal__wall .od-gal__name { font-family: var(--od-mono); font-size: clamp(18px, 1.75vw, 28px); line-height: 1.22; font-weight: 500; letter-spacing: 0.01em; color: var(--od-white); }
.od-gal__wall .od-gal__meta { margin: 0; font-family: var(--od-mono); font-size: clamp(12px, 0.95vw, 15px); letter-spacing: 0.03em; color: rgba(255, 255, 255, 0.82); text-transform: lowercase; }
.od-gal__wall .od-gal__link:hover .od-gal__cap, .od-gal__wall .od-gal__link:focus-visible .od-gal__cap { opacity: 1; }
.od-gal__wall .od-gal__more { grid-column: 1 / -1; margin-top: clamp(32px, 3.6vw, 56px); }
@media (hover: none) { .od-gal__wall .od-gal__cap { opacity: 1; } }
@media (max-width: 999px) { .od-gal__wall .od-gal__piece:nth-child(n) { grid-column: span 6; } .od-gal__filter { grid-row: 3; justify-self: start; margin-top: 12px; } .od-gal__filter ul { justify-content: flex-start; } }
@media (max-width: 699px) { .od-gal__wall .od-gal__piece:nth-child(n) { grid-column: 1 / -1; } }
.od-gal__wall .od-gal__link, .od-gal__wall .od-gal__frame { translate: none !important; transform: none !important; rotate: none !important; }
/* Hover as in Selected works: only the picture under the pointer shows its words, and nothing else changes. */
.od-gal__wall.has-lit .od-gal__piece:not(.is-lit) .od-gal__cap { opacity: 0; }
.od-gal__wall.has-lit .od-gal__piece:not(.is-lit) .od-gal__frame, .od-gal__wall.has-lit .od-gal__piece:not(.is-lit) .od-gal__frame img { opacity: 1; filter: none; }
.od-gal__wall .od-gal__piece.is-lit .od-gal__cap { opacity: 0; }
.od-gal__wall .od-gal__piece .od-gal__link:hover .od-gal__cap, .od-gal__wall .od-gal__piece .od-gal__link:focus-visible .od-gal__cap { opacity: 1; }
.od-gal__wall .od-gal__piece.is-lit .od-gal__frame img { scale: 1; }
/* The words stay white under the pointer, over a darker picture. */
.od-gal__wall .od-gal__piece .od-gal__name, .od-gal__wall .od-gal__piece .od-gal__link:hover .od-gal__name, .od-gal__wall .od-gal__piece.is-lit .od-gal__name, .od-gal__wall .od-gal__piece .od-gal__link:focus-visible .od-gal__name { color: var(--od-white); }
.od-gal__wall .od-gal__cap { background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.72) 55%, transparent); }
.od-gal__wall .od-gal__frame img { transition: filter 0.35s var(--od-ease); }
.od-gal__wall .od-gal__link:hover .od-gal__frame img, .od-gal__wall .od-gal__link:focus-visible .od-gal__frame img { filter: brightness(0.72); }
/* Section titles in sentence case (the owner's word, 8 November 2026). */
.od-gal__title, .od-gal[data-od-gal-view="service"] .od-gal__title { text-transform: none; letter-spacing: 0.02em; }
.od-gal__title, .od-gal[data-od-gal-view="service"] .od-gal__title, .od-gal__lead, .od-gal__filter a, .od-gal__wall .od-gal__name, .od-gal__wall .od-gal__meta { letter-spacing: var(--od-track, -0.02em); }
.od-gal__title, .od-gal[data-od-gal-view="service"] .od-gal__title { font-weight: 600; }
