/*
 * Crea — front-end styles.
 *
 * Colours, type and rhythm come straight from the Figma file:
 *   blush  #F7D2C1   plum #40092B   peach #F0A481   lime #ECFF9B
 */

/* ---------------------------------------------------------------- tokens - */

:root {
	--blush: #f7d2c1;
	--plum: #40092b;
	--plum-soft: #5a1b41;
	--peach: #f0a481;
	--peach-dim: #c78f7d;
	--lime: #ecff9b;
	--ink: var(--plum);

	--serif: "Instrument Serif", "Playfair Display", Georgia, "Times New Roman", serif;
	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	--shell: 1240px;
	--gutter: clamp(20px, 5vw, 64px);

	--radius-sm: 14px;
	--radius-md: 24px;
	--radius-lg: 40px;
	--radius-pill: 999px;

	--section-gap: clamp(72px, 11vw, 168px);

	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------------ base - */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* The header is sticky, so anchored sections need room to clear it. */
	scroll-padding-top: 96px;

	/* The hero and footer wordmarks are wider than the viewport on purpose.
	 * Clip them here rather than with overflow-x:hidden on <body>: "hidden"
	 * forces the other axis to "auto", which turns <body> into a scroll
	 * container of its own and leaves the page unscrollable. "clip" creates no
	 * scroll container at all, so position:sticky keeps working too. */
	overflow-x: hidden; /* fallback for browsers without overflow:clip */
	overflow-x: clip;
}

body {
	margin: 0;
	background: var(--blush);
	color: var(--ink);
	font-family: var(--sans);
	font-size: clamp(15px, 1.05vw, 18px);
	line-height: 1.6;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
svg,
video {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

button {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 3px solid var(--plum);
	outline-offset: 3px;
	border-radius: 4px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 12px 20px;
	background: var(--plum);
	color: var(--blush);
	border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
	left: 0;
}

.shell {
	width: 100%;
	max-width: var(--shell);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.shell--narrow {
	max-width: 900px;
}

.section {
	padding-block: var(--section-gap);
}

/* ------------------------------------------------------------- typography */

.section-heading {
	margin: 0 0 clamp(28px, 3.5vw, 48px);
	font-family: var(--serif);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.01em;
	text-align: center;
	font-size: clamp(42px, 6.2vw, 92px);
}

.section-heading--caps {
	text-transform: uppercase;
	font-size: clamp(30px, 5.6vw, 82px);
	letter-spacing: 0.005em;
}

.prose {
	font-size: clamp(15px, 1.15vw, 19px);
	line-height: 1.62;
}

.prose p {
	margin: 0 0 1em;
}

.prose p:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------- header - */

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--blush);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 78px;
}

.site-header__logo {
	font-family: var(--serif);
	font-size: clamp(24px, 2.1vw, 32px);
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.site-header__logo img {
	max-height: 44px;
	width: auto;
}

.site-nav__list {
	display: flex;
	align-items: center;
	gap: clamp(22px, 3.2vw, 56px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a {
	font-family: var(--serif);
	font-size: clamp(18px, 1.5vw, 24px);
	text-decoration: none;
	transition: opacity 0.18s var(--ease);
}

.site-nav__list a:hover {
	opacity: 0.6;
}

.nav-toggle {
	display: none;
	padding: 10px;
	margin-right: -10px;
	background: none;
	border: 0;
	cursor: pointer;
}

.nav-toggle__bars {
	display: block;
	width: 34px;
}

.nav-toggle__bars i {
	display: block;
	height: 2px;
	background: var(--plum);
	transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}

.nav-toggle__bars i + i {
	margin-top: 8px;
}

/* ------------------------------------------------------------------ hero - */

.hero {
	position: relative;
	display: grid;
	place-items: center;
	padding-block: clamp(8px, 2vw, 32px) clamp(20px, 4vw, 60px);
	isolation: isolate;
}

.hero__mark {
	grid-area: 1 / 1;
	width: min(112vw, 1680px);
}

.hero__mark img {
	width: 100%;
}

.hero__portrait {
	grid-area: 1 / 1;
	align-self: end;
	width: min(46vw, 560px);
	/* Sits over the wordmark, as in the design. */
	transform: translateY(14%);
	z-index: 1;
}

/* ----------------------------------------------------------------- about - */

.about__text {
	max-width: 62ch;
	margin-inline: auto;
}

/* ------------------------------------------------------------ resume card */

.card {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: clamp(28px, 4vw, 64px);
	align-items: center;
	padding: clamp(20px, 2.4vw, 32px);
	background: var(--plum);
	border-radius: var(--radius-lg);
}

.card__photo img {
	width: 100%;
	border-radius: var(--radius-md);
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.card__body {
	padding-right: clamp(0px, 2vw, 40px);
}

.facts {
	margin: 0;
	display: grid;
	gap: clamp(10px, 1.1vw, 18px);
}

.facts__row {
	display: grid;
	grid-template-columns: minmax(96px, 150px) minmax(0, 1fr);
	gap: clamp(12px, 2vw, 32px);
	align-items: baseline;
}

.facts__label {
	margin: 0;
	font-size: clamp(11px, 0.85vw, 14px);
	line-height: 1.3;
	color: var(--peach-dim);
}

.facts__value {
	margin: 0;
	font-family: var(--serif);
	font-size: clamp(19px, 2vw, 32px);
	line-height: 1.15;
	color: var(--peach);
	overflow-wrap: anywhere;
}

.card__action {
	margin-top: clamp(22px, 3vw, 40px);
	padding-top: clamp(20px, 2.6vw, 34px);
	border-top: 1px solid rgb(240 164 129 / 0.45);
	text-align: center;
}

/* --------------------------------------------------------------- buttons - */

.btn {
	display: inline-block;
	font-family: var(--serif);
	line-height: 1;
	text-decoration: none;
	border: 0;
	cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn--outline {
	padding: 0.5em 1.6em;
	font-size: clamp(20px, 1.9vw, 30px);
	color: var(--lime);
	background: transparent;
	border: 1px solid var(--lime);
	border-radius: var(--radius-pill);
}

.btn--outline:hover {
	background: var(--lime);
	color: var(--plum);
}

.btn--solid {
	padding: 0.42em 1.7em;
	font-size: clamp(22px, 2vw, 32px);
	color: var(--lime);
	background: var(--plum);
	border-radius: var(--radius-pill);
}

.btn--solid:hover {
	transform: translateY(-2px);
}

/* --------------------------------------------------------------- marquee - */

.marquee {
	width: 100%;
	margin-block: clamp(20px, 4vw, 56px);
}

.marquee__img {
	width: 100%;
	height: auto;
}

/* -------------------------------------------------------------- carousel - */

.carousel {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: clamp(8px, 2vw, 34px);
}

.carousel--single {
	grid-template-columns: minmax(0, 1fr);
}

.carousel__viewport {
	overflow: hidden;
	max-width: 780px;
	margin-inline: auto;
	width: 100%;
}

.carousel__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	transition: transform 0.45s var(--ease);
}

.slide {
	flex: 0 0 100%;
	min-width: 0;
}

.slide__frame {
	position: relative;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: #1a0712;
	aspect-ratio: 16 / 10;
}

.slide__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.facade {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.facade__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.facade__play {
	position: relative;
	width: clamp(64px, 7vw, 92px);
	color: var(--lime);
	transition: transform 0.2s var(--ease);
}

.facade:hover .facade__play {
	transform: scale(1.08);
}

.slide__title {
	margin: clamp(14px, 1.6vw, 22px) 0 0;
	font-family: var(--serif);
	font-size: clamp(22px, 2.2vw, 34px);
	line-height: 1.1;
	text-align: center;
}

.carousel__arrow {
	display: grid;
	place-items: center;
	width: clamp(34px, 3.4vw, 46px);
	height: clamp(34px, 3.4vw, 46px);
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.carousel__arrow svg {
	width: 55%;
}

.carousel__arrow:hover {
	transform: scale(1.12);
}

.carousel__arrow[disabled] {
	opacity: 0.25;
	cursor: default;
	transform: none;
}

.carousel__status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

/* ---------------------------------------------------------------- mosaic - */

.mosaic {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 3;
	column-gap: clamp(12px, 1.6vw, 22px);
}

.mosaic__item {
	break-inside: avoid;
	margin-bottom: clamp(12px, 1.6vw, 22px);
}

.mosaic__img {
	width: 100%;
	border-radius: var(--radius-md);
}

/* --------------------------------------------------------------- contact - */

.panel {
	max-width: 880px;
	margin-inline: auto;
	padding: clamp(26px, 3.4vw, 50px);
	background: var(--lime);
	border-radius: var(--radius-lg);
}

.form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(14px, 1.6vw, 22px);
}

.field {
	margin: 0;
}

.field--wide {
	grid-column: 1 / -1;
}

.field__input {
	width: 100%;
	padding: 0.85em 1.35em;
	font-family: var(--sans);
	font-size: clamp(14px, 1vw, 16px);
	line-height: 1.4;
	color: var(--plum);
	background: transparent;
	border: 1px solid var(--plum);
	border-radius: var(--radius-pill);
	transition: box-shadow 0.18s var(--ease);
}

.field__input--area {
	min-height: 170px;
	border-radius: var(--radius-md);
	resize: vertical;
}

.field__input::placeholder {
	color: var(--plum);
	opacity: 0.75;
}

.field__input:focus {
	outline: 0;
	box-shadow: 0 0 0 2px var(--plum);
}

.form__action {
	margin: clamp(24px, 3vw, 40px) 0 0;
	text-align: center;
}

.form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.notice {
	margin: 0 0 clamp(18px, 2vw, 28px);
	padding: 14px 20px;
	font-size: 15px;
	border-radius: var(--radius-sm);
	background: rgb(64 9 43 / 0.08);
	border: 1px solid rgb(64 9 43 / 0.35);
}

.notice--error {
	background: rgb(158 20 20 / 0.1);
	border-color: rgb(140 20 20 / 0.5);
}

/* ---------------------------------------------------------------- footer - */

.site-footer {
	padding-top: clamp(40px, 6vw, 90px);
}

.wordmark--footer {
	width: min(112vw, 1680px);
	margin-inline: auto;
}

.wordmark--footer img {
	width: 100%;
}

.site-footer__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	padding-block: clamp(20px, 2.4vw, 34px);
	font-size: 14px;
}

.site-footer__meta p {
	margin: 0;
}

/* ------------------------------------------------------- inner page shell */

.page-body {
	padding-block: clamp(48px, 8vw, 110px);
}

.page-body--center {
	text-align: center;
}

.page-body .prose {
	max-width: 62ch;
	margin-inline: auto;
}

/* ------------------------------------------------------------ breakpoints */

@media (max-width: 900px) {
	.card {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(24px, 4vw, 36px);
	}

	.card__body {
		padding-right: 0;
	}

	.card__photo img {
		aspect-ratio: 4 / 5;
	}

	.mosaic {
		columns: 2;
	}
}

@media (max-width: 860px) {
	html {
		scroll-padding-top: 78px;
	}

	.nav-toggle {
		display: block;
	}

	.site-nav {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		display: none;
		padding: 8px var(--gutter) 28px;
		background: var(--blush);
	}

	.site-nav.is-open {
		display: block;
	}

	.site-nav__list {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}

	.site-nav__list a {
		font-size: 26px;
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) {
		transform: translateY(10px) rotate(45deg);
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) {
		opacity: 0;
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) {
		transform: translateY(-10px) rotate(-45deg);
	}

	.hero__mark {
		width: 128vw;
	}

	.hero__portrait {
		width: min(72vw, 420px);
		transform: translateY(10%);
	}

	.facts__row {
		grid-template-columns: minmax(84px, 108px) minmax(0, 1fr);
		gap: 14px;
	}

	.form__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.carousel {
		gap: 4px;
	}
}

@media (max-width: 520px) {
	.mosaic {
		columns: 1;
	}

	.wordmark--footer,
	.hero__mark {
		width: 140vw;
	}
}

/* ------------------------------------------------------------- motion off */

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ------------------------------------------------------------- motion ---- *
 *
 * Everything below is enhancement. The .js-motion class is set by main.js on
 * <html>, so with JavaScript off — or a parse error — every element stays in
 * its finished state and nothing is ever stuck invisible.
 */

/* Reveal on scroll. */

.js-motion [data-reveal] {
	opacity: 0;
	transform: translateY(18px);
	transition:
		opacity 0.7s var(--ease),
		transform 0.7s var(--ease);
	transition-delay: var(--reveal-delay, 0ms);
	will-change: opacity, transform;
}

.js-motion [data-reveal].is-revealed {
	opacity: 1;
	transform: none;
	will-change: auto;
}

/* The hero rises in on load rather than waiting for a scroll. */

.js-motion .hero__mark,
.js-motion .hero__portrait {
	animation: crea-rise 1.1s var(--ease) both;
}

.js-motion .hero__portrait {
	animation-delay: 0.12s;
}

@keyframes crea-rise {
	from {
		opacity: 0;
		transform: translateY(26px);
	}
}

/* translateY on the portrait is load-bearing — it is what sits it over the
 * wordmark — so its keyframes have to preserve it. */
.js-motion .hero__portrait {
	animation-name: crea-rise-portrait;
}

@keyframes crea-rise-portrait {
	from {
		opacity: 0;
		transform: translateY(calc(14% + 26px));
	}

	to {
		opacity: 1;
		transform: translateY(14%);
	}
}

/* ---------------------------------------------------------------- hovers - */

/* Nav: an underline that wipes in from the left. */

.site-nav__list a {
	position: relative;
	display: inline-block;
}

.site-nav__list a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -3px;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.32s var(--ease);
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible {
	opacity: 1;
}

.site-nav__list a:hover::after,
.site-nav__list a:focus-visible::after {
	transform: scaleX(1);
}

/* The wordmark in the header lifts a hair on hover. */

.site-header__logo {
	transition: transform 0.3s var(--ease);
}

.site-header__logo:hover {
	transform: translateY(-1px);
}

/* A hairline appears under the header once the page has moved. */

.site-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: rgb(64 9 43 / 0.16);
	opacity: 0;
	transition: opacity 0.3s var(--ease);
}

.site-header.is-stuck::after {
	opacity: 1;
}

/* Gallery: lift and warm slightly under the cursor. */

.mosaic__item {
	overflow: hidden;
	border-radius: var(--radius-md);
	transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.mosaic__img {
	transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}

.mosaic__item:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px -18px rgb(64 9 43 / 0.55);
}

.mosaic__item:hover .mosaic__img {
	transform: scale(1.035);
	filter: saturate(1.06);
}

/* Buttons. */

.btn--solid {
	box-shadow: 0 0 0 0 rgb(64 9 43 / 0.3);
}

.btn--solid:hover {
	box-shadow: 0 10px 22px -12px rgb(64 9 43 / 0.75);
}

.btn--outline:hover,
.btn--outline:focus-visible {
	transform: translateY(-2px);
}

/* The play button pulses gently until it is used. */

.facade__play svg circle {
	transition: opacity 0.3s var(--ease);
}

.facade:hover .facade__img {
	filter: brightness(1.06);
}

.facade__img {
	transition: filter 0.4s var(--ease);
}

/* Form fields warm up on hover, not just on focus. */

.field__input:hover:not(:focus) {
	box-shadow: 0 0 0 1px rgb(64 9 43 / 0.45);
}

/* Footer contact link. */

.site-footer__contact a {
	text-decoration: none;
	border-bottom: 1px solid rgb(64 9 43 / 0.3);
	transition: border-color 0.25s var(--ease);
}

.site-footer__contact a:hover {
	border-color: var(--plum);
}

/* Anything above is dropped wholesale when the visitor asks for less motion. */

@media (prefers-reduced-motion: reduce) {
	.js-motion [data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.js-motion .hero__mark,
	.js-motion .hero__portrait {
		animation: none;
	}

	.js-motion .hero__portrait {
		transform: translateY(14%);
	}

	.mosaic__item:hover,
	.btn--outline:hover,
	.site-header__logo:hover {
		transform: none;
	}

	.mosaic__item:hover .mosaic__img {
		transform: none;
	}
}
