/* Projects page (projects.html, assets/js/projects.js) */

.projects-page {
	--pj-ink: #3d4449;
	--pj-soft: #7f888f;
	--pj-line: rgba(210, 215, 217, 0.75);
	--pj-paper: #fbfaf8;
	--pj-coral: #f56a6a;
	--pj-building: #c97a12;
	--pj-live: #2f9468;
	--pj-done: #5a67c8;
	--pj-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* The site styles every <button> as a large uppercase outline button; these are plain controls */
.projects-page .pj-filter,
.projects-page .pj-notebook-toggle {
	box-shadow: none;
	font-family: "Open Sans", sans-serif;
	height: auto;
	letter-spacing: 0;
	line-height: 1.4;
	text-transform: none;
	white-space: nowrap;
}

/* The theme gives every top-level section padding and a top rule, and every header <p> uppercase */
#main > .inner > section.pj-hero,
#main > .inner > section.pj-section,
#main > .inner > section.pj-follow { border-top: 0; }
#main > .inner > section.pj-section { padding: 0; }
.projects-page .pj-section-head p,
.projects-page .pj-follow p { font-family: "Open Sans", sans-serif; letter-spacing: 0; margin-top: 0; text-transform: none; }

/* ---------- Intro ---------- */
.projects-page #main > .inner > .pj-hero {
	max-width: 46em;
	padding-bottom: 3em;
}
.pj-lead {
	color: #5b6368;
	font-size: 1.2em;
	line-height: 1.7;
	margin: 0 0 1.4em;
}
.pj-meta {
	align-items: center;
	color: var(--pj-soft);
	display: flex;
	font-family: var(--pj-mono);
	font-size: 0.78em;
	gap: 0.8em;
	margin: 0 0 2.4em;
}
.pj-dot { background: #c7cdd1; border-radius: 50%; display: inline-block; height: 4px; width: 4px; }

/* Status filters */
.pj-filters { display: flex; flex-wrap: wrap; gap: 0.5em; }
.projects-page .pj-filter {
	align-items: center;
	background: #fff;
	border: 1px solid var(--pj-line);
	border-radius: 999px;
	color: var(--pj-ink) !important;
	cursor: pointer;
	display: inline-flex;
	font-size: 0.85em;
	font-weight: 600;
	gap: 0.5em;
	padding: 0.5em 1em;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.projects-page .pj-filter span { color: var(--pj-soft); font-family: var(--pj-mono); font-size: 0.85em; font-weight: 400; }
.projects-page .pj-filter:hover { border-color: #b7bec4; background: #fff; }
.projects-page .pj-filter.is-on { background: var(--pj-ink); border-color: var(--pj-ink); color: #fff !important; }
.projects-page .pj-filter.is-on span { color: rgba(255, 255, 255, 0.7); }
.projects-page .pj-filter:focus-visible { outline: 2px solid var(--pj-coral); outline-offset: 2px; }
.pj-swatch { border-radius: 50%; display: inline-block; height: 7px; width: 7px; }
.pj-s-building { background: var(--pj-building); }
.pj-s-live { background: var(--pj-live); }
.pj-s-done { background: var(--pj-done); }
.pj-s-idea { border: 1.5px solid var(--pj-soft); }
.pj-s-shelved { background: #c7cdd1; }

/* ---------- Sections ---------- */
.pj-section { margin: 0 0 4.5em; }
.pj-section-head {
	align-items: baseline;
	border-top: 1px solid var(--pj-line);
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1.2em;
	margin: 0 0 1.8em;
	padding-top: 1.4em;
}
.pj-section-head h2 { font-size: 1.35em; margin: 0; }
.pj-section-head p { color: var(--pj-soft); font-size: 0.92em; margin: 0; }

/* ---------- Cards ---------- */
.pj-card {
	background: #fff;
	border: 1px solid var(--pj-line);
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.pj-card:hover {
	border-color: rgba(183, 190, 196, 0.9);
	box-shadow: 0 14px 34px rgba(61, 68, 73, 0.08);
	transform: translateY(-2px);
}
.pj-card h3 { font-size: 1.3em; line-height: 1.3; margin: 0 0 0.4em; }
.pj-card p { color: #5b6368; font-size: 0.95em; line-height: 1.7; margin: 0 0 1em; }
.pj-card .pj-oneliner { color: var(--pj-ink); font-size: 1em; }
.pj-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.5em 1.6em 1.4em; }
.pj-card-top { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5em 0.9em; margin: 0 0 1em; }
.pj-date { color: var(--pj-soft); font-family: var(--pj-mono); font-size: 0.74em; }

/* Status pills */
.pj-status {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	font-size: 0.72em;
	font-weight: 700;
	gap: 0.45em;
	letter-spacing: 0.06em;
	padding: 0.3em 0.75em 0.3em 0.65em;
	text-transform: uppercase;
}
.pj-status i { border-radius: 50%; display: inline-block; height: 6px; position: relative; width: 6px; }
.pj-st-building { background: #fbf1e1; color: var(--pj-building); }
.pj-st-building i { background: var(--pj-building); }
.pj-st-building i::after {
	animation: pj-pulse 2.2s ease-out infinite;
	border: 1.5px solid var(--pj-building);
	border-radius: 50%;
	content: "";
	inset: -4px;
	position: absolute;
}
.pj-st-live { background: #e6f4ed; color: var(--pj-live); }
.pj-st-live i { background: var(--pj-live); }
.pj-st-done { background: #eceefa; color: var(--pj-done); }
.pj-st-done i { background: var(--pj-done); }
.pj-st-idea { background: transparent; border: 1px dashed #b7bec4; color: var(--pj-soft); }
.pj-st-idea i { border: 1.5px solid var(--pj-soft); }
.pj-st-shelved { background: #f1f2f3; color: #8a9297; }
.pj-st-shelved i { background: #b7bec4; }
@keyframes pj-pulse { from { opacity: 0.8; transform: scale(0.6); } to { opacity: 0; transform: scale(1.6); } }

/* Actions */
.pj-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 0.6em 1.4em; margin-top: auto; padding-top: 0.4em; }
.pj-open {
	border-bottom: 1.5px solid rgba(245, 106, 106, 0.35);
	color: var(--pj-ink) !important;
	font-size: 0.9em;
	font-weight: 600;
	padding-bottom: 1px;
	text-decoration: none;
	transition: border-color 0.2s ease;
}
.pj-open span { color: var(--pj-coral); display: inline-block; transition: transform 0.2s ease; }
.pj-open:hover { border-bottom-color: var(--pj-coral); }
.pj-open:hover span { transform: translateX(3px); }
.projects-page .pj-notebook-toggle {
	align-items: center;
	background: none;
	border: 0;
	color: var(--pj-soft) !important;
	cursor: pointer;
	display: inline-flex;
	font-size: 0.85em;
	font-weight: 600;
	gap: 0.5em;
	padding: 0;
}
.projects-page .pj-notebook-toggle span { font-family: var(--pj-mono); font-size: 0.85em; font-weight: 400; }
.projects-page .pj-notebook-toggle::after {
	border-bottom: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	content: "";
	height: 6px;
	margin: -3px 0 0 0.1em;
	transform: rotate(45deg);
	transition: transform 0.25s ease, margin 0.25s ease;
	width: 6px;
}
.projects-page .pj-notebook-toggle:hover { background: none; color: var(--pj-ink) !important; }
.projects-page .pj-notebook-toggle[aria-expanded="true"] { color: var(--pj-ink) !important; }
.projects-page .pj-notebook-toggle[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
.projects-page .pj-notebook-toggle:focus-visible { outline: 2px solid var(--pj-coral); outline-offset: 3px; }

/* Notebook: opens smoothly under the card */
.pj-notebook {
	background: var(--pj-paper);
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.35s ease;
}
.pj-notebook.is-open { grid-template-rows: 1fr; }
.pj-notebook-inner { min-height: 0; overflow: hidden; }
.pj-log {
	border-top: 1px solid var(--pj-line);
	list-style: none;
	margin: 0;
	padding: 1.3em 1.6em 1.1em 1.6em;
}
.pj-log li {
	border-left: 1px solid #e1e4e6;
	margin: 0;
	padding: 0 0 1.1em 1.3em;
	position: relative;
}
.pj-log li:last-child { padding-bottom: 0.2em; }
.pj-log li::before {
	background: #fff;
	border: 1.5px solid var(--pj-coral);
	border-radius: 50%;
	content: "";
	height: 9px;
	left: -5px;
	position: absolute;
	top: 0.35em;
	width: 9px;
}
.pj-log time { color: var(--pj-soft); display: block; font-family: var(--pj-mono); font-size: 0.74em; margin-bottom: 0.2em; }
.pj-log p { font-size: 0.9em; margin: 0; }

/* ---------- Figures ---------- */
.pj-figure {
	background-color: var(--pj-paper);
	background-image:
		linear-gradient(rgba(61, 68, 73, 0.045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(61, 68, 73, 0.045) 1px, transparent 1px);
	background-size: 24px 24px;
	border-bottom: 1px solid var(--pj-line);
	margin: 0;
	padding: 1.6em 1.4em 0.9em;
	position: relative;
}
.pj-figure svg { display: block; height: 150px; overflow: visible; width: 100%; }
.pj-figure figcaption {
	color: var(--pj-soft);
	display: flex;
	flex-wrap: wrap;
	font-family: var(--pj-mono);
	font-size: 0.68em;
	gap: 0.3em 1em;
	justify-content: space-between;
	margin-top: 0.9em;
}
.pj-line { fill: none; stroke: var(--pj-coral); stroke-linejoin: round; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.pj-fill { fill: rgba(245, 106, 106, 0.07); stroke: none; }
.pj-line-raw { stroke: #8a9297; stroke-dasharray: 4 3; stroke-width: 1.3; }
.pj-line-lo { stroke: #9fa6ab; stroke-width: 2.4; }
.pj-key { background: var(--pj-coral); display: inline-block; height: 2px; margin: 0 0.35em 0.25em 0.6em; vertical-align: middle; width: 14px; }
.pj-key-raw { background: repeating-linear-gradient(90deg, #9fa6ab 0 3px, transparent 3px 6px); margin-left: 0; }

/* Peak labels on the Explorer figure */
.pj-peaks { inset: 1.6em 1.4em auto; height: 150px; pointer-events: none; position: absolute; }
.pj-peaks span {
	color: var(--pj-ink);
	font-family: var(--pj-mono);
	font-size: 0.66em;
	position: absolute;
	transform: translate(-50%, -150%);
	white-space: nowrap;
}

/* Chat figure */
.pj-figure-chat { display: flex; flex-direction: column; gap: 0.7em; min-height: 196px; padding: 1.6em 1.4em 1.2em; }
.pj-bubble { border-radius: 14px; font-size: 0.82em; line-height: 1.5; max-width: 82%; padding: 0.7em 1em; }
.pj-bubble-q { align-self: flex-end; background: var(--pj-ink); border-bottom-right-radius: 4px; color: #fff; }
.pj-bubble-a { align-self: flex-start; background: #fff; border: 1px solid var(--pj-line); border-bottom-left-radius: 4px; display: flex; gap: 5px; padding: 0.95em 1.1em; }
.pj-bubble-a span { animation: pj-typing 1.4s ease-in-out infinite; background: #b7bec4; border-radius: 50%; height: 6px; width: 6px; }
.pj-bubble-a span:nth-child(2) { animation-delay: 0.2s; }
.pj-bubble-a span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pj-typing { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.pj-modes { display: flex; flex-wrap: wrap; gap: 0.35em; margin-top: auto; }
.pj-modes span { background: #fff; border: 1px solid var(--pj-line); border-radius: 999px; color: var(--pj-soft); font-size: 0.68em; padding: 0.2em 0.7em; }

/* Image figure */
.pj-figure-img { background: #fff; padding: 0; }
.pj-figure-img { align-items: center; display: flex; min-height: 196px; padding: 0.8em; }
.pj-figure-img img { display: block; height: auto; width: 100%; }

/* ---------- Featured project ---------- */
.pj-feature {
	display: grid;
	grid-template-areas: "body figure" "notebook notebook";
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	margin-bottom: 1.4em;
}
.pj-feature .pj-feature-body { display: flex; flex-direction: column; grid-area: body; padding: 2.2em 2.2em 1.8em; }
.pj-feature h3 { font-size: 2em; margin-bottom: 0.3em; }
.pj-feature .pj-oneliner { font-size: 1.12em; line-height: 1.55; }
.pj-feature .pj-notebook { grid-area: notebook; }
.pj-feature .pj-log { padding-left: 2.2em; padding-right: 2.2em; }
.pj-figure-tracer {
	align-items: center;
	border-bottom: 0;
	border-left: 1px solid var(--pj-line);
	display: flex;
	flex-direction: column;
	grid-area: figure;
	justify-content: center;
	padding: 2em 1.8em 1.2em;
}
.pj-figure-tracer svg { height: auto; max-height: 340px; }
.pj-figure-tracer figcaption { width: 100%; }
.pj-axis line { stroke: #9fa6ab; stroke-width: 1; }
.pj-axis text { fill: var(--pj-soft); font-family: var(--pj-mono); font-size: 11px; text-anchor: middle; }
.pj-image-line { fill: none; opacity: 0.4; stroke: #6f777c; stroke-linejoin: round; stroke-width: 3.2; }
.pj-trace-dots circle { fill: #fff; stroke: var(--pj-coral); stroke-width: 1.6; }
.pj-scan line { stroke: var(--pj-coral); stroke-dasharray: 2 4; stroke-width: 1; opacity: 0; }

/* Numbers that matter */
.pj-stats {
	border-bottom: 1px solid var(--pj-line);
	border-top: 1px solid var(--pj-line);
	display: grid;
	gap: 1em;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0.6em 0 0.6em;
	padding: 1.1em 0;
}
.pj-stats div { margin: 0; }
.pj-stats dt { color: var(--pj-ink); font-family: "Roboto Slab", serif; font-size: 1.7em; font-weight: 700; line-height: 1.1; margin: 0 0 0.2em; }
.pj-stats dd { color: var(--pj-soft); font-size: 0.8em; line-height: 1.45; margin: 0; }
.pj-card .pj-fine { color: var(--pj-soft); font-family: var(--pj-mono); font-size: 0.7em; margin: 0 0 1.4em; }

/* Slim row card */
.pj-row { align-items: stretch; flex-direction: row; }
.pj-row-mark {
	background: var(--pj-paper);
	border-right: 1px solid var(--pj-line);
	display: flex;
	flex: 0 0 9.5em;
	flex-direction: column;
	gap: 9px;
	justify-content: center;
	padding: 1.5em 1.4em;
}
.pj-row-mark span { background: #dfe3e6; border-radius: 3px; display: block; height: 6px; }
.pj-row-mark span:nth-child(2) { width: 80%; }
.pj-row-mark span:nth-child(4) { width: 90%; }
.pj-row-mark span:nth-child(5) { width: 60%; }
.pj-row-mark .is-hit { background: var(--pj-coral); opacity: 0.75; width: 70%; }
.pj-row-body { flex: 1; padding: 1.5em 1.8em 1.2em; }
.pj-card .pj-quiet { color: var(--pj-soft); font-size: 0.85em; font-style: italic; margin: 0; }

/* ---------- Grids ---------- */
.pj-grid { display: grid; gap: 1.4em; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pj-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pj-grid .pj-card { align-self: start; }

/* ---------- Ideas and shelved: lighter, like notes ---------- */
.pj-split { display: grid; gap: 0 2.4em; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pj-split .pj-section-head { flex-direction: column; gap: 0.3em; }
.pj-note {
	border: 1px dashed #c7cdd1;
	border-radius: 12px;
	margin: 0 0 1em;
	padding: 1.3em 1.4em 1.1em;
	transition: border-color 0.2s ease;
}
.pj-note:hover { border-color: #9fa6ab; }
.pj-note h3 { font-size: 1.08em; margin: 0.8em 0 0.3em; }
.pj-note p { color: #5b6368; font-size: 0.92em; line-height: 1.65; margin: 0; }
.pj-note-shelved { background: #fafafa; }
.pj-note-shelved h3 { color: #6f777c; }

.pj-empty { color: var(--pj-soft); font-style: italic; margin: 0 0 4em; }

/* ---------- Follow along ---------- */
.pj-follow {
	align-items: center;
	background: var(--pj-ink);
	border-radius: 16px;
	color: rgba(255, 255, 255, 0.75);
	display: flex;
	flex-wrap: wrap;
	gap: 1.4em 2em;
	justify-content: space-between;
	margin: 1em 0 4em;
	padding: 2.2em 2.4em !important;
}
.pj-follow h2 { color: #fff; font-size: 1.35em; line-height: 1.4; margin: 0 0 0.3em; max-width: 26em; }
.pj-follow p { margin: 0; }
.pj-follow-links { align-items: center; display: flex; gap: 1.6em; }
.pj-follow .pj-open { border-bottom-color: rgba(255, 255, 255, 0.35); color: #fff !important; }
.pj-follow .pj-open:hover { border-bottom-color: var(--pj-coral); }
.pj-subtle { border: 0; color: rgba(255, 255, 255, 0.65) !important; font-size: 0.85em; text-decoration: none; }
.pj-subtle:hover { color: #fff !important; }

/* ---------- Filtering ---------- */
.pj-section.is-hidden, .pj-card.is-hidden, .pj-note.is-hidden { display: none; }

/* ---------- Gentle entrance (only when JS runs and motion is allowed) ---------- */
.pj-js .pj-reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.pj-js .pj-reveal.is-in { opacity: 1; transform: none; }
.pj-js .pj-reveal .pj-line:not(.pj-line-raw) { stroke-dasharray: 1; stroke-dashoffset: 1; }
.pj-js .pj-reveal.is-in .pj-line:not(.pj-line-raw) { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s ease 0.2s; }
.pj-js .pj-reveal .pj-trace-dots circle { opacity: 0; }
.pj-js .pj-reveal.is-in .pj-trace-dots circle { opacity: 1; transition: opacity 0.25s ease calc(0.4s + var(--i) * 0.014s); }
.pj-js .pj-reveal.is-in .pj-scan line { animation: pj-scan 2.1s ease-in-out 0.4s 1 both; }
@keyframes pj-scan {
	0% { opacity: 0; transform: translateX(0); }
	10% { opacity: 1; }
	90% { opacity: 1; }
	100% { opacity: 0; transform: translateX(520px); }
}

@media (prefers-reduced-motion: reduce) {
	.pj-js .pj-reveal { opacity: 1; transform: none; transition: none; }
	.pj-js .pj-reveal .pj-line, .pj-js .pj-reveal.is-in .pj-line { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
	.pj-js .pj-reveal .pj-trace-dots circle { opacity: 1; transition: none; }
	.pj-js .pj-reveal.is-in .pj-scan line { animation: none; }
	.pj-st-building i::after, .pj-bubble-a span { animation: none; }
	.pj-card, .pj-card:hover { transform: none; transition: none; }
	.pj-notebook { transition: none; }
}

/* ---------- Smaller screens ---------- */
@media screen and (max-width: 1680px) {
	.pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* An odd card left over on its own row spans both columns, figure beside the text */
	.pj-grid:not(.pj-grid-2) > .pj-card:last-child:nth-child(odd) {
		display: grid;
		grid-column: 1 / -1;
		grid-template-areas: "figure body" "notebook notebook";
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
	.pj-grid:not(.pj-grid-2) > .pj-card:last-child:nth-child(odd) > .pj-figure { border-bottom: 0; border-right: 1px solid var(--pj-line); grid-area: figure; }
	.pj-grid:not(.pj-grid-2) > .pj-card:last-child:nth-child(odd) > .pj-card-body { grid-area: body; }
	.pj-grid:not(.pj-grid-2) > .pj-card:last-child:nth-child(odd) > .pj-notebook { grid-area: notebook; }
}
@media screen and (max-width: 1280px) {
	.pj-feature { grid-template-areas: "figure" "body" "notebook"; grid-template-columns: minmax(0, 1fr); }
	.pj-figure-tracer { border-bottom: 1px solid var(--pj-line); border-left: 0; }
}
@media screen and (max-width: 980px) {
	.pj-split { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 736px) {
	.pj-lead { font-size: 1.05em; }
	.pj-grid, .pj-grid-2 { grid-template-columns: minmax(0, 1fr); }
	.pj-grid:not(.pj-grid-2) > .pj-card:last-child:nth-child(odd) { display: flex; }
	.pj-grid:not(.pj-grid-2) > .pj-card:last-child:nth-child(odd) > .pj-figure { border-bottom: 1px solid var(--pj-line); border-right: 0; }
	.pj-feature .pj-feature-body { padding: 1.6em 1.4em 1.4em; }
	.pj-feature h3 { font-size: 1.6em; }
	.pj-feature .pj-log { padding-left: 1.4em; padding-right: 1.4em; }
	.pj-stats { grid-template-columns: minmax(0, 1fr); gap: 0.8em; }
	.pj-stats div { align-items: baseline; display: flex; gap: 0.8em; }
	.pj-stats dt { flex: 0 0 3.2em; font-size: 1.4em; }
	.pj-row { flex-direction: column; }
	.pj-row-mark { border-bottom: 1px solid var(--pj-line); border-right: 0; flex: none; padding: 1.2em 1.4em; }
	.pj-follow { padding: 1.8em 1.5em !important; }
}
