:root {
	color-scheme: light;
	--ink: #333;
	--gray: #808080;
	--orange: #f08300;
	--blue: #9fd9f6;
	--green: #c4d700;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	overflow-x: hidden;
	color: var(--ink);
	background: linear-gradient(-45deg, rgba(196,215,0,.1), rgba(159,217,246,.1), rgba(240,131,0,.1)) fixed;
	background-size: 800% 800%;
	font-family: "游明朝体", "Yu Mincho", YuMincho, "ヒラギノ明朝 Pro", "Hiragino Mincho Pro", "MS P明朝", "MS PMincho", serif;
	animation: gradient-motion 10s ease infinite;
}

a { text-decoration: none; }

.portfolio-header {
	position: relative;
	z-index: 20;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--gray);
}

.brand { margin: 10px 20px; line-height: 0; }
.brand img { width: auto; height: 30px; }

.portfolio-header nav { height: 50px; }
.portfolio-header nav a {
	display: block;
	height: 50px;
	padding: 0 24px;
	color: #fff;
	font-size: 14px;
	line-height: 50px;
	transition: background-color .3s;
}
.portfolio-header nav a:hover,
.portfolio-header nav a:focus-visible { background: #6f6f6f; }

main {
	position: relative;
	z-index: 2;
	width: 90%;
	max-width: 1100px;
	margin: 0 auto;
}

.portfolio-intro { padding: clamp(70px, 10vw, 120px) 0 clamp(62px, 8vw, 92px); }

h1 {
	margin: 0;
	text-align: right;
	font-size: clamp(28px, 4vw, 42px);
	font-weight: normal;
	letter-spacing: .03em;
	animation: fade-right 1s cubic-bezier(.33,1,.68,1) both;
}

h1 span {
	margin-left: 10px;
	padding-left: 10px;
	border-left: 1px solid var(--gray);
	font-size: .56em;
	letter-spacing: .08em;
}

h2 {
	width: min(700px, 100%);
	margin: clamp(58px, 8vw, 92px) 0 0;
	padding: 0 0 12px;
	font-size: clamp(24px, 3.2vw, 34px);
	font-weight: normal;
	letter-spacing: .06em;
	background-image:
		repeating-linear-gradient(270deg, var(--gray), var(--gray) 3px, transparent 3px, transparent 8px, var(--gray) 8px);
	background-size: calc(100% + 8px) 10px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	animation: border-move .8s linear infinite, fade-up .8s .15s ease both;
}

.domino-row {
	margin-top: 22px;
	display: flex;
	gap: 8px;
	align-items: center;
}

.domino-row i {
	display: block;
	width: 25px;
	height: 8px;
	animation: domino-in .55s cubic-bezier(.33,1,.68,1) both;
}
.domino-row i:nth-child(3n+1) { background: var(--orange); }
.domino-row i:nth-child(3n+2) { background: var(--blue); }
.domino-row i:nth-child(3n) { background: var(--green); }
.domino-row i:nth-child(2) { animation-delay: .06s; }
.domino-row i:nth-child(3) { animation-delay: .12s; }
.domino-row i:nth-child(4) { animation-delay: .18s; }
.domino-row i:nth-child(5) { animation-delay: .24s; }
.domino-row i:nth-child(6) { animation-delay: .3s; }

.works { padding: 0 0 clamp(90px, 12vw, 150px); }

.film-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 14px;
	font-size: 14px;
	letter-spacing: .18em;
}
.film-controls p { margin: 0; }
.film-controls > div { display: flex; align-items: center; gap: 12px; }
.film-controls button {
	width: 42px;
	height: 42px;
	border: 1px solid var(--gray);
	border-radius: 50%;
	color: var(--ink);
	background: rgba(255,255,255,.72);
	font-size: 20px;
	cursor: pointer;
	transition: color .25s, background-color .25s, transform .25s;
}
.film-controls button:hover,
.film-controls button:focus-visible { color: #fff; background: var(--ink); transform: scale(1.06); }

.film-window {
	overflow: hidden;
	box-shadow: 3px 3px 8px 2px rgba(0,0,0,.25);
	animation: card-slide 1s .25s cubic-bezier(.33,1,.68,1) both;
}

.film-strip {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	padding: 52px clamp(24px, 4vw, 52px);
	background: #1a1a1a;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-color: var(--orange) #333;
	scrollbar-width: thin;
}
.film-strip::-webkit-scrollbar { height: 7px; }
.film-strip::-webkit-scrollbar-track { background: #333; }
.film-strip::-webkit-scrollbar-thumb { background: var(--orange); }

.film-frame {
	position: relative;
	flex: 0 0 min(74vw, 760px);
	padding: 12px;
	background: #292929;
	scroll-snap-align: center;
}

.film-frame::before,
.film-frame::after {
	content: "";
	position: absolute;
	left: 0;
	width: 100%;
	height: 15px;
	background: repeating-linear-gradient(90deg, #eee 0 18px, transparent 18px 34px);
}
.film-frame::before { top: -34px; }
.film-frame::after { bottom: -34px; }

.frame-code {
	position: absolute;
	z-index: 2;
	top: -31px;
	right: 5px;
	margin: 0;
	padding-left: 8px;
	color: #bbb;
	background: #1a1a1a;
	font-family: monospace;
	font-size: 10px;
	letter-spacing: .14em;
}

.video-frame {
	position: relative;
	aspect-ratio: 16/9;
	background: #333;
	box-shadow: 0 0 0 1px rgba(255,255,255,.16);
}
.video-frame video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
	object-fit: contain;
}

.domino-background {
	position: fixed;
	z-index: 0;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.domino-background i {
	position: absolute;
	display: block;
	width: 42px;
	height: 14px;
	bottom: -80px;
	opacity: .22;
	animation: float-domino 16s linear infinite;
}
.domino-background i:nth-child(3n+1) { background: var(--orange); }
.domino-background i:nth-child(3n+2) { background: var(--blue); }
.domino-background i:nth-child(3n) { background: var(--green); }
.domino-background i:nth-child(1) { left: 6%; width: 60px; height: 20px; animation-delay: -3s; }
.domino-background i:nth-child(2) { left: 16%; animation-delay: -11s; animation-duration: 20s; }
.domino-background i:nth-child(3) { left: 27%; width: 30px; height: 10px; animation-delay: -7s; }
.domino-background i:nth-child(4) { left: 39%; width: 72px; height: 24px; animation-delay: -14s; animation-duration: 22s; }
.domino-background i:nth-child(5) { left: 50%; width: 24px; height: 8px; animation-delay: -5s; }
.domino-background i:nth-child(6) { left: 61%; animation-delay: -10s; animation-duration: 19s; }
.domino-background i:nth-child(7) { left: 72%; width: 66px; height: 22px; animation-delay: -16s; animation-duration: 24s; }
.domino-background i:nth-child(8) { left: 84%; animation-delay: -8s; }
.domino-background i:nth-child(9) { left: 93%; width: 27px; height: 9px; animation-delay: -13s; }
.domino-background i:nth-child(10) { left: 33%; animation-delay: -1s; animation-duration: 18s; }
.domino-background i:nth-child(11) { left: 57%; width: 54px; height: 18px; animation-delay: -18s; animation-duration: 25s; }
.domino-background i:nth-child(12) { left: 78%; width: 30px; height: 10px; animation-delay: -4s; }

footer {
	position: relative;
	z-index: 2;
	background: #fff;
	box-shadow: 0 -1px 4px rgba(0,0,0,.08);
}
footer p { height: 40px; margin: 0; text-align: center; font-size: 13px; line-height: 40px; }

@keyframes gradient-motion {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}
@keyframes border-move {
	from { background-position: -8px 100%; }
	to { background-position: 0 100%; }
}
@keyframes fade-right {
	from { opacity: 0; transform: translateX(70px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes fade-up {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes domino-in {
	from { opacity: 0; transform: translateX(-20px) rotate(-20deg); }
	to { opacity: 1; transform: translateX(0) rotate(0); }
}
@keyframes card-slide {
	from { opacity: 0; transform: translateX(-50px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes float-domino {
	from { transform: translateY(0) rotate(0deg); }
	to { transform: translateY(-120vh) rotate(600deg); }
}

@media (max-width: 767px) {
	.portfolio-header { background: #333; box-shadow: 0 3px 3px #ccc; }
	.brand { margin-left: 15px; }
	.portfolio-header nav a { padding-inline: 18px; }
	.portfolio-intro { padding: 62px 0 70px; }
	h1 { font-size: 28px; }
	h1 span { display: block; width: fit-content; margin: 8px 0 0 auto; border-left: 0; padding-left: 0; font-size: 16px; }
	h2 { margin-top: 58px; font-size: 24px; }
	.film-controls > div > span { display: none; }
	.film-controls button { width: 38px; height: 38px; }
	.film-window { margin-inline: -5.5vw; }
	.film-strip { gap: 11px; padding: 46px 16px; }
	.film-frame { flex-basis: 84vw; padding: 8px; }
	.film-frame::before, .film-frame::after {
		height: 13px;
		background-size: auto;
		background-image: repeating-linear-gradient(90deg, #eee 0 14px, transparent 14px 27px);
	}
	.film-frame::before { top: -29px; }
	.film-frame::after { bottom: -29px; }
	.frame-code { top: -27px; }
	.domino-background i { opacity: .14; }
}

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