/* What the new site adds to the old one's CSS (wp.css, verbatim): the self-hosted font and the portfolio. */

/* IBM Plex Sans, as Google Fonts served it to the old site (variable, latin), now from this site (playbook: fonts self-hosted). */
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 100 700;
	font-stretch: 100%;
	font-display: swap;
	src: url(/fonts/ibm-plex-sans-latin-normal.woff2) format("woff2");
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: italic;
	font-weight: 100 700;
	font-stretch: 100%;
	font-display: swap;
	src: url(/fonts/ibm-plex-sans-latin-italic.woff2) format("woff2");
}

/* Where Fluid core loads (new pages), keep the old frame's look: dark only, headings in the text colour. */
html { color-scheme: dark; }
.ag-work-page h1, .ag-work-page h2, .ag-work-page h3 { color: inherit; }
body { overflow-wrap: break-word; }

/* ---------- Portfolio: the wall (/work/) and client pages (/work/<slug>/) ---------- */
:root {
	--ag-red: #e8202a; /* the logo's red */
	--ag-ink: #fff;
	--ag-muted: #9a9a9a;
	--ag-line: rgba(255, 255, 255, 0.14);
	--ag-paper: #f3f1ec; /* behind a logo in colour, so dark marks read */
	--ag-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ag-work-page .site-main { padding-top: 0; }
.ag-work, .ag-client {
	max-width: none;
	margin: 0 auto;
	padding: clamp(2rem, 6vw, 6rem) clamp(16px, 5vw, 80px) clamp(3rem, 8vw, 8rem);
}
.ag-work > *, .ag-client > * { max-width: 1440px; margin-left: auto; margin-right: auto; }
.ag-work__head {
	display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: 1.25rem; border-bottom: 1px solid var(--ag-line);
}
.ag-work .ag-work__title, .ag-client .ag-client__title {
	margin: 0; font-weight: 700; letter-spacing: -0.04em; line-height: 0.9;
}
.ag-work .ag-work__title { font-size: clamp(3rem, 11vw, 9rem); }
.ag-work .ag-work__count { margin: 0; color: var(--ag-muted); font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* Filters */
.ag-filters { margin-bottom: clamp(2rem, 5vw, 4rem); }
.ag-filters__row { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; padding: 0; }
.ag-filters__row > li { margin: 0; }
.ag-work button.ag-chip {
	font: inherit; font-size: 0.8125rem; letter-spacing: 0.06em; line-height: 1;
	padding: 0.6rem 0.95rem; min-height: 2.25rem; border-radius: 999px;
	color: var(--ag-ink); background: transparent; border: 1px solid var(--ag-line); cursor: pointer;
	transition: background 200ms, color 200ms, border-color 200ms;
}
.ag-work button.ag-chip:hover { border-color: var(--ag-ink); }
.ag-work button.ag-chip[aria-pressed="true"] { background: var(--ag-ink); color: #000; border-color: var(--ag-ink); }
.ag-work button.ag-chip--quiet { color: var(--ag-muted); border-color: transparent; padding-inline: 0.6rem; }
.ag-work button.ag-chip--quiet:hover { color: var(--ag-ink); border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }
.ag-work button.ag-chip--quiet[aria-pressed="true"] { background: transparent; color: var(--ag-ink); border-color: transparent; text-decoration: underline; text-decoration-color: var(--ag-red); text-underline-offset: 4px; }
.ag-chip:focus-visible, .ag-wall__link:focus-visible { outline: 2px solid var(--ag-red); outline-offset: 4px; }

/* The wall: logos in one colour, no frames, spaced on a grid */
.ag-wall {
	list-style: none; margin: 0 auto; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	gap: clamp(0.5rem, 1.5vw, 1.25rem);
}
.ag-wall__item { margin: 0; }
.ag-wall__item[hidden] { display: none; }
.ag-work .ag-wall__link {
	position: relative; display: grid; grid-template-rows: 1fr auto auto; grid-template-columns: minmax(0, 1fr); gap: 0.35rem;
	aspect-ratio: 4 / 3; padding: 1.25rem 1.25rem 1rem; border-radius: 6px;
	color: var(--ag-ink); text-decoration: none; overflow: hidden;
	transition: background 450ms var(--ag-ease), color 450ms var(--ag-ease);
}
.ag-wall__mark { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 100%; min-width: 0; min-height: 0; }
.ag-wall__logo { grid-area: 1 / 1; min-width: 0; max-width: min(88%, 15rem); max-height: 64px; width: auto; height: auto; object-fit: contain; transition: filter 450ms var(--ag-ease), opacity 450ms var(--ag-ease); }
.ag-wall__logo.is-mono { filter: brightness(0) invert(1); opacity: 0.86; }
.ag-wall__logo.is-hover-only { opacity: 0; }
.ag-wall__word {
	grid-area: 1 / 1; font-size: clamp(1.1rem, 1.6vw, 1.45rem); font-weight: 600; letter-spacing: -0.01em;
	text-align: center; overflow-wrap: normal; word-break: normal; hyphens: none; transition: opacity 450ms var(--ag-ease);
}
.ag-wall__name, .ag-wall__meta { min-width: 0; overflow-wrap: anywhere; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.3; }
.ag-wall__meta { color: var(--ag-muted); transition: color 450ms var(--ag-ease); }
.ag-work .ag-wall__link:hover, .ag-work .ag-wall__link:focus-visible { background: var(--ag-paper); color: #111; }
.ag-wall__link:hover .ag-wall__meta, .ag-wall__link:focus-visible .ag-wall__meta { color: #555; }
.ag-wall__link:hover .ag-wall__logo, .ag-wall__link:focus-visible .ag-wall__logo { filter: none; opacity: 1; }
.ag-wall__link:hover .ag-wall__logo.is-hover-only ~ .ag-wall__word,
.ag-wall__link:focus-visible .ag-wall__logo.is-hover-only ~ .ag-wall__word { opacity: 0; }

/* The preview that follows the pointer (work.js) */
.ag-peek {
	position: fixed; top: 0; left: 0; z-index: 50; width: min(420px, 34vw); margin: 0; pointer-events: none;
	opacity: 0; transition: opacity 250ms var(--ag-ease);
}
.ag-peek.is-on { opacity: 1; }
.ag-work .ag-peek img { display: block; max-width: 100%; margin: 0; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.ag-work .ag-peek figcaption { text-align: left; display: grid; gap: 0.2rem; margin-top: 0.6rem; padding: 0.6rem 0.75rem; border-radius: 6px; background: rgba(0, 0, 0, 0.82); font-size: 0.8125rem; color: var(--ag-ink); }
.ag-peek__facts { color: var(--ag-muted); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ag-peek__facts:empty { display: none; }

/* Client page */
.ag-client__back { margin: 0 0 2rem; font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ag-client__back a { color: var(--ag-muted); text-decoration: none; }
.ag-client__back a:hover { color: var(--ag-ink); }
.ag-client__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: 1.5rem 4rem; align-items: end; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.ag-client .ag-client__title { grid-column: 1 / -1; font-size: clamp(1.5rem, min(9vw, calc(165vw / var(--n, 12))), 8rem); overflow-wrap: anywhere; hyphens: none; }
.ag-client .ag-client__line { margin: 0; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.4; color: #ddd; max-width: 34ch; }
.ag-client__facts { margin: 0; display: grid; gap: 0.75rem; font-size: 0.875rem; }
.ag-client__facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--ag-line); }
.ag-client__facts dt { color: var(--ag-muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; }
.ag-client__facts dd { margin: 0; }
.ag-client__visit { grid-column: 2; margin: 0; }
.ag-client__visit a { color: var(--ag-ink); text-decoration: underline; text-decoration-color: var(--ag-red); text-underline-offset: 5px; }

/* Counted facts and what is unique */
.ag-client__about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem 4rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--ag-line); }
.ag-client .ag-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
.ag-stats li { margin: 0; display: grid; gap: 0.25rem; }
.ag-stats__value { font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ag-stats__label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ag-muted); max-width: 16ch; }
.ag-client .ag-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.ag-features li { margin: 0; padding-left: 1.25rem; position: relative; line-height: 1.45; }
.ag-features li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--ag-red); }
.ag-client .ag-client__managed { grid-column: 1 / -1; margin: 0; color: #ddd; }
.ag-client__managed span { margin-right: 0.75rem; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ag-muted); }

/* Masonry of curated screenshots (CSS columns: no script, keeps the order top to bottom) */
.ag-client .ag-masonry { display: block; list-style: none; margin: 0 auto; padding: 0; column-count: 3; column-gap: clamp(0.75rem, 1.6vw, 1.5rem); }
.ag-masonry__item { break-inside: avoid; margin: 0 0 clamp(0.75rem, 1.6vw, 1.5rem); }
.ag-masonry .gallery__figure { display: block; grid-row: auto; margin: 0; }
.ag-masonry .gallery__link { display: block; overflow: hidden; border-radius: 6px; background: #111; box-shadow: inset 0 0 0 1px var(--ag-line); }
.ag-masonry .gallery__image { display: block; width: 100%; height: auto; max-width: none; aspect-ratio: auto; max-height: 85vh; object-fit: cover; object-position: top; transition: transform 800ms var(--ag-ease); }
.ag-masonry .gallery__link:hover .gallery__image { transform: scale(1.025); }
.ag-masonry .gallery__caption { margin-top: 0.5rem; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ag-muted); }
.ag-client__pager { display: flex; justify-content: space-between; gap: 2rem; margin-top: clamp(3rem, 7vw, 6rem); padding-top: 1.5rem; border-top: 1px solid var(--ag-line); }
.ag-client__pager a { display: grid; gap: 0.35rem; min-width: 0; overflow-wrap: anywhere; color: var(--ag-ink); text-decoration: none; font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 600; }
.ag-client__pager a[rel="next"] { text-align: right; }
.ag-client__pager a span { font-size: 0.75rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ag-muted); }
.ag-client__pager a:hover { color: var(--ag-red); }


/* Practices (Neil, 2026-11-08): four looks for website, product, app development and AI work (Portfolio.astro). */
.ag-work button.ag-chip--practice { border-color: rgba(255, 255, 255, 0.45); font-weight: 600; }

/* "tabs": four large practice tabs with counts; the other filters fold under More. */
.ag-tabs ul { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 1.25rem; padding: 0; border-bottom: 1px solid var(--ag-line); }
.ag-tabs li { margin: 0; }
.ag-work button.ag-tabs__tab {
	display: flex; align-items: baseline; justify-content: flex-start; gap: 0.4rem; width: 100%;
	min-height: 0; padding: 1.1rem 0.25rem 1rem; border: 0; border-radius: 0; border-bottom: 3px solid transparent;
	font-size: clamp(1.15rem, 2.2vw, 1.9rem); font-weight: 600; letter-spacing: -0.01em; color: var(--ag-muted); background: transparent;
}
.ag-work button.ag-tabs__tab:hover { color: var(--ag-ink); border-color: transparent; border-bottom-color: var(--ag-line); }
.ag-work button.ag-tabs__tab[aria-pressed="true"] { color: var(--ag-ink); background: transparent; border-color: transparent; border-bottom-color: var(--ag-red); }
.ag-tabs__n { align-self: flex-start; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; color: var(--ag-red); font-variant-numeric: tabular-nums; }
.ag-more { margin-bottom: clamp(2rem, 5vw, 4rem); border: 0; }
.ag-more > summary { cursor: pointer; width: max-content; margin-bottom: 0.75rem; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ag-muted); }
.ag-more > summary:hover { color: var(--ag-ink); }
.ag-more .ag-filters { margin-bottom: 0; }

/* "index": the practices set large, art-house, as the filter itself. */
.ag-index ul { list-style: none; margin: 0 0 clamp(1.5rem, 4vw, 3rem); padding: 0; display: flex; flex-wrap: wrap; gap: 0 clamp(1.25rem, 4vw, 3.5rem); }
.ag-index li { margin: 0; }
.ag-work button.ag-index__item {
	min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ag-muted);
	font-size: clamp(2.5rem, 8vw, 6.5rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1.02;
	transition: color 300ms var(--ag-ease);
}
.ag-work button.ag-index__item:hover { color: var(--ag-ink); background: transparent; border-color: transparent; }
.ag-work button.ag-index__item[aria-pressed="true"] { color: var(--ag-ink); background: transparent; border-color: transparent; }
.ag-work button.ag-index__item[aria-pressed="true"] .ag-index__word { text-decoration: underline; text-decoration-color: var(--ag-red); text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }
.ag-index__n { margin-left: 0.15em; font-size: 0.22em; font-weight: 600; letter-spacing: 0.05em; vertical-align: super; color: var(--ag-red); font-variant-numeric: tabular-nums; }

/* "sections": the wall grouped under each practice (a client can appear under more than one). */
.ag-practice { margin: 0 auto clamp(3rem, 7vw, 6rem); }
.ag-work .ag-practice__title {
	margin: 0 0 clamp(1rem, 2.5vw, 2rem); padding-bottom: 0.9rem; border-bottom: 1px solid var(--ag-line);
	font-size: clamp(1.75rem, 4.5vw, 3.5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1;
}
.ag-practice__n { margin-left: 0.3em; font-size: 0.3em; font-weight: 600; vertical-align: super; color: var(--ag-red); }

@media (max-width: 781px) {
	.ag-tabs ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The lightbox on a dark site. Fluid's ghost buttons add a "→" unless data-arrow="none", which lightbox.js does
   not set (Fluid 2.2.10); and WordPress's button colours would paint them white. */
.lightbox { color-scheme: dark; }
.ag-client-page .lightbox button.lightbox__button,
.ag-client-page .lightbox button.lightbox__button:hover,
.ag-client-page .lightbox button.lightbox__button:focus {
	background: rgba(0, 0, 0, 0.55); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35);
	min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.9rem; border-radius: 999px; font-size: 1.25rem; line-height: 1;
}
.ag-client-page .lightbox button.lightbox__button:hover { border-color: #fff; }
.ag-client-page .lightbox .lightbox__button::after { content: none; }

@media (max-width: 1023px) { .ag-client .ag-masonry { column-count: 2; } }
@media (max-width: 781px) {
	.ag-work__head { flex-direction: column; align-items: flex-start; }
	.ag-client__head, .ag-client__about { grid-template-columns: minmax(0, 1fr); }
	.ag-client__visit { grid-column: 1; }
	.ag-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ag-wall__logo { max-height: 44px; }
}
@media (max-width: 520px) { .ag-client .ag-masonry { column-count: 1; } }
@media (prefers-reduced-motion: reduce) {
	.ag-wall__link, .ag-wall__logo, .ag-wall__word, .ag-peek, .ag-masonry .gallery__image { transition: none; }
}
