/* Tokens from .superdesign/design-system.md */
:root {
	--bg: #F3F5F7;           /* salle blanche */
	--surface: #FFFFFF;
	--ink: #1B222C;          /* graphite */
	--muted: #5E6977;        /* ardoise */
	--line: #D5DBE1;         /* filet */
	--accent: #C8861A;       /* kapton */
	--accent-pale: #F6E8CC;
	--focus: #9A6410;        /* darker kapton: 3:1+ against the background, unlike --accent */
	--ph: #DDE2E7;
	--gutter: 32px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 18px/1.6 'Archivo', system-ui, sans-serif;
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: 128px; }
.muted { color: var(--muted); }
h2 { font-size: 44px; line-height: 1.1; font-weight: 700; font-variation-settings: 'wdth' 125; margin-bottom: 12px; }
.page-title { font-size: 56px; line-height: 1.05; font-weight: 700; font-variation-settings: 'wdth' 125; max-width: 18ch; margin-bottom: 24px; }
.lede { font-size: 22px; max-width: 56ch; }
.lede + .muted { margin-top: 12px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 0 24px; border-radius: 2px;
	font-weight: 500; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #B57816; }
.btn-secondary { border: 1px solid var(--ink); }
.btn-secondary:hover { background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }

/* Header and navigation */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.wordmark { font-weight: 700; font-variation-settings: 'wdth' 125; text-decoration: none; }
.nav-desktop { display: flex; align-items: center; gap: 28px; font-weight: 500; }
.nav-desktop a:not(.btn) { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav-desktop a:not(.btn):hover, .nav-desktop [aria-current] { border-bottom-color: var(--accent); }
.nav-desktop .btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
.nav-mobile { display: none; }

/* Hero */
.hero { padding-top: 96px; }
.hero-name {
	display: flex; flex-direction: column; align-items: flex-start;
	font-size: clamp(48px, 11vw, 168px); line-height: .92; font-weight: 800;
	font-variation-settings: 'wdth' 125; letter-spacing: -.02em; margin-bottom: 48px;
}
/* OCR detection box, used on the project cover */
.ocr { position: relative; display: inline-block; padding: 12px; }
.ocr::before { content: ''; position: absolute; inset: 0; border: 1.5px solid var(--accent); pointer-events: none; }
.ocr-score {
	position: absolute; top: 0; left: 0; transform: translateY(-100%);
	background: var(--accent); color: var(--ink); padding: 2px 6px;
	font-size: 13px; font-weight: 600; line-height: 1.4; letter-spacing: 0; white-space: pre;
	font-variation-settings: 'wdth' 100;
}

/* Placeholders for missing images */
.ph {
	position: relative; background-color: var(--ph); border-radius: 2px;
	background-image: linear-gradient(rgb(27 34 44 / .06) 1px, transparent 1px), linear-gradient(90deg, rgb(27 34 44 / .06) 1px, transparent 1px);
	background-size: 24px 24px;
}
.ph-43 { aspect-ratio: 4 / 3; }

/* Blog grid of square cards */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 24px; margin-top: 36px; }
.card { display: block; text-decoration: none; }
.card-img { display: block; aspect-ratio: 1; margin-bottom: 16px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.card-img::after { content: ''; position: absolute; inset: -6px; border: 1.5px solid var(--accent); opacity: 0; }
.card:hover .card-img::after, .card:focus-visible .card-img::after { opacity: 1; }
.card-date, .card-summary, .card-stack { display: block; color: var(--muted); }
.card-date, .card-stack { font-size: 14px; }
.card-title { font-size: 22px; line-height: 1.25; font-weight: 600; font-variation-settings: 'wdth' 112; margin: 4px 0 8px; }
.card-summary { font-size: 16px; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Parcours and skills */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 36px; }
.col-title { font-size: 16px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.timeline { list-style: none; padding: 0 0 0 24px; border-left: 1px solid var(--line); }
.timeline li { position: relative; display: flex; flex-direction: column; padding-bottom: 28px; }
.timeline .muted { font-size: 15px; }
.timeline .current::before { content: ''; position: absolute; left: -29px; top: 7px; width: 9px; height: 9px; background: var(--accent); }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 36px; }

/* Shared article blocks */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 24px 0; margin: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { font-size: 16px; }
.prose { max-width: 68ch; }
.prose p + p { margin-top: 1em; }
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.4em; }
.prose li + li { margin-top: .25em; }
.prose h2 { font-size: 28px; font-variation-settings: 'wdth' 112; margin: 56px 0 16px; }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0 8px; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { font-weight: 600; color: var(--muted); }
.prose .chosen { background: var(--accent-pale); }
.table-scroll { overflow-x: auto; }
.note { font-size: 14px; color: var(--muted); }
.prose pre { margin: 32px 0; padding: 24px; overflow-x: auto; border-radius: 2px; background: var(--ink); color: var(--bg); font-size: 15px; line-height: 1.5; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }

/* Project page */
.project { padding-top: 48px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 24px; padding: 8px 0; text-decoration: none; }
.back:hover { text-decoration: underline; }
.cover { margin-bottom: 24px; }
.cover .ph { aspect-ratio: 16 / 9; }
.cover-box { position: absolute; left: 34%; top: 40%; width: 32%; height: 18%; }

/* À propos */
.about-intro { padding-top: 80px; }
/* Where Antoine can work: the one large typographic moment of the page */
.places { margin-top: 36px; border-top: 1px solid var(--line); }
.places > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.places dt { font-weight: 600; color: var(--muted); padding-top: 2px; }
.places li:only-child { grid-column: 1 / -1; }
.places ul {
	list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 24px;
	font-size: 22px; line-height: 1.5;
}

/* Footer, on every page */
.site-footer { margin-top: 128px; border-top: 1px solid var(--line); padding: 24px 0 96px; font-size: 15px; color: var(--muted); }
/* Three columns so the copyright sits in the true center whatever the arrow's size. */
.footer-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.footer-row span { grid-column: 2; }
.footer-row .to-top { grid-column: 3; justify-self: end; }
.to-top {
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
	border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); font-size: 20px; text-decoration: none;
}
.to-top:hover { background: var(--surface); }
@media (min-width: 721px) {
	.to-top { width: 56px; height: 56px; font-size: 26px; background: var(--accent); border-color: var(--accent); }
	.to-top:hover { background: #B57816; }
}

/* Tablet */
@media (max-width: 1024px) {
	.grid { grid-template-columns: repeat(3, 1fr); }
	.skills { grid-template-columns: repeat(2, 1fr); }
	.facts { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 720px) {
	:root { --gutter: 16px; }
	body { font-size: 17px; }
	.section { padding-top: 80px; }
	.site-footer { margin-top: 80px; padding-bottom: 56px; }
	h2 { font-size: 30px; }
	.page-title { font-size: 36px; }
	.lede { font-size: 18px; }
	.actions { flex-direction: column; }
	.actions .btn { width: 100%; }

	.nav-desktop { display: none; }
	.nav-mobile { display: block; }
	.nav-mobile summary { list-style: none; min-height: 44px; padding: 0 16px; font-size: 14px; }
	.nav-mobile summary::-webkit-details-marker { display: none; }
	.nav-mobile[open] .when-closed, .nav-mobile:not([open]) .when-open { display: none; }
	.menu-panel {
		position: fixed; inset: 73px 0 0; overflow-y: auto; background: var(--bg);
		display: flex; flex-direction: column; gap: 24px; padding: 8px 16px 40px;
	}
	.menu-panel nav { flex: 1; }
	.menu-panel nav a {
		display: flex; align-items: center; min-height: 64px; border-bottom: 1px solid var(--line);
		font-size: 30px; font-weight: 700; font-variation-settings: 'wdth' 125; text-decoration: none;
	}
	.menu-panel nav [aria-current] { box-shadow: inset 3px 0 0 var(--accent); padding-left: 14px; }
	.menu-email { color: var(--muted); font-size: 15px; padding: 8px 0; }
	@media (prefers-reduced-motion: no-preference) {
		.nav-mobile[open] .menu-panel { animation: menu-in .16s ease-out; }
	}

	.hero { padding-top: 48px; }
	.hero-name { font-size: 12vw; font-variation-settings: 'wdth' 112; }
	.grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
	.card-title { font-size: 16px; }
	.card-date, .card-stack { font-size: 13px; }
	.card-summary { display: none; }
	.two-col, .figures, .places > div { grid-template-columns: 1fr; }
	.about-intro { padding-top: 40px; }
	.places > div { gap: 8px; }
	.places ul { grid-template-columns: 1fr 1fr; font-size: 17px; white-space: nowrap; }
	.facts { grid-template-columns: 1fr 1fr; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
