/*
 * Service design portfolio: the home page and the case studies.
 *
 * Editorial look: a Newsreader serif for headlines, quotes and chapter
 * numerals, Public Sans for reading, black ink on white with one deep green
 * accent. Sections share a two-column "rail" layout: a small label or a
 * large numeral on the left, the content on the right. Below 760px the rail
 * stacks above its content.
 *
 * Image slots that are still waiting for photos are .ph boxes carrying a
 * label; swap each for an <img> (or <figure>) when the photo is ready.
 */
:root {
	color-scheme: light;
	--paper: #ffffff;
	--ink: #1b1d1c;
	--ink-2: #474b49;
	--ink-3: #5c615e;
	--accent: #c2410c;
	--rule: #d8dbd8;
	--wash: #eceeea;
	--serif: "Newsreader", Georgia, serif;
	--sans: "Public Sans", system-ui, sans-serif;
	--rail: 13rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--paper); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	display: flex;
	flex-direction: column;
	gap: clamp(4rem, 9vw, 7rem);
	min-height: 100vh;
	min-height: 100svh;
	max-width: 72.5rem;
	margin: 0 auto;
	padding: 1.75rem clamp(16px, 5vw, 64px) 3rem;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

/* Links never underline; hover swaps the two inks (terracotta <-> near-black) */
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--ink); }
a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: 2px;
}

.kicker {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-2);
}

/* Image placeholder */
.ph {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: var(--wash);
	color: #4b524d;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.35;
	text-align: center;
	aspect-ratio: 4 / 3;
}
.ph--wide { aspect-ratio: 16 / 9; }
.ph--pano { aspect-ratio: 21 / 9; }
.ph--thumb { aspect-ratio: 3 / 2; }

/* Photos fill their slot's shape and crop the overflow */
.photo {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: var(--wash);
}
.photo--wide { aspect-ratio: 16 / 9; }
.photo--pano { aspect-ratio: 21 / 9; }
.photo--thumb { aspect-ratio: 3 / 2; }

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
	gap: 0.75rem;
}
.gallery--two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }

/* Masthead */
.mast {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--ink);
}
.mast-name {
	font-family: var(--serif);
	font-size: 1.5rem;
	font-weight: 500;
	color: var(--ink);
	text-decoration: none;
}
.mast-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-size: 0.9375rem; font-weight: 500; }
.mast-nav a { color: var(--ink); text-decoration: none; }
.mast-name:hover,
.mast-nav a:hover,
.mast-nav a[aria-current="page"] { color: var(--accent); }

/* Rail layout: label or numeral on the left, content on the right */
.rail {
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	column-gap: 4rem;
	padding-top: 2rem;
	border-top: 1px solid var(--rule);
}
.rail-body { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

.numeral {
	font-family: var(--serif);
	font-size: 4.5rem;
	line-height: 1;
	color: var(--accent);
	font-variant-numeric: lining-nums;
}

.section { display: flex; flex-direction: column; gap: 3rem; }

.chapter-title {
	font-family: var(--serif);
	font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
	font-weight: 500;
	line-height: 1.2;
}

/* Home: hero */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
	gap: 3.5rem;
	align-items: center;
}
.hero-kicker { margin-bottom: 1.5rem; color: var(--accent); }
.hero-title {
	font-family: var(--serif);
	font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4.25rem);
	font-weight: 400;
	line-height: 1.08;
	letter-spacing: -0.015em;
}
.hero-title em { color: var(--accent); }
.hero-text { margin-top: 1.75rem; font-size: 1.1875rem; color: var(--ink-2); }
.hero .ph,
.hero .photo { aspect-ratio: 3 / 4; border-radius: 12.5rem 12.5rem 0 0; }

/* Serif italic statement: the About quote and the Approach philosophy */
.quote {
	font-family: var(--serif);
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
	font-style: italic;
	line-height: 1.3;
}
.more-link { align-self: flex-start; font-weight: 600; }
.cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	gap: 2.5rem;
}
.cols .kicker { margin-bottom: 0.75rem; color: var(--accent); }
.timeline { display: flex; flex-direction: column; gap: 1rem; }
.timeline dt { font-size: 0.875rem; color: var(--ink-3); }
.timeline dd { margin: 0; }
.skills { display: flex; flex-direction: column; gap: 0.375rem; padding-left: 1.125rem; }

/* Home: case study index, ruled above like the rail sections */
#case-studies { padding-top: 2rem; border-top: 1px solid var(--rule); }
.work-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	gap: 3rem 2rem;
	list-style: none;
}
.work-item a {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	height: 100%;
	color: var(--ink);
	text-decoration: none;
}
.work-text { display: flex; flex: 1; flex-direction: column; gap: 0.75rem; }
.work-title {
	font-family: var(--serif);
	font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.75rem);
	font-weight: 500;
	line-height: 1.15;
}
.work-item a:hover { color: var(--ink); }
.work-item a:hover .work-title,
.work-item a:hover .work-more { color: var(--accent); }
.work-title { transition: color 0.15s; }
.work-text p { color: var(--ink-2); }
.work-more { margin-top: auto; padding-top: 0.25rem; align-self: flex-end; font-weight: 600; transition: color 0.15s; }

/* Facts list: Role, Recognition, Country */
.facts { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; font-size: 0.875rem; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0.25rem 0 0; }

/* Case study page */
.cs-head { display: flex; flex-direction: column; gap: 1.5rem; }
.cs-back { font-size: 0.9375rem; font-weight: 500; }
.cs-title {
	font-family: var(--serif);
	font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.015em;
}
.cs-summary { font-size: 1.1875rem; color: var(--ink-2); }
.cs-head .facts { padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.9375rem; }

.learnt {
	padding: 1.5rem 1.75rem;
	background: #faf4f0;
	border-radius: 4px;
}
.learnt h3 { margin-bottom: 0.75rem; font-size: 0.9375rem; font-weight: 700; }
.learnt ul, .learnt ol { display: flex; flex-direction: column; gap: 0.5rem; padding-left: 1.125rem; }
.learnt li ul { margin-top: 0.375rem; gap: 0.25rem; }
.learnt li::marker { color: var(--accent); }
.learnt .fix { display: block; color: var(--ink-2); font-size: 0.9375rem; }

.todo { color: var(--ink-3); font-style: italic; }

.pager {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	gap: 1rem 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--rule);
}
.pager a { display: flex; flex-direction: column; gap: 0.25rem; color: var(--ink); text-decoration: none; }
.pager a:hover { color: var(--ink); }
.pager span:last-child { transition: color 0.15s; }
.pager a:hover span:last-child { color: var(--accent); }
.pager .next { text-align: right; }
.pager span:last-child { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; }

/* Footer */
.foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem 2rem;
	margin-top: auto;
	padding-top: 2rem;
	border-top: 1px solid var(--rule);
}
.foot-cta { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.4; }
.foot-small { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.4; color: var(--ink-3); }
.foot-small a { color: var(--ink-3); }
.foot-small a:hover { color: var(--accent); }

@media (max-width: 759px) {
	.rail { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
	.numeral { font-size: 3rem; }
	.hero { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
	.hero .ph,
	.hero .photo { max-width: 16rem; }
	.pager .next { text-align: left; }
}
