/* ==========================================================================
   Blog index. Hero, archive list, search and chips follow arriqaaq.github.io.
   The construction yard (crane, house, crew, truck road) is carried over as it
   was: its scene, animation and road arrows are unchanged. Only its frame, the
   panel on top and the panel buttons take the new look.
   ========================================================================== */

/* Legacy colours, used only by the carried-over yard and glyph rules below. */
:root {
	--fg: #1a1a1a;
	--alt: #fffaf0;
	--safety: #ffd43b;
	--safety-dark: #b98500;
	--warm: #ef4444;
}

/* The yard's road and scene never need sideways scrolling on phones. */
body {
	overflow-x: clip;
}

/* ---- Hero ------------------------------------------------------------------ */

.hero {
	display: grid;
	justify-items: center;
	gap: var(--s-4);
	padding-block: var(--s-8) var(--s-6);
	text-align: center;
}

.hero h1 {
	margin: 0;
	font-size: clamp(3.25rem, 1.7rem + 7.4vw, 7rem);
	font-weight: 500;
	line-height: 0.95;
	letter-spacing: var(--ls-display);
}

.hero .sub {
	max-width: 34rem;
	margin: 0;
	font-size: var(--fs-lead);
	line-height: 1.5;
	color: var(--ink-2);
	text-wrap: balance;
}

/* ---- Construction yard: frame and panel -------------------------------------- */

.yard {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-lg);
	background: #dceaf4;
	margin: var(--s-5) 0 var(--s-8);
	min-height: 440px;
}

.yard-panel {
	position: relative;
	z-index: 2;
	width: min(470px, calc(100% - 2rem));
	margin: 1.2rem;
	padding: var(--s-4) var(--s-5);
	background: rgba(255, 255, 255, 0.95);
	border-radius: var(--r);
	box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}

.yard-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--purple-ink);
}

.yard-panel strong {
	display: block;
	margin: 0.35rem 0;
	font-size: clamp(1.15rem, 3vw, 1.5rem);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.yard-panel p {
	margin: 0.35rem 0 0.7rem;
	font-size: var(--fs-small);
	line-height: 1.45;
	color: var(--ink-2);
}

.yard-stats {
	font-size: var(--fs-xs);
	font-variant-numeric: tabular-nums;
	color: var(--ink-3);
}

.yard-controls {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-2);
	margin-top: var(--s-4);
}

.yard-controls .btn {
	min-height: 40px;
	padding: 9px 16px;
}

/* ---- Yard scene (carried over unchanged) ------------------------------------- */

.yard-sky {
	position: absolute;
	inset: 0 0 112px;
	overflow: hidden;
	background: linear-gradient(#dceaf4 0 67%, #fffaf0 67%);
}

.yard-sky svg {
	width: 100%;
	height: 100%;
	display: block;
}

.crane-hook {
	transform-origin: 79% 19%;
	animation: hook-sway 3.2s ease-in-out infinite;
}

.cloud {
	animation: cloud-drift 18s linear infinite;
}

.cloud-b {
	animation-delay: -9s;
}

@keyframes hook-sway {
	50% {
		transform: translateX(7px);
	}
}

@keyframes cloud-drift {
	50% {
		transform: translateX(22px);
	}
}

@keyframes dispatch-crane {
	0% {
		transform: translateY(0);
	}
	38% {
		transform: translateY(38px);
	}
	72% {
		transform: translateY(38px) rotate(2deg);
	}
	100% {
		transform: translateY(0);
	}
}

.yard-panel::after {
	content: 'dispatched';
	position: absolute;
	right: 12px;
	top: 10px;
	padding: 0.18rem 0.4rem;
	border: 2px solid var(--warm);
	border-radius: 4px;
	color: var(--warm);
	font: 800 0.58rem 'JetBrains Mono', monospace;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0;
	transform: scale(1.25) rotate(-5deg);
}

.yard-road {
	--job: 0;
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	bottom: 0;
	height: 112px;
	background: #b9b6a3;
	border-top: 3px solid var(--fg);
}

.yard-road::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 61px;
	border-top: 4px dashed #fffaf0;
}

.road-arrow {
	position: absolute;
	z-index: 7;
	top: 53px;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 2px solid var(--fg);
	border-radius: 50%;
	background: var(--safety);
	color: var(--fg);
	box-shadow: 3px 3px 0 var(--fg);
	font: 900 1.2rem/1 'Inter', sans-serif;
	cursor: pointer;
}

.road-arrow:hover {
	transform: translate(-1px, -1px);
	box-shadow: 4px 4px 0 var(--fg);
}

.road-arrow:active {
	transform: translate(2px, 2px);
	box-shadow: 1px 1px 0 var(--fg);
}

.road-arrow-left {
	left: 12px;
}

.road-arrow-right {
	right: 12px;
}

.yard-stops {
	position: absolute;
	left: 10%;
	right: 10%;
	top: 7px;
	display: flex;
	justify-content: space-between;
}

.yard-stop {
	position: relative;
	z-index: 3;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 2px solid var(--fg);
	border-radius: 50%;
	background: var(--alt);
	color: var(--fg);
	font: 700 0.65rem 'JetBrains Mono', monospace;
	cursor: pointer;
}

.yard-stop.active {
	background: var(--safety);
	transform: scale(1.12);
}

.yard-truck {
	position: absolute;
	z-index: 4;
	left: calc(10% + var(--job) * 80%);
	bottom: 9px;
	width: 78px;
	height: 43px;
	overflow: visible;
	transform: translateX(-39px);
	transition: left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.yard.facing-left .yard-truck {
	transform: translateX(-39px) scaleX(-1);
}

.yard-truck .wheel {
	transform-box: fill-box;
	transform-origin: center;
	animation: wheel-turn 0.55s linear infinite;
	animation-play-state: paused;
}

.yard-truck .exhaust {
	opacity: 0;
}

.yard.moving .yard-truck .wheel {
	animation-play-state: running;
}

.yard.moving .yard-truck .exhaust {
	animation: exhaust-puff 0.6s ease-out;
}

.yard.moving .crane-hook {
	animation: dispatch-crane 0.65s ease-in-out;
}

.yard.moving .crew-rig {
	animation: dispatch-signal 0.65s ease-in-out;
}

.yard.moving .yard-panel {
	animation: panel-bump 0.65s ease;
}

.yard.moving .yard-panel::after {
	animation: dispatch-stamp 0.65s ease both;
}

@keyframes wheel-turn {
	to {
		transform: rotate(360deg);
	}
}

@keyframes exhaust-puff {
	0% {
		opacity: 0;
		transform: translateX(7px) scale(0.4);
	}
	35% {
		opacity: 0.8;
	}
	100% {
		opacity: 0;
		transform: translateX(-9px) scale(1.35);
	}
}

@keyframes dispatch-signal {
	40% {
		transform: translateY(-5px) rotate(-4deg);
	}
}

@keyframes panel-bump {
	45% {
		transform: translateY(-3px);
	}
}

@keyframes dispatch-stamp {
	35%,
	70% {
		opacity: 1;
		transform: scale(1) rotate(-5deg);
	}
}

.crew-rig {
	transform-origin: 13% 82%;
	animation: crew-wave 2.4s ease-in-out infinite;
}

@keyframes crew-wave {
	50% {
		transform: rotate(2deg) translateY(-2px);
	}
}

/* ---- Archive: search, topic chips, post rows ---------------------------------- */

.section-head {
	display: grid;
	gap: var(--s-3);
	margin-bottom: var(--s-5);
}

.section-head h2 {
	margin: 0;
	font-size: var(--fs-h2);
	font-weight: 500;
	line-height: var(--lh-heading);
	letter-spacing: -0.03em;
}

.archive-console {
	display: grid;
	gap: var(--s-4);
	margin-bottom: var(--s-4);
}

.archive-bar {
	display: flex;
	align-items: center;
	gap: var(--s-4);
}

.archive-search {
	flex: 1;
	min-width: 0;
	min-height: var(--tap);
	padding: 10px 18px;
	border: 0;
	border-radius: var(--r-pill);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	font-size: var(--fs-small);
	letter-spacing: 0;
	-webkit-appearance: none;
	appearance: none;
}

.archive-search::placeholder {
	color: var(--ink-3);
}

.archive-search:focus-visible {
	box-shadow: var(--ring);
	border-radius: var(--r-pill);
}

.archive-count {
	flex: none;
	font-size: var(--fs-xs);
	font-variant-numeric: tabular-nums;
	color: var(--ink-3);
	white-space: nowrap;
}

#archive-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--s-7);
}

.job-card {
	margin: 0;
	border-top: 1px solid var(--line);
}

.job-card[hidden] {
	display: none;
}

a.post {
	display: grid;
	gap: 6px;
	padding-block: var(--s-5);
	color: inherit;
	text-decoration: none;
}

.post-kicker {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-1) var(--s-4);
	font-size: var(--fs-xs);
	font-weight: 500;
	line-height: 1.4;
}

.pe {
	color: var(--subject-ink, var(--purple-ink));
}

.post-date {
	color: var(--ink-3);
}

.post-title-row {
	display: flex;
	align-items: center;
	gap: var(--s-4);
	margin-block: var(--s-1);
}

.post b {
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.02em;
	text-wrap: balance;
	transition: color var(--dur-fast) ease;
}

.job-card:hover .post b,
.job-card:focus-within .post b {
	color: var(--subject-ink, var(--purple-ink));
}

.d {
	font-size: var(--fs-small);
	line-height: 1.5;
	color: var(--ink-2);
}

.m {
	font-size: var(--fs-xs);
	color: var(--ink-3);
}

/* Builder glyph beside each title: carried over unchanged. */
.post-glyph {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border: 2px solid var(--fg);
	border-radius: 11px;
	background: #fffaf0;
	box-shadow: 3px 3px 0 var(--safety);
	transform: rotate(-2deg);
	transition: transform 0.2s ease;
}

.post-glyph svg {
	display: block;
	width: 39px;
	height: 39px;
}

.job-card:nth-child(even) .post-glyph {
	transform: rotate(2deg);
}

.job-card:hover .post-glyph,
.job-card:focus-within .post-glyph {
	transform: translateY(-4px) rotate(4deg);
}

.more-wrap {
	display: flex;
	justify-content: center;
	margin: var(--s-6) 0 0;
}

.more-logs[hidden] {
	display: none;
}

/* ---- About ------------------------------------------------------------------- */

.about-block {
	display: grid;
	gap: var(--s-3);
	max-width: var(--measure);
	margin-top: var(--s-8);
}

.about-block h2 {
	margin: 0;
	font-size: var(--fs-eyebrow);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--subject-ink, var(--purple-ink));
}

p.about {
	margin: 0;
	color: var(--ink-2);
	text-wrap: pretty;
}

p.about a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--subject, var(--purple));
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
}

p.about a:hover {
	text-decoration-color: var(--ink);
}

@media (min-width: 720px) {
	.post b {
		font-size: 1.3125rem;
	}

	.hero {
		padding-block: var(--s-9) var(--s-7);
	}
}

@media (min-width: 900px) {
	#archive-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.yard {
		min-height: 480px;
	}

	.yard-sky {
		bottom: 116px;
	}

	.yard-panel {
		margin: 0.8rem;
	}

	.yard-stops {
		left: 15%;
		right: 15%;
	}

	.yard-truck {
		left: calc(15% + var(--job) * 70%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.crane-hook,
	.cloud,
	.crew-rig,
	.yard-truck .wheel,
	.yard.moving .crane-hook,
	.yard.moving .crew-rig,
	.yard.moving .yard-panel,
	.yard.moving .yard-panel::after,
	.yard.moving .yard-truck .exhaust {
		animation: none;
	}

	.yard-truck,
	.post-glyph {
		transition: none;
	}
}
