@charset "UTF-8";

/* ==========================================================================
   project.css — enriched internal project pages
   Layered on top of index.css (header, footer, global resets).
   Concept preserved: minimal, static, grey ground, black type.
   ========================================================================== */

:root {
	--ground: #DBDCDB;
	--ink: #101010;
	--ink-soft: #5c5d5b;
	--line: rgba(16, 16, 16, .28);
	--line-soft: rgba(16, 16, 16, .14);
	--placeholder: #cdcecd;
	--maxw: 1280px;
	--gap: 24px;
	--mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--sans: 'Noto Sans', sans-serif;
}

/* ---- page frame ---------------------------------------------------------- */

/* .project sits inside #container, which already caps width and pads 30px */
.project {
	width: 100%;
}

.menu a {
	text-decoration: none;
}

.menu a:hover,
.menu a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- intro / spec sheet ------------------------------------------------- */

.project-intro {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 15em);
	gap: 40px 60px;
	padding: 48px 0 40px;
	border-bottom: 1px solid var(--line);
}

.project-intro__head h1 {
	font-family: var(--sans);
	font-weight: 800;
	font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.9rem);
	line-height: 1.05;
	letter-spacing: -.02em;
	margin: 0 0 18px;
}

.project-intro__desc {
	font-family: var(--sans);
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.65;
	max-width: 46em;
	margin: 0;
}

.project-intro__desc a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.project-intro__desc + .project-intro__desc {
	margin-top: 1.15em;
}

.project-intro__desc:lang(ja) {
	line-height: 1.85;
}

.project-meta {
	margin: 0;
	font-family: var(--mono);
	font-weight: 400;
	font-size: .72rem;
	line-height: 1.5;
	align-self: start;
}

.project-meta div {
	padding: 9px 0;
	border-top: 1px solid var(--line-soft);
}

.project-meta div:first-child {
	border-top: 0;
}

.project-meta dt {
	text-transform: uppercase;
	letter-spacing: .06em;
	font-size: .64rem;
	color: var(--ink-soft);
	margin-bottom: 3px;
}

.project-meta dd {
	margin: 0;
}

.project-meta a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- in-page table of contents --------------------------------------- */

.project-toc {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	padding: 18px 0 4px;
	font-family: var(--mono);
	font-size: .72rem;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.project-toc a {
	text-decoration: none;
	color: var(--ink-soft);
	padding-bottom: 2px;
	border-bottom: 1px solid transparent;
}

.project-toc a:hover,
.project-toc a:focus-visible {
	color: var(--ink);
	border-bottom-color: var(--ink);
}

/* ---- section ---------------------------------------------------------- */

.project-section {
	padding: 64px 0 8px;
	scroll-margin-top: 24px;
}

.project-section:first-of-type {
	padding-top: 36px;
}

/* runs of one-image sections sit two-up */
.sections-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: var(--gap);
}

.sections-2col .project-section,
.sections-2col .project-section:first-of-type {
	padding-top: 48px;
}

@media screen and (max-width: 700px) {
	.sections-2col { grid-template-columns: 1fr; }
}

.project-section__label {
	display: flex;
	align-items: baseline;
	gap: 14px;
	margin: 0 0 28px;
	font-family: var(--mono);
	font-weight: 500;
	font-size: .78rem;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.project-section__label::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--line);
	transform: translateY(-3px);
}

.project-section__label .num {
	color: var(--ink-soft);
}

.project-section__note {
	font-family: var(--sans);
	font-size: .92rem;
	line-height: 1.6;
	max-width: 42em;
	margin: 0 0 30px;
	color: var(--ink);
}

/* ---- media grid ----------------------------------------------------------- */

/* justified rows: each row is one flex line, children grow by aspect ratio
   (set inline as `flex:<w/h> 1 0`), and every figure carries `aspect-ratio`,
   so a row renders at a single shared height with no vertical gaps. */
.jrow {
	display: flex;
	gap: var(--gap);
	align-items: flex-start;
}

.jrow + .jrow,
.jrow + .grid,
.grid + .jrow {
	margin-top: var(--gap);
}

.jrow > .fig {
	min-width: 0;          /* let flex items shrink below content width */
}

.jrow--center {
	justify-content: center;
}

.grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: var(--gap);
	align-items: start;
}

.grid + .grid {
	margin-top: var(--gap);
}

figure.fig {
	grid-column: span 12;
	margin: 0;
}

figure.fig.span-6 { grid-column: span 6; }
figure.fig.span-4 { grid-column: span 4; }
figure.fig.span-3 { grid-column: span 3; }
figure.fig.span-8 { grid-column: span 8; }

.fig__media {
	position: relative;
	display: block;
	width: 100%;
	background: var(--placeholder);
	overflow: hidden;
}

.fig__media img,
.fig__media video {
	display: block;
	width: 100%;
	height: auto;
}

/* fade lazy images in once decoded */
.fig__media img {
	opacity: 0;
	transition: opacity .5s ease;
}

.fig__media img.is-loaded {
	opacity: 1;
}

button.fig__media {
	border: 0;
	padding: 0;
	cursor: zoom-in;
	font: inherit;
	color: inherit;
}

figcaption {
	margin-top: 12px;
	font-family: var(--sans);
	font-size: .8rem;
	line-height: 1.55;
	color: var(--ink);
}

figcaption .fig__cap-note {
	display: block;
	color: var(--ink-soft);
	margin-top: 2px;
}

/* ---- carousel (native scroll-snap, no library) ----------------------- */

.carousel {
	position: relative;
	margin-top: 4px;
}

.carousel__track {
	display: flex;
	gap: var(--gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.carousel__track::-webkit-scrollbar {
	display: none;
}

.carousel__slide {
	flex: 0 0 82%;
	scroll-snap-align: center;
}

.carousel__slide .fig__media {
	width: 100%;
}

.carousel__slide figcaption {
	margin-top: 10px;
}

.carousel__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 14px;
	font-family: var(--mono);
	font-size: .72rem;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

.carousel__btn {
	background: none;
	border: 1px solid var(--line);
	color: var(--ink);
	font: inherit;
	padding: 7px 14px;
	cursor: pointer;
}

.carousel__btn:hover:not(:disabled),
.carousel__btn:focus-visible:not(:disabled) {
	background: var(--ink);
	color: var(--ground);
	border-color: var(--ink);
}

.carousel__btn:disabled {
	opacity: .3;
	cursor: default;
}

@media screen and (min-width: 901px) {
	.carousel__slide {
		flex-basis: 62%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.carousel__track {
		scroll-behavior: auto;
	}
}

/* ---- responsive embed (vimeo / youtube) ----------------------------- */

.embed {
	position: relative;
	display: block;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	background: var(--placeholder);
}

.embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* click-to-load facade (diary video links, etc.) — the player iframe is only
   injected by site.js on click, so the page stays light */
.video-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	margin: 26px 0;
	background: #000;
	overflow: hidden;
	cursor: pointer;
}

.video-embed > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.video-embed > iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-embed__play {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	width: 58px;
	height: 58px;
	transform: translate(-50%, -50%);
	border: 0;
	border-radius: 50%;
	background: rgba(16, 16, 16, .58);
	cursor: pointer;
	transition: background .2s ease;
}

.video-embed__play::after {
	content: "";
	position: absolute;
	left: 54%;
	top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #fff;
}

.video-embed:hover .video-embed__play { background: rgba(16, 16, 16, .82); }
.video-embed.is-playing { cursor: default; }
.video-embed.is-playing .video-embed__play { display: none; }

/* ---- prev / next -------------------------------------------------------- */

.project-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--gap);
	margin: 96px 0 24px;
	border-top: 1px solid var(--line);
}

.project-pager a {
	padding: 22px 0 0;
	text-decoration: none;
	font-family: var(--sans);
}

.project-pager a:last-child {
	text-align: right;
}

.project-pager .dir {
	display: block;
	font-family: var(--mono);
	font-size: .68rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink-soft);
	margin-bottom: 6px;
}

.project-pager .name {
	font-weight: 700;
	font-size: 1.05rem;
}

.project-pager a:hover .name {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- info / about --------------------------------------------------- */

.info-cols {
	columns: 3 190px;
	column-gap: 48px;
	padding-top: 8px;
}

.info-block {
	break-inside: avoid;
	margin-bottom: 34px;
}

.info-block h2 {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--line);
	font-family: var(--mono);
	font-weight: 500;
	font-size: .68rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

.info-block ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.info-block li {
	font-family: var(--sans);
	font-size: .84rem;
	line-height: 1.5;
	padding: 3px 0;
}

.info-block a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.info-block .yr {
	display: block;
	margin: 12px 0 2px;
	font-family: var(--mono);
	font-size: .7rem;
	letter-spacing: .04em;
	color: var(--ink-soft);
}

.info-block .yr:first-child { margin-top: 0; }

.info-block__intro {
	margin: 0 0 12px;
	font-family: var(--sans);
	font-size: .78rem;
	line-height: 1.5;
	color: var(--ink-soft);
}

/* ---- lightbox --------------------------------------------------------- */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba(20, 20, 20, .92);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
}

.lightbox.is-open {
	opacity: 1;
	pointer-events: auto;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-out;
}

.lightbox__close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: 0;
	color: #fff;
	font-family: var(--mono);
	font-size: .8rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	cursor: pointer;
	padding: 8px;
}

/* ---- responsive ------------------------------------------------------- */

@media screen and (max-width: 900px) {
	.project-intro {
		grid-template-columns: 1fr;
		gap: 28px;
		padding: 32px 0 28px;
	}

	figure.fig.span-6 { grid-column: span 12; }
	figure.fig.span-4 { grid-column: span 6; }
	figure.fig.span-8 { grid-column: span 12; }
	figure.fig.span-3 { grid-column: span 6; }

	/* justified rows stack on small screens (aspect-ratio keeps each figure
	   correct, so mixed ratios still have no gaps) */
	.jrow { flex-wrap: wrap; }
	.jrow > .fig { flex: 1 1 100% !important; }
	.jrow--center { justify-content: flex-start; }

	.project-section { padding-top: 48px; }
}

@media screen and (max-width: 560px) {
	figure.fig.span-4 { grid-column: span 12; }
	figure.fig.span-3 { grid-column: span 6; }
	.project-pager { grid-template-columns: 1fr; }
	.project-pager a:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	.fig__media img { opacity: 1; transition: none; }
	.lightbox { transition: none; }
}
