/*
Theme Name: Nicky
Description: Presentation for nickycaparas.com: portfolio, journal and shop. Content model, forms and publishing checks live in the Nicky Core plugin.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Author: Nicky Caparas
License: GPL-2.0-or-later
Text Domain: nicky
*/

/* ---------------------------------------------------------------------------
   Tokens. Each colour has one job:
   peach   the brand ground (header, hero, page heads)
   tomato  action and display headlines; only at display sizes on white (3.8:1)
   tomato-deep  the same role at text sizes (5.5:1 on white)
   lilac   anything AI-augmented
   ink     text
--------------------------------------------------------------------------- */
:root {
	color-scheme: only light;

	--peach: #ffd8bf;
	--tomato: #f0431c;
	--tomato-deep: #c7300d;
	--lilac: #e9dbff;
	--ink: #211c1a;
	--ink-soft: #5e534e;
	--paper: #fff;
	--cream: #fbf3ec;
	--line: #e8dcd3;

	--font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--font-serif: "Fraunces", Georgia, "Times New Roman", serif;

	--gutter: clamp(1.25rem, 3vw, 3.75rem);
	--section: clamp(4rem, 9vw, 8.5rem);
	--r-card: 16px;
	--r-panel: clamp(24px, 3vw, 40px);
	--tap: 52px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Each family is two files (tools/art/make-fonts.py): latin, and latin-ext for macrons (ā ē ī ō ū) and
   the rest of Latin. The browser fetches a latin-ext file only for a page that uses one of its letters.
   The latin ranges leave out the combining marks (U+0304 and others): with them, Chrome draws ā as a plus
   a loose macron from the latin file and never fetches latin-ext. */
@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
	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: "Fraunces";
	src: url("assets/fonts/fraunces-latin-ext-full-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
	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: "Fraunces";
	src: url("assets/fonts/fraunces-latin-ext-full-italic.woff2") format("woff2");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
	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: "Archivo";
	src: url("assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-stretch: 62% 125%;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: "Fraunces";
	src: url("assets/fonts/fraunces-latin-full-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: "Fraunces";
	src: url("assets/fonts/fraunces-latin-full-italic.woff2") format("woff2");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 1.125rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--tomato-deep); }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Without this, any rule that sets `display` would show an element marked hidden. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--tomato); color: #fff; }

.wrap { max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 820px; }
.section { padding-block: var(--section); }
.section--cream { background: var(--cream); }
.visually-hidden, .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: 0.75rem 1rem; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 1rem; color: #fff; }

/* Display type: Archivo at its narrowest and heaviest. */
.display {
	font-family: var(--font-sans);
	font-weight: 900;
	font-stretch: 62%;
	text-transform: uppercase;
	line-height: 0.9;
	letter-spacing: -0.005em;
	text-wrap: balance;
}
.display--xl { font-size: clamp(3.6rem, 10.6vw, 10.25rem); }
.display--l { font-size: clamp(3rem, 7.4vw, 7rem); }
.display--m { font-size: clamp(2.4rem, 4.6vw, 4.25rem); }
.display--tomato { color: var(--tomato); }
/* One word picked out inside a display heading. */
.display .hot { color: var(--tomato-deep); }

.serif { font-family: var(--font-serif); font-variation-settings: "SOFT" 50, "WONK" 0; font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; }
.serif--l { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
.serif--m { font-size: clamp(1.3rem, 1.9vw, 1.6rem); }
.lede { font-family: var(--font-serif); font-variation-settings: "SOFT" 50, "WONK" 0; font-size: clamp(1.25rem, 1.7vw, 1.5rem); line-height: 1.4; max-width: 34em; }
.label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

.section-head { display: grid; gap: 0.75rem; justify-items: center; text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section-head--left { justify-items: start; text-align: left; }

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
	min-height: var(--tap); padding: 0.5rem 2rem;
	border: 1px solid var(--tomato); border-radius: 999px;
	background: var(--tomato); color: #fff;
	font-weight: 900; font-stretch: 62%; font-size: 1.3rem; letter-spacing: 0.01em; line-height: 1; text-transform: uppercase; text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn:active { transform: scale(0.97); }
.btn--ghost { background: var(--paper); border-color: var(--line); color: var(--tomato-deep); }
.btn--ghost:hover { background: var(--paper); border-color: var(--ink); color: var(--ink); }
.btn--small { min-height: 44px; padding-inline: 1.4rem; font-size: 1.1875rem; } /* 19px bold is large text, where white on tomato's 3.8:1 passes. */
.btn[disabled] { opacity: 0.6; cursor: progress; }
.arrow { display: inline-block; transition: transform 0.25s var(--ease); }
a:hover .arrow, .btn:hover .arrow { transform: translateX(0.25em); }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
/* 0.8rem bold is below large-text size, so the strip uses the deeper tomato for 5.5:1. */
.strip { background: var(--tomato-deep); color: #fff; text-align: center; }
.strip a { display: flex; align-items: center; justify-content: center; gap: 0.4em; min-height: 44px; padding: 0.35rem var(--gutter); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: #fff; }
.strip a:hover { text-decoration: underline; color: #fff; }
@media (max-width: 480px) { .strip a { font-size: 0.72rem; letter-spacing: 0.1em; } }

.site-header { background: var(--peach); padding-block: clamp(1rem, 2.2vw, 2rem); }
.nav-box { display: flex; align-items: stretch; border: 1px solid rgb(33 28 26 / 0.28); border-radius: 12px; min-height: 68px; background: var(--paper); overflow: clip; }
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 1.4rem 0.5rem 1rem; border-right: 1px solid rgb(33 28 26 / 0.28); text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .mark { width: 46px; height: 46px; flex: none; }

/* The face mark (inc/mark.php). It is black on white, so every ground it sits on is white. */
.mark { display: block; overflow: visible; fill: #000; }
.mark__head { transform-origin: 50% 100%; transform: rotate(calc(var(--look-x, 0) * 3deg)); transition: transform 0.25s var(--ease); }
.mark__pupil { transform: translate(calc(var(--look-x, 0) * 8px), calc(var(--look-y, 0) * 5px)); transition: transform 0.12s linear; }
.mark__eye, .mark__talk { transform-box: fill-box; transform-origin: center; }
.mark__talk { transform: scale(0); }
.mark__smirk { transition: opacity 0.15s; }
@media (prefers-reduced-motion: no-preference) {
	.mark__eye { animation: mark-blink 5.2s 1.4s infinite; }
	a:hover .mark__smirk, .mark:hover .mark__smirk, .outro__band:hover .mark__smirk { opacity: 0; }
	a:hover .mark__talk, .mark:hover .mark__talk, .outro__band:hover .mark__talk { animation: mark-talk 0.5s ease-in-out infinite alternate; }
	@keyframes mark-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
	@keyframes mark-talk { from { transform: scale(0.75, 0.25); } to { transform: scale(1, 1); } }
}
.brand__name { font-family: var(--font-serif); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.site-nav { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 1rem; padding-inline: clamp(1rem, 2.5vw, 2.5rem) 0.75rem; }
.site-nav ul { display: flex; gap: clamp(1rem, 2.6vw, 2.5rem); margin: 0; }
.site-nav li a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 900; font-stretch: 62%; font-size: 1.35rem; text-transform: uppercase; text-decoration: none; background: linear-gradient(currentColor, currentColor) left 80% / 0 2px no-repeat; transition: background-size 0.3s var(--ease); }
.site-nav li a:hover, .site-nav li a[aria-current] { color: var(--ink); background-size: 100% 2px; }
.nav-toggle { display: none; margin-left: auto; align-items: center; gap: 0.6rem; padding-inline: 1.25rem; border: 0; border-left: 1px solid rgb(33 28 26 / 0.28); background: none; font-weight: 900; font-stretch: 62%; font-size: 1.25rem; text-transform: uppercase; cursor: pointer; }
.nav-toggle__bars { width: 22px; height: 14px; border-block: 2px solid currentColor; position: relative; }
.nav-toggle__bars::after { content: ""; position: absolute; inset: 4px 0 auto; border-top: 2px solid currentColor; }

@media (max-width: 900px) {
	.nav-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
	.brand { border-right: 0; gap: 0.6rem; padding: 0.5rem 0.75rem; min-width: 0; }
	.brand .mark { width: 40px; height: 40px; }
	.brand__name { font-size: clamp(1rem, 4.6vw, 1.45rem); overflow: hidden; text-overflow: ellipsis; }
	.nav-toggle { padding-inline: 0.9rem; }
	.nav-toggle { display: inline-flex; }
	.site-nav { display: none; grid-column: 1 / -1; flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.5rem 1rem 1rem; border-top: 1px solid rgb(33 28 26 / 0.28); }
	.site-nav.is-open { display: flex; }
	.site-nav ul { flex-direction: column; gap: 0; }
	.site-nav li a { width: 100%; min-height: var(--tap); font-size: 1.8rem; }
	.js .site-nav { display: none; }
	.js .site-nav.is-open { display: flex; }
	html:not(.js) .site-nav { display: flex; }
	html:not(.js) .nav-toggle { display: none; }
}

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */
.hero { background: var(--peach); padding-block: clamp(1rem, 2vw, 2rem) clamp(2.5rem, 5vw, 4.5rem); overflow: clip; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; }
/* The headline is a short list, set smaller than the other display type so the lede and the buttons share the first screen with it. */
.hero__title { font-size: clamp(3.25rem, 7.2vw, 7.5rem); }
.hero__title span { display: block; }
.hero__title span:last-child { color: var(--tomato-deep); }
.hero__copy .lede { margin-top: clamp(1.25rem, 2.5vw, 2rem); max-width: 27em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: clamp(1.5rem, 2.5vw, 2.25rem); }
.hero__stage { position: relative; aspect-ratio: 1; width: 100%; max-width: 34rem; justify-self: center; min-height: 320px; margin-bottom: 6.25rem; }
.hero__stage canvas, .hero__stage .stage-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__stage canvas { opacity: 0; transition: opacity 0.6s; touch-action: pan-y; cursor: grab; }
.hero__stage.is-live canvas { opacity: 1; }
.hero__stage.is-live .stage-fallback { opacity: 0; }
.stage-fallback { transition: opacity 0.6s; }
/* Under the stage: the note between the arrows, then one row of pips, one for each object. The scene adds
   the controls when it starts, so the room for them is kept from the first paint. The note is sized so that
   its longest line ("Toadstool · Clearing the plate") stays on one line between the arrows on a 390px screen. */
.stage-note { position: absolute; inset: 100% 2.75rem auto; display: grid; place-items: center; max-width: 16.5rem; min-height: 44px; margin: 0.25rem auto 0; text-align: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; font-variant-numeric: tabular-nums; color: var(--ink); }
.stage-controls { position: absolute; inset: 100% 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 16.5rem) 44px minmax(0, 1fr); margin-top: 0.25rem; }
.stage-step:first-child { grid-column: 2; }
.stage-step:nth-child(2) { grid-column: 4; }
.stage-step, .stage-pause, .stage-pip { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.stage-step { font-size: 1.125rem; font-weight: 700; transition: background-color 0.2s; }
.stage-step:hover { background: var(--paper); }
/* The pips share the stage's width: 44px each where there is room, never narrower than 28px, always 44px tall. */
.stage-pips { grid-column: 1 / -1; display: flex; justify-content: center; }
.stage-pip { flex: 0 1 44px; min-width: 28px; }
.stage-pip::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; transition: background-color 0.2s, border-color 0.2s; }
.stage-pip:hover::before { background: var(--ink); }
.stage-pip[aria-current="true"]::before { background: var(--tomato-deep); border-color: var(--tomato-deep); transform: scale(1.4); }
/* With motion allowed, the pause button comes first, just left of the back arrow, and the note keeps between the arrows. */
.is-pausable .stage-controls { grid-template-columns: minmax(44px, 1fr) 44px minmax(0, 16.5rem) 44px minmax(0, 1fr); }
.is-pausable .stage-note { left: 5.5rem; left: max(5.5rem, 50% - 8.25rem); right: max(2.75rem, min(100% - 22rem, 50% - 8.25rem)); }
.is-pausable .stage-step:nth-child(2) { grid-column: 2; }
.is-pausable .stage-step:nth-child(3) { grid-column: 4; }
.stage-pause { grid-column: 1; justify-self: end; transition: background-color 0.2s; }
.stage-pause:hover { background: var(--paper); }
.stage-pause svg { width: 16px; height: 16px; fill: currentColor; }
.hero__foot { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.75rem; margin-top: clamp(2rem, 4vw, 3.5rem); }

@media (max-width: 820px) {
	.hero__grid { grid-template-columns: 1fr; }
	.hero__stage { max-width: 420px; width: 100%; margin-inline: auto; aspect-ratio: 1; min-height: 0; }
}

/* Each headline line rises from behind its own baseline. Only clip-path and transform move, so nothing reflows. */
@media (prefers-reduced-motion: no-preference) {
	.hero__title span { animation: rise 0.9s var(--ease) both; }
	.hero__title span:nth-child(2) { animation-delay: 0.09s; }
	.hero__title span:nth-child(3) { animation-delay: 0.18s; }
	.hero__title span:nth-child(4) { animation-delay: 0.27s; }
	@keyframes rise {
		from { clip-path: inset(0 0 100% 0); transform: translateY(0.45em); }
		to { clip-path: inset(-0.1em 0 -0.1em 0); transform: none; }
	}
}

/* The small "latest work" chip under the hero. */
.mini { display: grid; grid-template-columns: 102px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 8px 16px 8px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; max-width: 30rem; min-height: 118px; }
.mini:hover { color: var(--ink); border-color: var(--ink); }
.mini img { width: 102px; height: 102px; object-fit: contain; border-radius: 8px; }
.mini__title { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.2; }
.mini__go { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--tomato); color: #fff; font-size: 1.4rem; transition: background-color 0.2s; }
.mini:hover .mini__go { background: var(--ink); }

/* ---------------------------------------------------------------------------
   Cards
--------------------------------------------------------------------------- */
.grid { display: grid; gap: clamp(1rem, 1.7vw, 1.5rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); transition: border-color 0.25s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease); transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.card:hover, .card:focus-within { border-color: var(--ink); box-shadow: 0 18px 40px -24px rgb(33 28 26 / 0.45); }
.card.is-ai { background: var(--lilac); border-color: var(--lilac); }
.card__link { display: flex; flex-direction: column; flex: 1; padding: clamp(0.75rem, 1.2vw, 1rem); text-decoration: none; color: var(--ink); }
.card__link:hover { color: var(--ink); }
/* The frame has a fixed shape and the picture is fitted inside it whole, never cropped. The picture is
   positioned rather than sized by percentage: a percentage height does not resolve against aspect-ratio. */
.card__media { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--paper); }
.card__media img, .card__media svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 0.6s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { display: grid; gap: 0.35rem; justify-items: center; text-align: center; padding: 1.25rem 0.5rem 1rem; }
.card__title { font-family: var(--font-serif); font-variation-settings: "SOFT" 50, "WONK" 0; font-weight: 400; font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.01em; }
.card__meta { font-size: 0.95rem; color: var(--ink-soft); }
.card__excerpt { font-size: 1rem; color: var(--ink-soft); line-height: 1.5; }
.tag-ai { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.2rem 0.7rem; border-radius: 999px; background: var(--ink); color: var(--lilac); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* Work cards drop the box: a framed picture, then a numbered caption set left. */
.grid, .wall { counter-reset: work; }
.work-card { counter-increment: work; background: none; border: 0; border-radius: 0; }
.work-card:hover, .work-card:focus-within { box-shadow: none; }
.work-card .card__link { padding: 0; }
.work-card .card__media { border: 1px solid var(--line); border-radius: var(--r-card); transition: border-color 0.25s; }
.work-card:hover .card__media, .work-card:focus-within .card__media { border-color: var(--ink); }
.work-card .card__body { justify-items: start; text-align: left; padding: 0.9rem 0.15rem 0; }
.work-card .card__title { font-size: 1.3rem; }
.card__num::before { content: counter(work, decimal-leading-zero); margin-right: 0.9em; color: var(--tomato-deep); }
.work-card.is-ai .card__media { background: var(--lilac); border-color: var(--lilac); }

/* The work wall: pictures keep their own proportions and stack in columns. */
.wall { columns: 3; column-gap: clamp(1.25rem, 2.4vw, 2.25rem); }
.wall .work-card { break-inside: avoid; margin-bottom: clamp(2rem, 3.5vw, 3.25rem); }
.wall .card__media { aspect-ratio: auto; display: block; }
.wall .card__media img { position: static; height: auto; display: block; }
@media (max-width: 1100px) { .wall { columns: 2; } }
@media (max-width: 640px) { .wall { columns: 1; } }

/* The home page leads with one large favourite beside two small ones. */
@media (min-width: 981px) {
	.grid--lead > :first-child { grid-column: span 2; grid-row: span 2; }
	/* The picture takes the height the two small cards leave, instead of setting it. */
	.grid--lead > :first-child .card__media { aspect-ratio: auto; flex: 1 1 0; min-height: 0; }
	.grid--lead > :first-child .card__title { font-size: clamp(1.8rem, 2.6vw, 2.5rem); }
}

.hand-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.75rem; font-size: 0.95rem; color: var(--ink-soft); }
.tag-hand { display: inline-flex; padding: 0.2rem 0.7rem; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* Journal cards: a portrait cover, then the words, left-aligned. */
.entry-card .card__media { aspect-ratio: 4 / 4.6; background: var(--peach); }
.entry-card.is-ai { background: var(--paper); border-color: var(--line); }
.entry-card.is-ai:hover { border-color: var(--ink); }
.entry-card.is-ai .card__media { background: var(--lilac); }
.entry-card .card__media img { object-fit: contain; }
.entry-card .card__media svg { width: 100%; height: 100%; }
.entry-card .card__body { justify-items: start; text-align: left; padding-inline: 0.25rem; }

/* Product cards carry price and a button. */
.product-card .price { font-family: var(--font-serif); font-size: 1.3rem; }
.product-card .card__actions { display: grid; gap: 0.6rem; padding: 0 1.5rem 1.5rem; }

.more { display: flex; justify-content: center; margin-top: clamp(2rem, 4vw, 3.5rem); }

/* ---------------------------------------------------------------------------
   Three steps with line drawings (home)
--------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { display: grid; align-content: space-between; gap: 2rem; padding-inline: clamp(1rem, 3vw, 3.5rem); border-left: 1px solid var(--tomato); }
.step:first-child { padding-left: 0; border-left: 0; }
.step:last-child { padding-right: 0; }
.step:nth-child(2) { align-content: space-between; }
.step:nth-child(2) .step__art { order: -1; }
.step__copy { display: grid; gap: 0.75rem; }
.step__copy p { font-size: 1rem; color: var(--ink-soft); max-width: 26em; }
.step__art { width: 100%; max-width: 340px; margin-inline: auto; color: var(--tomato); }
.step__art svg { width: 100%; height: auto; overflow: visible; }
@media (max-width: 820px) {
	.steps { grid-template-columns: 1fr; gap: 0; }
	/* One row per step: the words, then a small drawing beside them. */
	.step, .step:first-child, .step:last-child { grid-template-columns: minmax(0, 1fr) clamp(6.5rem, 26vw, 13rem); align-items: center; gap: 1.25rem; padding: 1.75rem 0; border-left: 0; border-top: 1px solid var(--tomato); }
	.step:nth-child(2) .step__art { order: 0; }
	.step__art { max-width: none; margin-inline: 0; }
}

/* Line drawings draw themselves when they scroll into view. Stroked shapes carry pathLength="1".
   The rules select shapes by tag, not by [pathLength]: Chrome does not restyle SVG elements matched
   through a camel-case attribute selector when an ancestor's class changes, so the drawing never starts. */
.draw path, .draw circle, .draw rect, .draw line, .draw ellipse, .draw polyline { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.draw .fill { fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: no-preference) {
	.js .draw :is(path, line, circle, rect, polyline, ellipse):not(.fill) { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
	.js .draw .fill { opacity: 0; transition: opacity 0.5s 1.2s; }
	.js .is-seen .draw :is(path, line, circle, rect, polyline, ellipse):not(.fill), .js .draw.is-seen :is(path, line, circle, rect, polyline, ellipse):not(.fill) { stroke-dashoffset: 0; }
	.js .is-seen .draw .fill, .js .draw.is-seen .fill { opacity: 1; }
}

/* ---------------------------------------------------------------------------
   The AI panel (home) and other rounded panels
--------------------------------------------------------------------------- */
.panel { border-radius: var(--r-panel); padding: clamp(2rem, 5vw, 5rem) clamp(1.25rem, 4vw, 4.5rem); }
.panel--lilac { background: var(--lilac); }
.panel--cream { background: var(--cream); }
.panel--ink { background: var(--ink); color: var(--paper); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split__copy { display: grid; gap: 1.25rem; justify-items: start; }
.split__copy p { max-width: 32em; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* A terminal window drawn in HTML: a prompt, then the reply. Illustrative, and labelled as such for screen readers. */
.terminal { background: var(--ink); color: #f4ebe4; border-radius: 14px; overflow: hidden; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(0.8rem, 1.1vw, 0.95rem); line-height: 1.7; box-shadow: 0 30px 60px -30px rgb(33 28 26 / 0.6); transform: rotate(-1.5deg); }
.terminal__bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgb(255 255 255 / 0.12); }
.terminal__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgb(255 255 255 / 0.25); }
.terminal__body { padding: 1.1rem 1.25rem 1.4rem; min-height: 15.5em; }
.terminal__body p { white-space: pre-wrap; }
.terminal .you { color: var(--peach); }
.terminal .you::before { content: "› "; color: var(--tomato); }
.terminal .it { color: #cfc4bc; }
.terminal .caret { display: inline-block; width: 0.55em; height: 1.05em; vertical-align: text-bottom; background: var(--tomato); }
@media (prefers-reduced-motion: no-preference) {
	.terminal .caret { animation: blink 1.1s steps(2, jump-none) infinite; }
	@keyframes blink { 50% { opacity: 0; } }
}

/* Discipline list with counts. */
.disciplines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 5rem); border-top: 1px solid var(--ink); }
.disciplines a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 900; font-stretch: 62%; font-size: clamp(1.6rem, 3vw, 2.6rem); text-transform: uppercase; line-height: 1; transition: color 0.2s; }
.disciplines a:hover, .disciplines a:focus-visible { color: var(--tomato); }
/* The name slides; it does not widen. Wider type wrapped onto a second line on narrow screens and pushed the page down. */
.disciplines .name { display: inline-block; transition: transform 0.35s var(--ease); }
.disciplines a:hover .name, .disciplines a:focus-visible .name { transform: translateX(0.3em); }
.disciplines .count { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 400; font-stretch: 100%; color: var(--ink-soft); }
@media (max-width: 700px) { .disciplines { grid-template-columns: 1fr; } }

/* About teaser: a tilted photo. */
.photo { border-radius: var(--r-card); overflow: hidden; transform: rotate(2deg); border: 10px solid var(--paper); box-shadow: 0 30px 60px -30px rgb(33 28 26 / 0.5); }
.photo img { width: 100%; }

/* ---------------------------------------------------------------------------
   Page heads and prose
--------------------------------------------------------------------------- */
.page-head { background: var(--peach); padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(2.5rem, 6vw, 5rem); }
.page-head__inner { display: grid; gap: 1.25rem; }
.page-head .crumb { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.page-head .crumb a { text-decoration: none; }
.page-head .crumb a:hover { text-decoration: underline; color: var(--ink); }
.page-head .label { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0.3rem 1.1rem; border: 1px solid rgb(33 28 26 / 0.3); border-radius: 999px; background: transparent; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.chip:hover { background: var(--paper); color: var(--ink); }
.chip[aria-current], .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* This stylesheet also sets the block editor's canvas, so these rules name it too: .is-root-container holds what is typed, and .wp-block-freeform > div is the inside of a Classic block there. */
.prose, .is-root-container { font-size: 1.2rem; line-height: 1.7; }
.prose > * + *, .is-root-container > * + *, .wp-block-freeform > div > * + * { margin-top: 1.35em; }
.prose h2, .is-root-container h2 { font-family: var(--font-serif); font-variation-settings: "SOFT" 50, "WONK" 1; font-weight: 500; font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.01em; margin-top: 2.2em; }
.prose h3, .is-root-container h3 { font-size: 1.25rem; font-weight: 700; margin-top: 2em; }
.prose a, .is-root-container a { color: var(--tomato-deep); }
.prose ul, .prose ol, .is-root-container ul, .is-root-container ol { padding-left: 1.3em; }
.prose li + li, .is-root-container li + li { margin-top: 0.5em; }
.prose blockquote, .is-root-container blockquote { padding-left: 1.25rem; border-left: 3px solid var(--tomato); font-family: var(--font-serif); font-style: italic; font-size: 1.35rem; line-height: 1.4; }
.prose code, .is-root-container code { padding: 0.1em 0.35em; border-radius: 6px; background: var(--cream); font-size: 0.9em; }
.prose img, .is-root-container img { border-radius: var(--r-card); }
/* Editor only: the canvas keeps the page's gutter, and the title box sits straight above what is typed, with room under it for the toolbar of a first block that is selected (48px tall, 8px above its block). */
.editor-styles-wrapper { padding-inline: var(--gutter); }
.editor-post-title { margin-bottom: 4rem; line-height: 1.2; }
/* A diary entry opens with a large first letter. */
.prose--entry > p:first-of-type::first-letter { float: left; margin: 0.08em 0.12em 0 0; font-family: var(--font-sans); font-weight: 900; font-stretch: 62%; font-size: 4.6em; line-height: 0.82; color: var(--tomato); }

.pullquote { margin-block: clamp(2.5rem, 5vw, 4rem); padding: clamp(1.5rem, 4vw, 3rem); border-radius: var(--r-panel); background: var(--peach); font-family: var(--font-serif); font-variation-settings: "SOFT" 100, "WONK" 1; font-style: italic; font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.is-ai-entry .pullquote { background: var(--lilac); }

/* Facts beside a piece of work or a shop item. */
.facts { display: grid; margin: 0; border-top: 1px solid var(--ink); }
.facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding-block: 0.8rem; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); padding-top: 0.35em; }
.facts dd { margin: 0; }
.facts a { color: var(--tomato-deep); }

.piece { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.piece__media { display: grid; gap: 1rem; }
.piece__media img, .piece__media video { width: 100%; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--paper); }
.piece__side { display: grid; gap: 2rem; position: sticky; top: 1.5rem; }
.piece__side .prose { font-size: 1.1rem; }
.ai-note { display: grid; gap: 0.5rem; padding: 1.25rem; border-radius: var(--r-card); background: var(--lilac); font-size: 1rem; }
@media (max-width: 900px) { .piece { grid-template-columns: 1fr; } .piece__side { position: static; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: var(--section); border-top: 1px solid var(--ink); }
.pager a { display: grid; gap: 0.3rem; padding-block: 1.25rem; text-decoration: none; }
.pager a:last-child { text-align: right; }
.pager a:only-child { grid-column: 1 / -1; }
.pager .next { grid-column: 2; }

/* Journal list: one row per year. */
.year { display: grid; grid-template-columns: clamp(5rem, 14vw, 13rem) minmax(0, 1fr); gap: clamp(1rem, 3vw, 3rem); padding-block: clamp(2rem, 4vw, 3.5rem); border-top: 1px solid var(--ink); }
.year__label { position: sticky; top: 1rem; align-self: start; color: var(--tomato); font-size: clamp(2.6rem, 7vw, 6.5rem); }
.year .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .year .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
	.year { grid-template-columns: 1fr; gap: 1rem; padding-block: 1.75rem; }
	.year__label { position: static; }
	.year .grid { grid-template-columns: 1fr; gap: 0.75rem; }
	/* Forty full-width covers make a very long page on a phone: each entry becomes a row with a small cover. */
	.year .entry-card .card__link { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; align-items: start; padding: 0.75rem; }
	.year .entry-card .card__media { aspect-ratio: 1; border-radius: 8px; }
	.year .entry-card .card__body { padding: 0.15rem 0 0; }
	.year .entry-card .card__title { font-size: 1.2rem; }
	.year .entry-card .card__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 0.95rem; }
}

/* Page links under a list (the_posts_pagination()), drawn like the chips. */
.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0.3rem 1.1rem; border: 1px solid rgb(33 28 26 / 0.3); border-radius: 999px; font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: border-color 0.2s; }
.pagination a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.pagination .current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pagination .dots { border-color: transparent; }

/* Empty states say what is true and what to do next. */
.empty { display: grid; gap: 1.5rem; justify-items: center; text-align: center; padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 4vw, 4rem); border: 1px dashed rgb(33 28 26 / 0.35); border-radius: var(--r-panel); }
.empty .step__art { max-width: 220px; }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* The search box (searchform.php), on search results and the not-found page. Not `.search`: WordPress puts that class on <body> for results. */
.search-box { display: grid; gap: 0.5rem; max-width: 34rem; }
.search-box__row { display: flex; gap: 0.5rem; }
.search-box input { flex: 1; width: 100%; min-width: 0; min-height: var(--tap); padding: 0.5rem 1.25rem; border: 1px solid rgb(33 28 26 / 0.55); border-radius: 999px; background: var(--paper); }
.search-box input:hover { border-color: var(--ink); }

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */
/* The contact form's own rules are in assets/css/contact.css, loaded on the contact page only. */
.trap { position: absolute; left: -9999px; }
.notice { padding: 1.25rem 1.5rem; border-radius: var(--r-card); background: var(--cream); border: 1px solid var(--line); }
.notice--good { background: #e3f4e6; border-color: #b7dcbd; }
.notice--bad { background: #fde7e2; border-color: #f2b9ad; }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.outro { padding-block: clamp(3rem, 6vw, 5.5rem) clamp(2.5rem, 5vw, 4.5rem); }
.outro__band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem clamp(1.5rem, 5vw, 5rem); align-items: end; padding-top: clamp(2rem, 4vw, 3.5rem); border-top: 1px solid var(--tomato); }
.outro__words { display: grid; gap: 1.25rem; justify-items: start; }
.outro__words .serif { max-width: 24em; }
.outro__band .mark { width: clamp(104px, 22vw, 300px); height: auto; }
@media (max-width: 560px) { .outro__band { align-items: start; } }

.site-footer { background: var(--ink); color: #e9ded6; padding-block: clamp(2rem, 4vw, 3.5rem); font-size: 0.95rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--peach); text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--paper); }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; padding-bottom: clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid rgb(255 255 255 / 0.18); }
.footer__brand { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--peach); }
.footer__brand:hover { color: #fff; text-decoration: none; }
.footer__name { font-family: var(--font-serif); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.75rem); letter-spacing: -0.02em; line-height: 1; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 0 clamp(1.25rem, 2.4vw, 2.25rem); }
.footer__nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 900; font-stretch: 62%; font-size: 1.3rem; text-transform: uppercase; }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; margin-top: 1.5rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #cfc4bc; }
.footer__legal a { text-decoration: underline; text-underline-offset: 0.25em; }
.footer__legal > * { display: inline-flex; align-items: center; }
@media (max-width: 760px) {
	.footer__top { flex-direction: column; align-items: stretch; }
	.footer__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
	.footer__nav a { min-height: var(--tap); font-size: 1.6rem; }
	.footer__legal { flex-direction: column; align-items: flex-start; gap: 0.5rem; line-height: 1.5; }
	.footer__legal a { min-height: var(--tap); }
}

/* ---------------------------------------------------------------------------
   Reveal on scroll. Content is visible without JavaScript and with reduced motion.
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	/* Moves with `translate`, so it never fights the cards' tilt, which uses `transform`. */
	.js .reveal { opacity: 0; translate: 0 28px; transition: opacity 0.7s var(--ease), translate 0.7s var(--ease), border-color 0.25s, transform 0.35s var(--ease), box-shadow 0.35s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
	.js .reveal.is-seen { opacity: 1; translate: none; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.card { transform: none; }
}

/* ---------------------------------------------------------------------------
   Print: the page's own content in ink on white, without the site's chrome.
--------------------------------------------------------------------------- */
@media print {
	.strip, .site-header, .outro, .site-footer, .skip, .chips, .pager, .pagination, .search-box, .hero__stage, .card__actions { display: none !important; }
	body { font-size: 11pt; }
	.page-head, .hero, .section--cream, .panel { background: none; }
	.section { padding-block: 1.5rem; }
	.page-head, .hero { padding-block: 0 1rem; }
	/* Everything the scroll reveals and line drawings hold back is shown, still. */
	.reveal { opacity: 1 !important; translate: none !important; transition: none !important; }
	.card { transform: none !important; box-shadow: none !important; break-inside: avoid; }
	.draw :is(path, line, circle, rect, polyline, ellipse) { stroke-dashoffset: 0 !important; transition: none !important; }
	.draw .fill { opacity: 1 !important; }
	.piece__side, .year__label { position: static; }
	.piece { grid-template-columns: 1fr; }
	/* A picture taller than what is left of a page moves to the next and leaves a blank: tall ones are scaled to fit, never cropped. */
	.piece__media img, .piece__media video { width: auto; max-height: 22cm; }
	.study .study__stage { max-width: calc(16cm * var(--ar)); }
	.study__figure { position: static; }
	.study__controls, .study__all, .study__hint { display: none !important; }
	/* Grounds that carry meaning, such as lilac for AI-augmented work, print as they show. */
	.card, .card__media, .tag-ai, .ai-note, .panel--lilac, .study { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
	a { color: var(--ink); }
	.prose a[href^="http"]::after, .facts a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; color: var(--ink-soft); }
	.btn { min-height: 0; padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; transition: none; }
}
