/**
 * 50 Joer ADEM — landing page.
 * Breakpoints: sm 640px, lg 1024px.
 */

/* Fonts */

@font-face {
	font-family: 'Space Grotesk Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 300 700;
	src: url(../fonts/space-grotesk-latin-ext-wght-normal.woff2) format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Space Grotesk Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 300 700;
	src: url(../fonts/space-grotesk-latin-wght-normal.woff2) format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'DM Sans Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 1000;
	src: url(../fonts/dm-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'DM Sans Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 1000;
	src: url(../fonts/dm-sans-latin-wght-normal.woff2) format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens */

:root {
	--gutter: 20px;
	--font-display: 'Space Grotesk Variable', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	--font-body: 'DM Sans Variable', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

	--ink: #263337;
	--ink-soft: #566468;
	--paper: #fffefa;
	--cream: #f3f5f1;
	--mist: #e5ebe7;
	--grey: #babdbc;
	--green: #459a96;
	--teal: #6bc4bc;
	--red: #ef1d2d;
	--red-dark: #bf1221;

	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-curtain: cubic-bezier(0.65, 0, 0.2, 1);
}

@media (min-width: 1024px) {
	:root {
		--gutter: 30px;
	}
}

/* Base */

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* In-page anchors (nav, call to action, "Retour en haut") glide instead of jumping. */
html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--ink);
	background: var(--mist);
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol {
	margin: 0;
}

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

a {
	color: inherit;
	text-decoration: none;
}

.adem-page {
	background: var(--mist);
}

.adem-container {
	max-width: 1276px;
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Shared headings */

.adem-title {
	font-family: var(--font-display);
	font-size: 32px;
	line-height: 40px;
	font-weight: 700;
}

@media (min-width: 1024px) {
	.adem-title {
		font-size: 42px;
		line-height: 52px;
	}
}

.is-dark {
	color: var(--ink);
}

.is-green {
	color: var(--green);
}

.is-light {
	color: var(--paper);
}

.is-teal {
	color: var(--teal);
}

/* Each line sits in a mask one line-height tall and slides up into it. The extra bottom
 * padding (cancelled by the margin) keeps descenders out of the mask. */
.adem-line-mask {
	display: block;
	overflow: hidden;
	padding-bottom: 0.16em;
	margin-bottom: -0.16em;
}

.adem-line {
	display: block;
	transition: translate 900ms var(--ease-out);
}

/* Start states are gated on scripting, so a page that could never run the reveal never hides content. */
@media (scripting: enabled) {
	.adem-line-masked {
		translate: 0 125%;
	}

	.adem-reveal-hidden {
		opacity: 0;
		translate: 0 72px;
	}
}

/* Burst */

/* The centring translate lives on the wrapper so the spin is the image's only transform:
 * that keeps the animation off the main thread (Firefox in particular). */
.adem-burst {
	pointer-events: none;
	user-select: none;
	translate: -50% -50%;
}

.adem-burst__img {
	width: 100%;
	max-width: none;
	animation: adem-orbit 240s linear infinite;
	backface-visibility: hidden;
}

.adem-burst--hero {
	width: min(128.5vw, 4000px);
	min-width: 760px;
	opacity: 0.45;
}

@media (min-width: 640px) {
	.adem-burst--hero {
		opacity: 1;
	}
}

@media (min-width: 1024px) {
	.adem-burst--hero {
		min-width: 1100px;
	}
}

.adem-burst--footer {
	width: 2402px;
}

/* Header */

.adem-header {
	max-height: 120px;
	overflow: hidden;
	border-bottom: 1px solid rgb(38 51 55 / 0.12);
	background: var(--cream);
	transition: max-height 900ms var(--ease-curtain);
}

.adem-header__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	row-gap: 8px;
	max-width: 1276px;
	margin-inline: auto;
	padding: 12px var(--gutter);
}

.adem-header__brand {
	flex-shrink: 0;
	align-self: flex-start;
}

.adem-header__logo {
	height: 38px;
	width: auto;
}

.adem-nav {
	display: flex;
	align-items: center;
	font-family: var(--font-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.adem-nav a {
	color: var(--ink);
	transition: color 150ms;
}

.adem-nav a:hover {
	color: var(--green);
}

.adem-nav__sep {
	width: 1px;
	height: 15px;
	margin-inline: 10px;
	background: rgb(38 51 55 / 0.25);
}

@media (min-width: 640px) {
	.adem-header__inner {
		flex-direction: row;
		justify-content: space-between;
		height: 64px;
		padding-block: 0;
	}

	.adem-header__brand {
		align-self: auto;
	}
}

@media (min-width: 1024px) {
	.adem-header__inner {
		height: 78px;
	}

	.adem-header__logo {
		height: 47px;
	}

	.adem-nav {
		font-size: 13px;
	}

	.adem-nav__sep {
		margin-inline: 17px;
	}
}

/* Hero */

.adem-hero {
	position: relative;
	overflow: hidden;
	background: var(--cream);
}

.adem-hero__burst {
	position: absolute;
	top: 46%;
	left: 50%;
	width: 0;
	height: 0;
	pointer-events: none;
	user-select: none;
	animation: adem-bloom 1600ms var(--ease-out) both;
}

/* The hero is a full-screen splash with no header until it opens, then settles into its
 * designed height and the header unfurls into the space it gives back. */
.adem-curtain {
	--adem-hero-height: 620px;
	position: relative;
	display: flex;
	flex-direction: column;
	max-width: 1276px;
	min-height: var(--adem-hero-height);
	margin-inline: auto;
	padding: 40px var(--gutter) 32px;
	transition: min-height 900ms var(--ease-curtain);
}

@media (min-width: 1024px) {
	.adem-curtain {
		--adem-hero-height: 859px;
		padding-bottom: 40px;
	}
}

@media (scripting: enabled) {
	.adem-curtain:not([data-opened]) {
		min-height: 100dvh;
	}

	.adem-header:not([data-opened]) {
		max-height: 0;
	}
}

.adem-hero__center {
	display: flex;
	flex: 1;
	align-items: center;
}

.adem-hero__content {
	width: 100%;
	max-width: 490px;
	margin-inline: auto;
	animation: adem-bloom-soft 1600ms var(--ease-out) both;
}

.adem-hero__logo {
	height: 62px;
	width: auto;
	margin-inline: auto;
}

.adem-hero__title {
	margin-top: 30px;
	text-align: center;
	font-family: var(--font-display);
	font-size: 28px;
	line-height: 36px;
	font-weight: 700;
}

.adem-hero__lead {
	margin-top: 24px;
	font-size: 17px;
	line-height: 28px;
	color: var(--ink-soft);
}

.adem-hero__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	margin-top: 30px;
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 700;
}

.adem-btn {
	display: flex;
	align-items: center;
	height: 48px;
	padding-inline: 26px;
	border-radius: 9999px;
	color: var(--ink);
	transition: background-color 150ms, border-color 150ms;
}

.adem-btn--primary {
	background: var(--teal);
}

.adem-btn--primary:hover {
	background: #5bb3ab;
}

.adem-btn--ghost {
	border: 1px solid rgb(38 51 55 / 0.35);
}

.adem-btn--ghost:hover {
	border-color: var(--ink);
}

.adem-hero__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	row-gap: 12px;
	padding-top: 64px;
}

.adem-hero__years {
	display: flex;
	align-items: center;
	column-gap: 10px;
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 700;
	color: var(--green);
}

.adem-hero__years span {
	font-size: 16px;
}

.adem-hero__hint {
	display: flex;
	align-items: center;
	column-gap: 12px;
	font-size: 15px;
	color: var(--ink-soft);
}

.adem-hint-track {
	position: relative;
	width: 2px;
	height: 28px;
	overflow: hidden;
	border-radius: 9999px;
	background: rgb(38 51 55 / 0.15);
}

.adem-hint-marker {
	position: absolute;
	inset: 0 0 auto;
	height: 10px;
	border-radius: 9999px;
	background: var(--red);
	animation: adem-scroll-hint 1900ms cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.adem-rise {
	animation: adem-rise 900ms var(--ease-out) both;
}

@media (min-width: 640px) {
	.adem-hero__title {
		font-size: 32px;
		line-height: 40px;
	}
}

@media (min-width: 1024px) {
	.adem-hero__logo {
		height: 79px;
	}

	.adem-hero__title {
		font-size: 42px;
		line-height: 52px;
	}

	.adem-hero__lead {
		font-size: 20px;
		line-height: 31px;
	}
}

/* Intro */

.adem-intro {
	scroll-margin-top: 78px;
	padding-block: 80px;
	background: var(--ink);
}

.adem-intro__grid {
	display: grid;
	row-gap: 32px;
}

.adem-intro__title {
	align-self: start;
}

.adem-intro__lead {
	font-size: 17px;
	line-height: 28px;
	color: var(--paper);
}

.adem-intro__text {
	margin-top: 20px;
	font-size: 16px;
	line-height: 26px;
	color: var(--grey);
}

@media (min-width: 1024px) {
	.adem-intro {
		padding-block: 120px;
	}

	.adem-intro__grid {
		grid-template-columns: 387px minmax(0, 719px);
		column-gap: 110px;
		row-gap: 0;
	}

	.adem-intro__lead {
		font-size: 20px;
		line-height: 31px;
	}
}

/* Timeline */

.adem-timeline {
	scroll-margin-top: 78px;
	padding: 80px 0 100px;
	background: var(--mist);
}

.adem-timeline__head {
	display: grid;
	row-gap: 24px;
}

.adem-timeline__lead {
	font-size: 17px;
	line-height: 28px;
	color: var(--ink-soft);
}

.adem-timeline__list {
	position: relative;
	display: flex;
	flex-direction: column;
	row-gap: 40px;
	max-width: 1030px;
	margin: 56px auto 0;
	padding: 0;
	list-style: none;
}

/* The spine. Left-aligned while cards are stacked, centred once they alternate. */
.adem-timeline__list::before {
	content: '';
	position: absolute;
	inset-block: 0;
	left: 0;
	width: 1px;
	background: rgb(38 51 55 / 0.2);
}

.adem-entry {
	position: relative;
	display: flex;
	padding-left: 40px;
	transition: opacity 900ms var(--ease-out), translate 900ms var(--ease-out);
}

.adem-entry__dot {
	position: absolute;
	top: 36px;
	left: 0;
	width: 13px;
	height: 13px;
	translate: -50% 0;
	border-radius: 9999px;
	background: var(--red);
	box-shadow: 0 0 0 4px var(--mist);
}

.adem-card {
	position: relative;
	width: 100%;
	background: var(--paper);
}

.adem-card__rule {
	position: absolute;
	inset-block: 0;
	left: 0;
	width: 4px;
	background: var(--green);
}

.adem-entry--left .adem-card__rule {
	background: var(--red);
}

.adem-card__img {
	width: 100%;
	height: auto;
	aspect-ratio: 460 / 259;
	object-fit: cover;
	object-position: center;
}

.adem-card__img.is-top {
	object-position: top;
}

.adem-card__body {
	padding: 28px 30px 24px;
}

.adem-card__date {
	font-family: var(--font-display);
	font-size: 15px;
	line-height: 22px;
	font-weight: 700;
	color: var(--green);
}

.adem-entry--left .adem-card__date {
	color: var(--red-dark);
}

.adem-card__title {
	margin-top: 9px;
	font-family: var(--font-display);
	font-size: 20px;
	line-height: 26px;
	font-weight: 700;
	text-wrap: balance;
	color: var(--ink);
}

.adem-card__text {
	margin-top: 18px;
	font-size: 16px;
	line-height: 26px;
	color: var(--ink-soft);
}

.adem-card__text > * + * {
	margin-top: 12px;
}

.adem-card__text ul,
.adem-card__text ol {
	padding-left: 1.2em;
}

/* "Lire plus": the rest of the description folds open by animating its grid row from 0 to its
 * full height. Without scripting the button can do nothing, so the text is simply shown. */
.adem-card__more {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 600ms var(--ease-out);
}

.adem-card__more > .adem-card__text {
	min-height: 0;
	margin-top: 0;
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s 600ms;
}

/* A margin rather than padding, so nothing is left showing while folded. */
.adem-card__more > .adem-card__text > :first-child {
	margin-top: 12px;
}

.adem-card.is-open .adem-card__more {
	grid-template-rows: 1fr;
}

.adem-card.is-open .adem-card__more > .adem-card__text {
	visibility: visible;
	transition-delay: 0s;
}

.adem-card__toggle {
	display: inline-flex;
	align-items: center;
	column-gap: 10px;
	margin-top: 14px;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--font-display);
	font-size: 15px;
	line-height: 22px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink);
	cursor: pointer;
	transition: color 150ms;
}

.adem-card__toggle:hover {
	color: var(--green);
}

.adem-card__toggle-icon {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
}

/* The plus turns into a minus once open. */
.adem-card__toggle-v {
	transform-origin: center;
	transition: scale 300ms var(--ease-out);
}

.adem-card.is-open .adem-card__toggle-v {
	scale: 1 0;
}

@media (scripting: none) {
	.adem-card__more {
		grid-template-rows: 1fr;
	}

	.adem-card__more > .adem-card__text {
		visibility: visible;
	}

	.adem-card__toggle {
		display: none;
	}
}

@media (min-width: 640px) {
	.adem-card__title {
		font-size: 24px;
		line-height: 30px;
	}
}

@media (min-width: 1024px) {
	.adem-timeline {
		padding: 120px 0 150px;
	}

	.adem-timeline__head {
		grid-template-columns: 626px minmax(0, 1fr);
		align-items: end;
	}

	.adem-timeline__lead {
		font-size: 20px;
		line-height: 31px;
	}

	.adem-timeline__list {
		margin-top: 72px;
	}

	.adem-timeline__list::before,
	.adem-entry__dot {
		left: 50%;
	}

	.adem-entry {
		padding-left: 0;
	}

	.adem-entry--right {
		justify-content: flex-end;
	}

	.adem-card {
		width: 460px;
	}

	/* Left cards mirror their content towards the spine. */
	.adem-entry--left .adem-card__rule {
		left: auto;
		right: 0;
	}

	/* Only the date and title face the spine; the reading text stays left-aligned. */
	.adem-entry--left .adem-card__date,
	.adem-entry--left .adem-card__title {
		text-align: right;
	}
}

/* Ministers */

.adem-ministers {
	scroll-margin-top: 78px;
	padding: 80px 0 100px;
	background: var(--cream);
}

.adem-ministers__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 56px 0 0;
	padding: 0;
	list-style: none;
}

.adem-minister {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border-top: 4px solid var(--green);
	transition: opacity 900ms var(--ease-out), translate 900ms var(--ease-out);
}

.adem-minister__portrait {
	position: relative;
	margin: 0;
	background: var(--mist);
}

.adem-minister__img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: top;
}

.adem-minister__credit {
	position: absolute;
	right: 0;
	bottom: 0;
	padding: 3px 6px;
	font-size: 9px;
	line-height: 13px;
	color: var(--paper);
	background: rgb(38 51 55 / 0.7);
}

.adem-minister__body {
	padding: 14px 16px 18px;
}

.adem-minister__name {
	font-family: var(--font-display);
	font-size: 16px;
	line-height: 21px;
	font-weight: 700;
	color: var(--ink);
}

.adem-minister__function {
	margin-top: 6px;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-soft);
}

@media (min-width: 640px) {
	.adem-ministers__grid {
		gap: 24px;
	}

	.adem-minister__body {
		padding: 22px 26px 26px;
	}

	.adem-minister__name {
		font-size: 22px;
		line-height: 28px;
	}

	.adem-minister__function {
		margin-top: 8px;
		font-size: 15px;
		line-height: 24px;
	}

	.adem-minister__credit {
		padding: 4px 8px;
		font-size: 11px;
		line-height: 16px;
	}
}

@media (min-width: 1024px) {
	.adem-ministers {
		padding: 120px 0 150px;
	}

	.adem-ministers__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 32px;
		margin-top: 72px;
	}
}

/* Footer */

.adem-footer {
	position: relative;
	scroll-margin-top: 78px;
	overflow: hidden;
	padding-bottom: 27px;
	background: var(--ink);
}

.adem-footer__burst {
	position: absolute;
	top: 295px;
	left: calc(100% + 455px);
	pointer-events: none;
	user-select: none;
}

.adem-footer__inner {
	position: relative;
	padding-top: 80px;
}

.adem-footer__lead {
	max-width: 690px;
	margin-top: 22px;
	font-size: 16px;
	line-height: 27px;
	color: var(--grey);
}

.adem-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	row-gap: 12px;
	margin-top: 80px;
	font-size: 14px;
}

.adem-footer__copy {
	color: rgb(186 189 188 / 0.8);
}

.adem-footer__top {
	font-family: var(--font-display);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--teal);
}

.adem-footer__top:hover {
	color: #8fd6cf;
}

@media (min-width: 1024px) {
	.adem-footer__inner {
		padding-top: 126px;
	}

	.adem-footer__bottom {
		margin-top: 129px;
	}
}

/* Keyframes */

@keyframes adem-orbit {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

@keyframes adem-rise {
	from {
		opacity: 0;
		translate: 0 24px;
	}
	to {
		opacity: 1;
		translate: 0 0;
	}
}

@keyframes adem-bloom {
	from {
		opacity: 0;
		scale: 1.14;
	}
	to {
		opacity: 1;
		scale: 1;
	}
}

@keyframes adem-bloom-soft {
	from {
		scale: 1.05;
	}
	to {
		scale: 1;
	}
}

@keyframes adem-scroll-hint {
	0% {
		translate: 0 -100%;
		opacity: 0;
	}
	20% {
		opacity: 1;
	}
	75% {
		opacity: 1;
	}
	100% {
		translate: 0 280%;
		opacity: 0;
	}
}

/* Reduced motion: everything lands in its finished state. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.adem-burst__img,
	.adem-hero__burst,
	.adem-hero__content,
	.adem-rise,
	.adem-hint-marker {
		animation: none;
	}

	.adem-header,
	.adem-curtain,
	.adem-line,
	.adem-entry,
	.adem-minister,
	.adem-card__more,
	.adem-card__toggle-v {
		transition: none;
	}
}
