/*
Theme Name: Spice Editorial
Description: Editorial front end for Spice Photography. Classic PHP templates, one CSS file, no jQuery.
Version: 0.1.0
Requires PHP: 8.0
Text Domain: spice-editorial
*/

/* Spice Serif: Source Serif 4 Regular (Text optical size), Latin subset plus the arrows, renamed per the OFL (Reserved Font Name). Licence: assets/fonts/SpiceSerif-OFL.txt */
@font-face {
	font-family: "Spice Serif";
	src: url("assets/fonts/SpiceSerif-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Georgia resized to Spice Serif's average lowercase width and vertical metrics, so the swap does not move text. */
@font-face {
	font-family: "Spice Serif Fallback";
	src: local("Georgia");
	size-adjust: 102.24%;
	ascent-override: 101.33%;
	descent-override: 32.77%;
	line-gap-override: 0%;
}

/* Inter Tight 400, Latin subset plus the arrows. Licence: assets/fonts/OFL.txt */
@font-face {
	font-family: "Inter Tight";
	src: url("assets/fonts/InterTight-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Arial resized to Inter Tight's average lowercase width and vertical metrics, so the swap does not move text. */
@font-face {
	font-family: "Inter Tight Fallback";
	src: local("Arial"), local("ArialMT"), local("Helvetica");
	size-adjust: 99%;
	ascent-override: 97.9%;
	descent-override: 24.4%;
	line-gap-override: 0%;
}

:root {
	--ink: #000;
	--paper: #fff;
	--muted: #767676;
	--accent: #d0021b; /* 5.7:1 on white: the About page's contact links. */
	--g: 19px;
	--cg: 18px;
	--rg: 68px;
	--cols: 8;
	--serif: "Spice Serif", "Spice Serif Fallback", Georgia, serif;
	--sans: "Inter Tight", "Inter Tight Fallback", Arial, sans-serif;
}

@media (max-width: 1100px) {
	:root { --cols: 6; }
}

@media (max-width: 640px) {
	:root { --g: 16px; --cg: 16px; --rg: 40px; --cols: 3; }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 60px; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 15px/1.12 var(--serif);
	letter-spacing: normal;
	overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; font: inherit; letter-spacing: inherit; }
ul, ol { list-style: none; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 4px var(--paper); }

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

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

.skip-link {
	position: fixed;
	top: var(--g); left: var(--g);
	z-index: 100;
	padding: 8px;
	background: var(--paper);
	border: 1px solid var(--ink);
	transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* Nav: one fixed line on the 8-column grid, white text blended against the page (difference) so it reads over
   photos and paper alike. Where the blend is unavailable or unwanted it falls back to plain black. */
.nav {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 40;
	padding: calc(15px + env(safe-area-inset-top)) var(--g) 0;
	color: #fff;
	mix-blend-mode: difference;
	font: 400 15px/17px var(--serif);
	pointer-events: none;
}
.nav a { color: inherit; }
.nav a, .nav button { pointer-events: auto; }
.nav__grid {
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	column-gap: var(--cg);
	align-items: start;
}
.nav__ctx {
	grid-column: 1 / span 2;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.nav__name, .nav__about, .nav__end a {
	display: block;
	padding: 4px 0;
}
.nav__name, .nav__about, .nav__end { margin: -4px 0; }
.nav__name { grid-column: 3; justify-self: start; white-space: nowrap; }
.nav__about { grid-column: calc(var(--cols) - 1); justify-self: end; text-align: right; }
.nav__end { grid-column: var(--cols); justify-self: end; display: flex; justify-content: flex-end; text-align: right; }
.nav__about:not([aria-current]), .nav__end a:not([aria-current]), .nav__client { opacity: 0.54; }
.nav button {
	display: block;
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	white-space: nowrap;
	cursor: pointer;
}
.nav button:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Phones, Index view: the caption of the row in view, fixed bottom left and blended like the nav. */
.pinned {
	position: fixed;
	left: var(--g);
	right: var(--g);
	bottom: calc(15px + env(safe-area-inset-bottom));
	z-index: 40;
	margin: 0;
	color: #fff;
	mix-blend-mode: difference;
	font: 400 17px/19px var(--serif);
	pointer-events: none;
}
@supports not (mix-blend-mode: difference) {
	.pinned { color: #000; mix-blend-mode: normal; }
}
html.no-blend .pinned { color: #000; mix-blend-mode: normal; }
@media (forced-colors: active) {
	.pinned { color: CanvasText; background: Canvas; mix-blend-mode: normal; }
}

@supports not (mix-blend-mode: difference) {
	.nav { color: #000; mix-blend-mode: normal; }
}
/* Test hook: the e2e suite adds html.no-blend to check the same fallback as @supports not. */
html.no-blend .nav { color: #000; mix-blend-mode: normal; }
@media (forced-colors: active) {
	.nav { color: CanvasText; background: Canvas; mix-blend-mode: normal; }
}

@media (max-width: 640px) {
	.nav { font-size: 17px; line-height: 19px; }
	.nav__grid { display: flex; gap: 22px; align-items: flex-start; }
	.nav__ctx { display: none; }
	.nav__end { margin-left: auto; }
}
/* The smallest phones (320px): a tighter line, so the toggle or Work stays on screen. */
@media (max-width: 360px) {
	.nav { font-size: 15px; line-height: 17px; }
	.nav__grid { gap: 14px; }
}

main { display: block; padding-top: 100px; }
@media (max-width: 640px) { main { padding-top: 74px; } }
main:focus { outline: none; }

/* Page grid; --cols is 8, 6 or 3. */
.grid {
	display: grid;
	grid-template-columns: repeat(var(--cols), 1fr);
	column-gap: var(--cg);
	padding: 0 var(--g);
}

/* Home (spec 3.5): one photo at its own shape, as large as fits 100% wide within 16px margins and 80vh tall.
   The box takes the photo's ratio (--ar), so nothing moves while it loads. The line and the link sit under it,
   on the photo's left edge. */
.home-hero { padding: 0 16px; }
.home-hero__inner { width: 100%; margin: 0 auto; }
.home-hero__inner[style] { width: min(100%, calc(80vh * var(--ar))); }
.home-hero__photo a { display: block; }
.home-hero__photo picture { aspect-ratio: var(--ar); }
.home-hero__photo img { width: 100%; height: 100%; object-fit: contain; }
.home-hero h1 { margin-top: 16px; font: 400 24px/32px var(--serif); text-wrap: balance; }
.home-hero__more {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	margin-top: 4px;
	font: 400 14px/17px var(--sans);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.home-index { margin-top: 88px; }
@media (max-width: 640px) { .home-index { margin-top: 56px; } }

/* Project page: the head on the page grid, a gallery of photos at their own shape (the category tile rules), then the footer. */
.project-head { align-items: start; row-gap: 24px; margin-bottom: var(--rg); }
.project-head__cap { grid-column: 1 / span 2; }
.project-head h1 { font: 400 24px/32px var(--serif); }
.project-head__client, .project-head__line { margin: 4px 0 0; font: 400 14px/17px var(--sans); }
.project-head__line { color: var(--muted); }
.project-head__desc { grid-column: 3 / span 4; max-width: 600px; font: 400 17px/26px var(--serif); }
.project-head__desc > * { margin: 0; }
.project-head__desc > * + * { margin-top: 26px; }

.project-gallery {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	column-gap: var(--cg);
	row-gap: var(--rg);
	align-items: start;
	padding: 0 var(--g);
	margin-bottom: var(--rg);
}
.project-image {
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
/* A button centres its content; the photo fills it from the top instead. */
.project-image.tile { display: flex; flex-direction: column; justify-content: flex-start; }
.project-image.is-deferred { content-visibility: auto; }
/* The photo a gallery link pointed at (#photo-n), marked for a moment after the page scrolls to it. */
.project-image.is-marked { outline: 2px solid var(--ink); outline-offset: 6px; }
/* Back to the listing in its own row above the head (16px to it); the enquiry link after the description. */
.p-back { grid-column: 1 / -1; justify-self: start; margin-bottom: -8px; font: 400 14px/17px var(--sans); }
/* A block (as wide as its text), so with no description its top still lines up with the H1. */
.p-enquire {
	display: block;
	width: fit-content;
	font: 400 14px/17px var(--sans);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.p-foot { align-items: baseline; row-gap: 12px; padding-bottom: var(--rg); }
.p-foot__prev, .p-foot__next { justify-self: start; font: 400 15px/17px var(--serif); }
.p-foot__prev { grid-column: 1 / span 2; }
/* Next sits at the right edge (owner, 2026-11-17); on phones it stacks under Previous, still on the right. */
.p-foot__next { grid-column: -3 / -1; justify-self: end; text-align: right; }

@media (max-width: 1100px) {
	.project-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.project-head__desc { grid-column: 3 / -1; }
}
@media (max-width: 640px) {
	.project-head__cap, .project-head__desc, .p-foot__prev, .p-foot__next { grid-column: 1 / -1; }
	.project-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
}

/* Disciplines list: the H1 at the reading column, then the category pages' Index rows (.row). */
.disciplines__head { margin-bottom: var(--rg); }
.disciplines__head h1 { grid-column: 3 / span 4; font: 400 24px/32px var(--serif); }
.row__count { font: 400 14px/17px var(--sans); color: var(--muted); }
@media (max-width: 1100px) { .disciplines__head h1 { grid-column: 2 / span 4; } }
@media (max-width: 640px) { .disciplines__head h1 { grid-column: 1 / -1; } }

/* Work: the H1 and the category filters at the reading column, then the gallery grid (the Images view's). */
.work__head { row-gap: 16px; margin-bottom: 56px; }
.work__head h1 { grid-column: 3 / -1; font: 400 24px/32px var(--serif); }
.work-filters { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; font: 400 17px/26px var(--serif); }
.work-filters a { display: inline-flex; align-items: baseline; min-height: 26px; color: var(--ink); }
.work-filters a[aria-current] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.work-filters__n { margin-left: 4px; font: 400 14px/26px var(--sans); color: var(--muted); }
@media (max-width: 1100px) { .work__head h1, .work-filters { grid-column: 2 / -1; } }
@media (max-width: 640px) { .work__head h1, .work-filters { grid-column: 1 / -1; } .work__head { margin-bottom: 40px; } }

/* Category page: intro in the reading column, then the Images and Index views. */
.discipline-intro { row-gap: 18px; margin-bottom: 88px; }
.discipline-intro > * { grid-column: 3 / span 4; max-width: 600px; }
.discipline-intro h1 { font: 400 24px/32px var(--serif); text-wrap: balance; }
.discipline-intro p { font: 400 17px/26px var(--serif); }
.discipline-book { font: 400 14px/17px var(--sans); }
.discipline-book a {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Even-height rows: every photo in a row has the same height and its own shape (never cropped), and a row
   stretches to the full width. --ar is the photo's width over height (clamped to 0.4-2.5 on the server);
   the picture's aspect-ratio reserves the space, so nothing moves while photos load. The last row stays at its
   natural size: li.tiles__end takes all the spare room first. */
.tiles.grid {
	--row-h: 300px;
	display: flex;
	flex-wrap: wrap;
	gap: 56px 24px;
	margin: 0;
	padding: 0 16px;
	list-style: none;
}
.tiles > li { flex: var(--ar) 1 calc(var(--ar) * var(--row-h)); min-width: 0; }
.tiles > .tiles__end { flex: 1000 1 0; height: 0; }
.tile { display: block; }
.tile picture { display: block; }
.tile img { display: block; width: 100%; height: auto; }
.tiles .tile picture { aspect-ratio: var(--ar); }
.tiles .tile img { height: 100%; object-fit: contain; }
.tile__name {
	display: block;
	margin-top: 8px;
	overflow: hidden;
	color: var(--muted);
	font: 400 13px/16px var(--sans);
	text-overflow: ellipsis;
	white-space: nowrap;
}
@media (max-width: 1100px) {
	.tiles.grid { --row-h: 240px; gap: 40px 16px; padding: 0 12px; }
}
@media (max-width: 640px) {
	.tiles.grid { --row-h: 160px; gap: 32px 12px; padding: 0 8px; }
}

/* Index view: one project per row, caption in columns 1-2, lead image in 3-5. */
.index { display: grid; row-gap: var(--rg); }
.row { align-items: start; }
.row__cap { grid-column: 1 / span 2; display: grid; row-gap: 4px; }
.row__title { font: 400 15px/17px var(--serif); }
.row__client, .row__date { font: 400 14px/17px var(--sans); color: var(--muted); }
.row__img { grid-column: 3 / span 3; }
.row__img img { display: block; width: 100%; height: auto; }
.row:hover { text-decoration: none; }
.row:hover .row__title {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

@media (max-width: 1100px) {
	.discipline-intro > * { grid-column: 2 / span 4; }
	.row__img { grid-column: 3 / span 4; }
}

@media (max-width: 640px) {
	.discipline-intro { margin-bottom: 56px; }
	.discipline-intro > * { grid-column: 1 / -1; }
	.row__cap { grid-column: 1 / -1; }
	.row__img { grid-column: 1 / -1; padding: 0 12%; }
	/* The pinned line shows the caption; the row keeps it for its accessible name. A row with no image
	   keeps its caption visible, or it would have no height at all. */
	.index.has-pin .row:has(.row__img) .row__cap {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Slider: a native dialog, so focus is trapped and Escape closes it. */
[hidden] { display: none !important; }

.slider {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--paper);
	color: var(--ink);
	overflow: hidden;
}
.slider::backdrop { background: var(--paper); }

/* Caption and Close at the top, N/M bottom left: white text blended like the nav, so it reads over the image. */
.slider__top, .slider__counter {
	position: absolute;
	z-index: 2;
	color: #fff;
	mix-blend-mode: difference;
	font: 400 15px/17px var(--serif);
}
.slider__top {
	top: 0; left: 0; right: 0;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 15px var(--g) 0;
	pointer-events: none;
}
.slider__cap { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slider__client { opacity: 0.54; }
.slider__close {
	margin: -4px 0;
	padding: 4px 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
	pointer-events: auto;
}
.slider__counter { left: var(--g); bottom: 15px; font-variant-numeric: tabular-nums; }
@supports not (mix-blend-mode: difference) {
	.slider__top, .slider__counter { color: #000; mix-blend-mode: normal; }
}
html.no-blend .slider__top, html.no-blend .slider__counter { color: #000; mix-blend-mode: normal; }
@media (forced-colors: active) {
	.slider__top, .slider__counter { color: CanvasText; mix-blend-mode: normal; }
}

/* The image, centred and fitted to the screen. The halves of the screen are Previous and Next. */
.slider__stage {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y pinch-zoom;
}
.slider__stage picture { display: block; }
.slider__stage img { display: block; width: auto; height: auto; max-width: 100vw; max-height: 100dvh; }
.slider__prev, .slider__next {
	position: absolute;
	z-index: 1;
	top: 0;
	bottom: 0;
	width: 50%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	touch-action: pan-y pinch-zoom;
}
.slider__prev { left: 0; cursor: w-resize; }
.slider__next { right: 0; cursor: e-resize; }
.slider__prev:focus-visible, .slider__next:focus-visible { outline-offset: -8px; box-shadow: inset 0 0 0 6px #fff; }

@media (max-width: 640px) {
	.slider__top, .slider__counter { font-size: 17px; line-height: 19px; }
	.slider__stage { top: 64px; bottom: 56px; }
	.slider__stage img { max-height: calc(100dvh - 120px); }
}

/* Home ending: the question in the reading serif, then the links in sans, at the reading column. */
.feed-ending { margin-top: var(--rg); }
.feed-ending__body {
	grid-column: 3 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	align-items: center;
	font: 400 14px/17px var(--sans);
}
.feed-ending p { flex-basis: 100%; font: 400 17px/26px var(--serif); }
@media (max-width: 1100px) { .feed-ending__body { grid-column: 2 / -1; } }
@media (max-width: 640px) { .feed-ending__body { grid-column: 1 / -1; } }
.feed-ending a, .contact-row a {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	line-height: 1;
}

/* Contact row: one muted sans line at the foot of every page, 140px under the content. */
body > footer { margin-top: 140px; padding: 0 var(--g) var(--g); }
.contact-row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	font: 400 14px/17px var(--sans);
}
.contact-row a { color: var(--muted); }

/* About + Contact: main column 3-6, side column 7-8, lists across 3-8, then the contact section. */
.about__label { margin: 0; color: var(--muted); font: 400 14px/17px var(--sans); }
.about__main { grid-column: 3 / span 4; }
.about__main > h1 { margin-bottom: 24px; }
.about-copy { max-width: 600px; font: 400 17px/26px var(--serif); }
.about-copy > * { margin: 0; font: inherit; }
.about-copy > * + * { margin-top: 26px; }
.about-copy .about__lede { font-size: 24px; line-height: 32px; }
.about-copy a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.about__side { grid-column: 7 / span 2; font: 400 14px/17px var(--sans); }
.about__side .about__label { margin-bottom: 8px; }
.contact__channels, .about__list ul { margin: 0; padding: 0; list-style: none; }
.contact__channels a, .about__brief a, .about__list a { display: inline-flex; align-items: center; min-height: 24px; }
.about__brief { margin: 12px 0 0; }
.contact__channels a, .about__brief a { color: var(--accent); }
.about__lists {
	grid-column: 3 / -1;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--cg);
	margin-top: 96px;
}
.about__list .about__label { margin-bottom: 8px; }
.about__list li { font: 400 14px/24px var(--sans); }

.contact { margin-top: 120px; scroll-margin-top: 60px; }
.contact__body { grid-column: 3 / span 4; }
.contact__title { font: 400 24px/32px var(--serif); }
.contact__lede { margin: 8px 0 0; font: 400 17px/26px var(--serif); }
.contact__form { margin-top: 40px; }

/* The brief form: muted labels over serif fields with a single black underline. */
.contact .wpcf7-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--cg);
	row-gap: 24px;
}
.contact .hidden-fields-container { display: none; }
.contact .field p { margin: 0; }
.contact .field:has(textarea), .contact .field--submit, .contact .wpcf7-response-output { grid-column: 1 / -1; }
.contact label { display: block; margin-bottom: 6px; color: var(--muted); font: 400 14px/17px var(--sans); }
.contact .wpcf7-form-control-wrap { display: block; }
.contact input[type="text"], .contact input[type="email"], .contact input[type="tel"],
.contact select, .contact textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: 6px 0;
	border: 0;
	border-bottom: 1px solid var(--ink);
	border-radius: 0;
	background-color: transparent;
	color: var(--ink);
	font: 400 17px/26px var(--serif);
}
.contact textarea { min-height: 128px; resize: vertical; }
/* Not only the text: an invalid field's underline turns dashed. */
.contact [aria-invalid="true"] { border-bottom-style: dashed; }
.contact .wpcf7-not-valid-tip { display: block; margin-top: 6px; color: var(--ink); font: 400 14px/17px var(--sans); }
.contact .wpcf7-submit {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--ink);
	font: 400 24px/32px var(--serif);
	cursor: pointer;
}
.contact .wpcf7-submit:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.contact .wpcf7-response-output { margin: 0; padding: 0; border: 0; color: var(--ink); font: 400 14px/17px var(--sans); }
.contact .wpcf7-response-output:empty, .contact .wpcf7-spinner { display: none; }
.contact .screen-reader-response {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden;
	clip-path: inset(50%);
}

@media (max-width: 1100px) {
	.about__main, .contact__body { grid-column: 2 / span 4; }
	.about__side { grid-column: 6 / -1; }
	.about__lists { grid-column: 2 / -1; }
}
@media (max-width: 640px) {
	.about__main, .about__side, .about__lists, .contact__body { grid-column: 1 / -1; }
	.about__side { margin-top: 40px; }
	.about__lists { grid-template-columns: 1fr; row-gap: 24px; margin-top: 56px; }
	.contact { margin-top: 80px; }
	.contact .wpcf7-form { grid-template-columns: 1fr; }
}

/* Plain content (index.php, 404): one serif line at the reading column. */
.plain { padding: 0 var(--g); }
.plain > * + * { margin-top: 1.1em; }
.plain h1 { font: 400 24px/32px var(--serif); }
.plain__body { grid-column: 3 / span 4; max-width: 600px; font: 400 17px/26px var(--serif); }
.plain-links { display: flex; gap: 16px; margin-top: 16px; font: 400 14px/17px var(--sans); }
.plain-links a { display: inline-flex; align-items: center; min-height: 24px; }
@media (max-width: 1100px) { .plain__body { grid-column: 2 / span 4; } }
@media (max-width: 640px) { .plain__body { grid-column: 1 / -1; } }

/* Motion. Everything in this block is off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {

	.js img[loading="lazy"] { transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1); }
	.js img[loading="lazy"]:not(.is-loaded) { opacity: 0; }

	.home-hero h1, .home-hero__more { transition: opacity 300ms; }
	html.intro-flying .home-hero h1, html.intro-flying .home-hero__more { transition: opacity 300ms 400ms; }

	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: none; }
	::view-transition-new(root) { animation: spice-slide-in 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}

@keyframes spice-slide-in {
	from { transform: translateY(-160px); }
	to { transform: none; }
}

/* Home page intro (first visit only, assets/js/intro.js). The head gate adds html.has-intro before the page
   paints, so the page is covered and cannot be clicked until the wall is built and dismissed. */
html.has-intro { overflow: hidden; }
html.has-intro::after { content: ""; position: fixed; inset: 0; z-index: 199; background: var(--paper); }
/* Covered anyway: hidden, so the page's largest paint is the wall the visitor sees, not the page beneath it. */
html.has-intro main { visibility: hidden; }
.intro { position: fixed; inset: 0; z-index: 200; overflow: hidden; background: var(--paper); touch-action: none; cursor: default; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.intro__wall { position: absolute; top: 0; left: 0; display: grid; box-sizing: border-box; will-change: transform; }
.intro__wall picture { display: block; }
.intro__wall img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.intro__lens { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Dismissal (assets/js/intro-fly.js): html.intro-flying while the hero tile's photo (.intro__fly) flies onto the hero,
   html.intro-fading for the plain 200ms fade (reduced motion, no hero tile). Either way the page shows under the
   fading wall. The hero line and link stay hidden until then; after a flight they fade in over its last 0.3s. */
html.intro-flying::after, html.intro-fading::after { content: none; }
/* The page gets its scrollbar back (if the platform shows one) before intro-fly.js measures the hero box, so the
   clone lands where the hero will be. intro-fly.js keeps the page at the top until the flight or fade ends. */
html.intro-flying, html.intro-fading { overflow: visible; }
/* The gate's Skip intro button (inc/intro.php): the skip link look, above the wall; gone once the intro is. */
.intro-skip { z-index: 202; font: inherit; color: inherit; cursor: pointer; }
html:not(.has-intro) .intro-skip { display: none; }
html.intro-flying main, html.intro-fading main { visibility: visible; }
html.has-intro .home-hero h1, html.has-intro .home-hero__more { opacity: 0; }
html.intro-flying .home-hero h1, html.intro-flying .home-hero__more,
html.intro-fading .home-hero h1, html.intro-fading .home-hero__more { opacity: 1; }
.intro__fly { position: fixed; top: 0; left: 0; z-index: 201; max-width: none; margin: 0; object-fit: cover; pointer-events: none; }
