/*
 * Tristopic — base stylesheet.
 *
 * Design tokens come from theme.json as --wp--preset--* / --wp--custom--*
 * custom properties. Do not hardcode colours or spacing here; add them to
 * theme.json and reference the variable.
 */

/* ---------------------------------------------------------------- fonts --- */

/*
 * Self-hosted only. Drop the woff2 files into assets/fonts/ and these rules
 * pick them up; until then theme.json's stack falls back to Helvetica and the
 * system mono, so nothing breaks.
 */
@font-face {
	font-family: "Tristopic Grotesk";
	src: url("../fonts/grotesk-regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Tristopic Grotesk";
	src: url("../fonts/grotesk-medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Tristopic Mono";
	src: url("../fonts/mono-regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

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

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

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

:where(a, button, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
}

/* Screen-reader-only utility, matching core's class name. */
.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;
}

/* -------------------------------------------------------------- eyebrow --- */

/* Mono, uppercase, tracked-out labels. Used for meta, nav, and captions. */
.tristopic-eyebrow,
.wp-block-post-terms,
.tristopic-meta dt {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--tracking--wider);
	text-transform: uppercase;
	color: var(--wp--preset--color--paper-dim);
}

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

/*
 * Inner pages carry a slim sticky bar rather than the sphere HUD, but speak the
 * same language: mono, uppercase, hairline rule.
 */
.tristopic-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgb(from var(--wp--preset--color--ink) r g b / 0.86);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: var(--wp--custom--line);
}

.tristopic-header__inner {
	padding-block: 1.1rem;
	align-items: center;
}

.tristopic-header__right {
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.tristopic-header .wp-block-navigation,
.tristopic-header__home {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--tracking--wider);
	text-transform: uppercase;
}

.tristopic-header__home a {
	padding: 0.6em 1.2em;
	border: var(--wp--custom--line);
	border-radius: 999px;
	transition: background var(--wp--custom--duration--fast) var(--wp--custom--ease),
		color var(--wp--custom--duration--fast) var(--wp--custom--ease);
}

.tristopic-header__home a:hover {
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
}

@media (max-width: 599px) {
	.tristopic-header__right {
		gap: var(--wp--preset--spacing--20);
	}

	.tristopic-header__home {
		display: none; /* the mark already returns home on small screens */
	}
}

/* ------------------------------------------------------------- display --- */

/*
 * The one piece of oversized type on the site. Everything else is small and
 * technical, which is what gives this its weight.
 */
.tristopic-display {
	font-size: clamp(2.75rem, 11vw, 9rem);
	line-height: 0.94;
	letter-spacing: -0.035em;
	font-weight: 500;
	margin: 0;
	text-wrap: balance;
}

/* ------------------------------------------------------------- project --- */

.tristopic-project,
.tristopic-archive,
.tristopic-page {
	padding-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

.tristopic-project__head {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin-bottom: var(--wp--preset--spacing--30);
}

.tristopic-project__hero img {
	width: 100%;
	max-height: 78svh;
	object-fit: cover;
}

.tristopic-project__body {
	margin-block: var(--wp--preset--spacing--40);
}

.tristopic-project__nav {
	padding-block: var(--wp--preset--spacing--30);
	border-top: var(--wp--custom--line);
}

.tristopic-project__more {
	margin-top: var(--wp--preset--spacing--40);
}

.tristopic-project__more .tristopic-grid {
	grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
	margin-top: var(--wp--preset--spacing--20);
}

/* ----------------------------------------------------------- work index --- */

.tristopic-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
	gap: var(--wp--preset--spacing--30);
}

.tristopic-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--10);
}

.tristopic-card__media {
	overflow: hidden;
	background: var(--wp--preset--color--ink-raised);
	aspect-ratio: 3 / 4;
}

.tristopic-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.001);
	transition: transform var(--wp--custom--duration--slow) var(--wp--custom--ease);
}

.tristopic-card:hover .tristopic-card__media img {
	transform: scale(1.04);
}

/* ------------------------------------------------------------- project --- */

.tristopic-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding-block: var(--wp--preset--spacing--20);
	border-top: var(--wp--custom--line);
	border-bottom: var(--wp--custom--line);
}

.tristopic-meta dd {
	margin: 0.4em 0 0;
	font-size: var(--wp--preset--font-size--small);
}

/* ----------------------------------------------------- editorial blocks --- */

/* Asymmetric two-column split used on About and Contact. */
.tristopic-split {
	gap: var(--wp--preset--spacing--40);
}

.tristopic-split .wp-block-column > *:first-child {
	margin-top: 0;
}

/* Unbulleted, ruled list — reads as a specification, not prose. */
.tristopic-list {
	list-style: none;
	margin: 0.75em 0 var(--wp--preset--spacing--30);
	padding: 0;
}

.tristopic-list li {
	padding-block: 0.7em;
	border-bottom: var(--wp--custom--line);
	font-size: var(--wp--preset--font-size--small);
}

/* A raised band that breaks up long pages without introducing a new colour. */
.tristopic-band {
	padding: var(--wp--preset--spacing--30);
	border: var(--wp--custom--line);
	border-radius: 1.5rem;
	background: var(--wp--preset--color--ink-raised);
}

.tristopic-band .tristopic-list li:last-child {
	border-bottom: 0;
}

.tristopic-band p {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.9;
}

.tristopic-contact__mail {
	font-size: clamp(1.5rem, 4.5vw, 3rem);
	line-height: 1.05;
	letter-spacing: -0.03em;
	margin: 0.2em 0 0.6em;
	word-break: break-word;
}

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

/* The sphere and its chrome live in assets/css/sphere.css, front page only. */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

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

.tristopic-footer {
	padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--50);
	border-top: var(--wp--custom--line);
}

.tristopic-footer__cta {
	font-size: clamp(2rem, 7vw, 5rem);
	line-height: 1;
	letter-spacing: -0.03em;
	margin: 0;
}

.tristopic-footer__mail {
	margin: var(--wp--preset--spacing--20) 0 var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--lead);
}

.tristopic-footer__mail a {
	border-bottom: 1px solid var(--wp--preset--color--ink-line);
	padding-bottom: 0.1em;
}

.tristopic-footer__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: var(--wp--preset--spacing--30);
	padding-block: var(--wp--preset--spacing--30);
	border-top: var(--wp--custom--line);
}

.tristopic-footer__cols p {
	margin: 0.5em 0 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 2;
}

.tristopic-footer__base {
	padding-top: var(--wp--preset--spacing--30);
	border-top: var(--wp--custom--line);
	align-items: baseline;
}

.tristopic-footer__base p {
	margin: 0;
}
