/* -------------------------------------------------------------------------
 * QISEN Portfolio Engine — visual layer
 * Original design work inspired by the general minimalist language of
 * architecture portfolio sites (monochrome, oversized type, large imagery).
 * No third-party brand assets, fonts, or images are used.
 * ---------------------------------------------------------------------- */

/* Pages hosting the shortcode: remove the theme's own title and width cap,
   so the grid can breathe edge-to-edge like a large-format portfolio. */
.qisen-pf-page .page-header { display: none; }
.qisen-pf-page .site-main,
.qisen-pf-page .page-content {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}
.qisen-pf-page .site-header {
	background: #fff;
	color: #000;
	border-bottom: 1px solid #e2e2e2;
	box-shadow: none;
}
.qisen-pf-page .site-header a { color: #000; }

.qisen-pf {
	--q-fg: #000;
	--q-bg: #fff;
	--q-muted: #6b6b6b;
	--q-line: #e2e2e2;
	--q-surface: #f3f3f3;
	--q-ease: cubic-bezier(.45, 0, .55, 1);
	--q-space: clamp(24px, 5vw, 88px);
	--q-cols: 3;

	box-sizing: border-box;
	width: 100%;
	max-width: 1800px;
	margin: 0 auto;
	padding: 0 var(--q-space) clamp(64px, 10vw, 160px);
	background: var(--q-bg);
	color: var(--q-fg);
	font-family: Inter, "Helvetica Neue", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

/* --- Header ------------------------------------------------------------ */

.qisen-pf__head {
	padding: clamp(56px, 9vw, 150px) 0 clamp(36px, 5vw, 80px);
	border-bottom: 1px solid var(--q-line);
}

.qisen-pf__eyebrow {
	margin: 0 0 clamp(18px, 2.5vw, 36px);
	font-size: .68rem;
	font-weight: 500;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--q-muted);
}

.qisen-pf__title {
	margin: 0;
	font-size: clamp(2.8rem, 9.5vw, 9rem);
	font-weight: 500;
	line-height: .88;
	letter-spacing: -.045em;
	text-transform: none;
}

.qisen-pf__count {
	margin: clamp(22px, 3vw, 44px) 0 0;
	font-size: .68rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--q-muted);
}

/* --- Filters ----------------------------------------------------------- */

.qisen-pf__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: clamp(16px, 3vw, 44px);
	padding: clamp(22px, 3vw, 40px) 0 0;
	margin-bottom: clamp(24px, 3.5vw, 52px);
}

.qisen-pf__filter {
	position: relative;
	appearance: none;
	background: none;
	border: 0;
	padding: 0 0 14px;
	margin: 0;
	color: var(--q-muted);
	font-family: inherit;
	font-size: .7rem;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	cursor: pointer;
	transition: color .4s var(--q-ease);
}

.qisen-pf__filter:hover,
.qisen-pf__filter:focus-visible,
.qisen-pf__filter[aria-pressed="true"] { color: var(--q-fg); }

.qisen-pf__filter::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--q-fg);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .55s var(--q-ease);
}

.qisen-pf__filter[aria-pressed="true"]::after { transform: scaleX(1); }

.qisen-pf__filter sup {
	margin-left: .45em;
	font-size: .62em;
	letter-spacing: .05em;
	vertical-align: super;
	opacity: .65;
}

/* --- Grid -------------------------------------------------------------- */

.qisen-pf__grid {
	display: grid;
	grid-template-columns: repeat(var(--q-cols), minmax(0, 1fr));
	gap: clamp(28px, 4vw, 72px) clamp(10px, 1.6vw, 26px);
}

.qisen-pf__item {
	min-width: 0;
	transition: opacity .55s var(--q-ease), transform .55s var(--q-ease);
}

.qisen-pf__item.is-hidden {
	display: none;
}

.qisen-pf__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.qisen-pf__media {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--q-surface);
	aspect-ratio: 4 / 3;
}

.qisen-pf--minimal .qisen-pf__media { aspect-ratio: 1 / 1; }

.qisen-pf__media picture,
.qisen-pf__media img,
.qisen-pf__media source {
	display: block;
	width: 100%;
	height: 100%;
}

.qisen-pf__media img {
	object-fit: cover;
	transform: scale(1.001);
	transition: transform .78s var(--q-ease), filter .78s var(--q-ease), opacity .78s var(--q-ease);
}

.qisen-pf__item:hover .qisen-pf__media img,
.qisen-pf__link:focus-visible .qisen-pf__media img {
	transform: scale(1.055);
	filter: saturate(.82);
}

.qisen-pf__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--q-surface);
}

.qisen-pf__caption {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-top: clamp(12px, 1.4vw, 20px);
}

.qisen-pf__name {
	margin: 0;
	font-size: clamp(.98rem, 1.45vw, 1.4rem);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -.015em;
}

.qisen-pf__cat {
	flex: none;
	font-size: .62rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--q-muted);
}

.qisen-pf__empty {
	padding: 64px 0;
	font-size: .8rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--q-muted);
}

/* --- Lightbox ---------------------------------------------------------- */

.qisen-pf-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(20px, 5vw, 80px);
	background: #fff;
	opacity: 0;
	visibility: hidden;
	transition: opacity .45s var(--q-ease), visibility .45s var(--q-ease);
}

.qisen-pf-lightbox.is-open { opacity: 1; visibility: visible; }

.qisen-pf-lightbox img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.qisen-pf-lightbox__close {
	position: absolute;
	top: clamp(16px, 3vw, 40px);
	right: clamp(16px, 3vw, 40px);
	width: 44px;
	height: 44px;
	border: 1px solid #000;
	background: transparent;
	color: #000;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 1024px) {
	.qisen-pf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	.qisen-pf__grid { grid-template-columns: minmax(0, 1fr); }
	.qisen-pf__title { letter-spacing: -.035em; }
	.qisen-pf__filters { gap: 18px; }
	.qisen-pf__caption { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.qisen-pf *,
	.qisen-pf *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* =========================================================================
 * FLOW mode — single-column vertical large-image stream.
 * Short tap = inline expansion; press-and-hold = open project in new tab.
 * ====================================================================== */

.qisen-pf--flow {
	--q-img: clamp(280px, 34vw, 560px);
	--q-hold: 550ms;
	max-width: none;
	padding: 0;
}

.qisen-flow__nav {
	position: sticky;
	top: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	gap: clamp(12px, 2.4vw, 38px);
	padding: 14px var(--q-space);
	background: rgba(255, 255, 255, .93);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--q-line);
	font-size: .62rem;
	letter-spacing: .18em;
	text-transform: uppercase;
}

.qisen-flow__brand {
	margin-right: auto;
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .3em;
}

.qisen-flow__navbtn {
	appearance: none;
	background: none;
	border: 0;
	padding: 4px 0;
	margin: 0;
	color: var(--q-muted);
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
	transition: color .4s var(--q-ease);
}

.qisen-flow__navbtn:hover,
.qisen-flow__navbtn[aria-pressed="true"] { color: var(--q-fg); }
.qisen-flow__navbtn[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 5px; }

.qisen-flow__hint {
	color: var(--q-muted);
	font-size: .56rem;
	letter-spacing: .1em;
	white-space: nowrap;
}

.qisen-flow__stream {
	padding: clamp(64px, 9vw, 150px) var(--q-space) 22vh;
}

.qisen-flow__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--q-img) minmax(0, 1fr);
	gap: clamp(16px, 3vw, 64px);
	align-items: start;
	margin: 0 0 clamp(90px, 12vw, 200px);
	transition: opacity .55s var(--q-ease);
}

.qisen-flow__item.is-hidden { display: none; }

.qisen-flow__aside {
	text-align: right;
	padding-top: 4px;
}

.qisen-flow__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-bottom: 18px;
	background: #000;
	color: #fff;
	font-size: .6rem;
	font-weight: 600;
	letter-spacing: .04em;
}

.qisen-flow__name {
	margin: 0;
	font-size: .84rem;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: .01em;
}

.qisen-flow__place {
	margin: 6px 0 0;
	font-size: .56rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--q-muted);
}

.qisen-flow__meta {
	display: none;
	margin: clamp(24px, 3vw, 48px) 0 0;
	font-size: .58rem;
	line-height: 1.9;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--q-muted);
}

.qisen-flow__meta dt { display: none; }
.qisen-flow__meta dd { margin: 0 0 10px; }

.qisen-flow__media {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--q-surface);
	cursor: pointer;
	outline: none;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	touch-action: manipulation;
}

.qisen-flow__media:focus-visible { outline: 2px solid #000; outline-offset: 4px; }

.qisen-flow__media img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .78s var(--q-ease), filter .78s var(--q-ease);
	-webkit-user-drag: none;
}

.qisen-flow__media:hover img { transform: scale(1.025); }

/* Hold progress line */
.qisen-flow__media::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 0;
	background: #000;
	transition: width var(--q-hold) linear;
	pointer-events: none;
}
.qisen-flow__item.is-holding .qisen-flow__media::after { width: 100%; }

.qisen-flow__text {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	font-size: .72rem;
	line-height: 1.85;
	color: #333;
	transition: max-height .78s var(--q-ease), opacity .78s var(--q-ease);
}

.qisen-flow__text p { margin: 0 0 18px; }

.qisen-flow__open {
	display: inline-block;
	margin-top: 4px;
	font-size: .58rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #000;
	text-decoration: none;
	border-bottom: 1px solid #000;
	padding-bottom: 3px;
}

.qisen-flow__item.is-expanded .qisen-flow__text { max-height: 640px; opacity: 1; }
.qisen-flow__item.is-expanded .qisen-flow__meta { display: block; }
.qisen-flow__item.is-expanded .qisen-flow__media img { transform: scale(1.035); }

.qisen-flow__item.is-opening { opacity: .45; }

@media (max-width: 1024px) {
	.qisen-flow__item {
		grid-template-columns: minmax(0, 1fr) var(--q-img) minmax(0, 1fr);
		gap: 16px;
	}
	.qisen-flow__text { font-size: .66rem; }
}

@media (max-width: 760px) {
	.qisen-pf--flow { --q-img: min(88vw, 520px); }
	.qisen-flow__nav { flex-wrap: wrap; gap: 12px 18px; }
	.qisen-flow__hint { display: none; }
	.qisen-flow__item {
		display: flex;
		flex-direction: column;
		gap: 14px;
		margin-bottom: clamp(64px, 14vw, 110px);
	}
	.qisen-flow__aside { text-align: left; padding-top: 0; }
	.qisen-flow__mark { width: 28px; height: 28px; margin-bottom: 10px; }
	.qisen-flow__meta { display: none !important; }
	.qisen-flow__text { max-height: none; opacity: 1; font-size: .76rem; }
	.qisen-flow__open { display: inline-block; }
}
