/* ═══════════════════════════════════════
   Portfolio — Shimanouchi Yohei
   ═══════════════════════════════════════ */

*, *::before, *::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--bg: #FFFFFF;
	--surface: #FFFFFF;
	--ink: #111111;
	--ink-mid: #4D4D4D;
	--ink-light: #6E6E6E;
	--ink-faint: #B3B3B3;
	--line: #E2E2E2;
	--line-strong: #111111;
	--font-ja: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
	--font-en: 'Space Grotesk', sans-serif;
	--col-max: 1080px;
	--col-wide: 1320px;
}

html {
	font-size: 17px;
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-ja);
	font-weight: 500;
	background: var(--bg);
	color: var(--ink);
	line-height: 1.85;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

.wrap {
	max-width: var(--col-max);
	margin: 0 auto;
	padding: 0 2rem;
}

.wrap--wide {
	max-width: var(--col-wide);
}

::selection {
	background: var(--ink);
	color: #fff;
}

:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

.sec--skills :focus-visible {
	outline-color: #fff;
}

/* ═══ SCROLL FADE-IN ═══ */
.js-fade { opacity: 1; }

@supports (animation-timeline: view()) {
	.js-fade {
		animation: fade-up linear both;
		animation-timeline: view();
		animation-range: entry 0% entry 100%;
	}
}

@keyframes fade-up {
	from { opacity: 0; translate: 0 18px; }
	to   { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.js-fade { animation: none; opacity: 1; translate: none; }
}

/* ═══ WORKS CARD FADE-IN ═══ */
.wk {
	opacity: 0;
	translate: 0 20px;
	transition: opacity .55s ease, translate .55s ease;
}
.works-grid.is-in .wk {
	opacity: 1;
	translate: 0 0;
}

/* 3カラム時のディレイ
   行が進むほど累積すると、画面外の行が出るまでに
   アニメーションが終わってしまう。
   そのため行方向の加算は抑え、列方向のずれを主にする */
.wk { --d: 0s; }
.wk:nth-child(3n+2) { --d: .09s; }
.wk:nth-child(3n+3) { --d: .18s; }
.wk:nth-child(n+4)  { --row: .10s; }
.wk:nth-child(n+7)  { --row: .20s; }
.wk:nth-child(n+10) { --row: .30s; }
.wk { transition-delay: calc(var(--d) + var(--row, 0s)); }

/* 2カラム時 */
@media (max-width: 900px) {
	.wk { --d: 0s; --row: 0s; }
	.wk:nth-child(2n+2) { --d: .09s; }
	.wk:nth-child(n+3)  { --row: .10s; }
	.wk:nth-child(n+5)  { --row: .20s; }
	.wk:nth-child(n+7)  { --row: .30s; }
	.wk:nth-child(n+9)  { --row: .40s; }
	.wk:nth-child(n+11) { --row: .50s; }
}

/* 1カラム時はディレイなし（縦に長く、待ち時間が無意味なため） */
@media (max-width: 600px) {
	.wk { --d: 0s; --row: 0s; }
}

@media (prefers-reduced-motion: reduce) {
	.wk {
		opacity: 1;
		translate: none;
		transition: none;
	}
}

/* ═══ HERO ═══ */
.hero {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	position: relative;
	padding: 4rem 2rem;
}

.hero__inner {
	position: relative;
	z-index: 1;
}

.hero__icon {
	margin-bottom: 1.8rem;
	display: flex;
	justify-content: center;
}

.hero__icon svg {
	width: 168px;
	height: 168px;
}

#hat {
	fill: transparent;
	stroke: var(--ink);
	stroke-width: 1;
	stroke-dasharray: 370;
	stroke-dashoffset: 370;
	animation: draw-hat 1.6s ease forwards;
}

@keyframes draw-hat {
	0% { stroke-dashoffset: 370; fill: transparent; }
	65% { stroke-dashoffset: 0; fill: transparent; }
	100% { stroke-dashoffset: 0; fill: var(--ink); }
}

#glasses {
	fill: transparent;
	stroke: var(--ink);
	stroke-width: 1;
	stroke-dasharray: 436;
	stroke-dashoffset: 436;
	animation: draw-glasses 1.6s ease forwards;
	animation-delay: 0.15s;
}

@keyframes draw-glasses {
	0% { stroke-dashoffset: 436; fill: transparent; }
	65% { stroke-dashoffset: 0; fill: transparent; }
	100% { stroke-dashoffset: 0; fill: var(--ink); }
}

#lens-left, #lens-right {
	fill: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
	#hat, #glasses {
		animation: none;
		stroke-dashoffset: 0;
		fill: var(--ink);
	}
	html { scroll-behavior: auto; }
}

.hero__eyebrow {
	margin-bottom: 1.4rem;
}

.hero__eyebrow-en {
	display: block;
	font-family: var(--font-en);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ink-mid);
}

.hero__eyebrow-ja {
	display: block;
	margin-top: 0.5rem;
	font-family: var(--font-ja);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	color: var(--ink-light);
}

.hero__name {
	margin-bottom: 1.6rem;
}

.hero__name-line {
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.9rem;
	font-family: var(--font-en);
	font-size: clamp(2.6rem, 8.8vw, 5.6rem);
	font-weight: 700;
	line-height: 1.04;
	letter-spacing: -0.01em;
	color: var(--ink);
	text-wrap: balance;
}

.hero__name-line--last {
	gap: 1.1rem;
}

.hero__name-en {
	font: inherit;
	color: inherit;
}

.hero__name-ja {
	position: relative;
	padding-left: 1.1rem;
	font-family: var(--font-ja);
	font-size: clamp(1rem, 2vw, 1.3rem);
	font-weight: 600;
	letter-spacing: 0.1em;
	color: var(--ink-mid);
}

.hero__name-ja::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.2em;
	bottom: 0.2em;
	width: 1px;
	background: var(--line);
}

.hero__sub {
	font-family: var(--font-ja);
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	color: var(--ink-light);
}


/* ═══ SECTION ═══ */
.sec {
	padding: 7rem 0;
}

.sec--works {
	border-top: 1px solid var(--line-strong);
	padding-bottom: 8rem;
}

.sec--skills {
	background: var(--ink);
	color: #fff;
	border-top: 1px solid var(--ink);
}

.sec--about {
	border-top: 1px solid var(--line);
}

.sec-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.7rem;
	margin-bottom: 3.4rem;
}

.sec-head__en {
	font-family: var(--font-en);
	font-size: clamp(2.3rem, 6.2vw, 3.6rem);
	font-weight: 700;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--ink);
	line-height: 1;
	text-wrap: balance;
}

.sec-head__title {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	line-height: 1;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	color: var(--ink-light);
}

.sec-head__title::before {
	content: '';
	display: block;
	width: 0.7rem;
	height: 1px;
	flex-shrink: 0;
	background: var(--ink-faint);
}


/* ═══ WORKS (grid, row-major) ═══ */
.works-intro {
	font-size: 0.9rem;
	color: var(--ink-mid);
	line-height: 2.0;
	max-width: 780px;
	margin-bottom: 4rem;
}

.works-intro__note {
	display: inline-block;
	margin-top: 0.8rem;
	font-size: 0.8rem;
	color: var(--ink-light);
	padding-left: 0.9rem;
	border-left: 2px solid var(--line);
}

.works-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.6rem;
	align-items: start;
}

.wk {
	background: var(--surface);
	border: 1px solid var(--line);
	display: flex;
	flex-direction: column;
}

.wk__shot {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background: #F2F2F2;
}

.wk__shot::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 42%;
	background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.55) 55%, var(--surface) 100%);
	pointer-events: none;
}

.wk__shot img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.wk__meta {
	padding: 1.3rem 1.4rem 1.6rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.wk__num {
	font-family: var(--font-en);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--ink-faint);
	display: block;
	margin-bottom: 0.5rem;
}

.wk__name {
	font-size: 0.98rem;
	font-weight: 700;
	line-height: 1.5;
	margin-bottom: 0.85rem;
	text-wrap: balance;
}

.wk__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 0.9rem;
}

.t {
	font-family: var(--font-en);
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	padding: 0.2rem 0.55rem;
	background: var(--bg);
	border: 1px solid var(--line);
	color: var(--ink-mid);
}

.wk__desc {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--ink-mid);
	line-height: 1.8;
}

.wk__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 1.1rem;
	font-family: var(--font-en);
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #fff;
	background: var(--ink);
	text-decoration: none;
	padding: 0.5rem 1rem;
	width: fit-content;
	transition: background 0.2s ease;
}

.wk__link:hover {
	background: var(--ink-mid);
}

.wk__link svg {
	width: 13px;
	height: 13px;
}

/* ═══ SKILLS (inverted) ═══ */
.sec--skills .sec-head__en {
	color: #fff;
}

.sec--skills .sec-head__title {
	color: rgba(255, 255, 255, 0.55);
}

.sec--skills .sec-head__title::before {
	background: rgba(255, 255, 255, 0.4);
}

.skills-intro {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.68);
	line-height: 2.0;
	max-width: 780px;
	margin-bottom: 3.5rem;
}

.skill-list {
	border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.skill-row {
	display: grid;
	grid-template-columns: 3rem 15rem 1fr;
	gap: 1.5rem;
	padding: 2.1rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
	align-items: start;
}

.skill-row__idx {
	font-family: var(--font-en);
	font-size: 0.8rem;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.4);
	padding-top: 0.15rem;
}

.skill-row__name {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.5;
	color: #fff;
	text-wrap: balance;
}

.skill-row__desc {
	font-size: 0.84rem;
	color: rgba(255, 255, 255, 0.68);
	line-height: 1.9;
}

/* ═══ ABOUT ═══ */
.about-text {
	max-width: 720px;
}

.about-text p {
	font-size: 0.92rem;
	color: var(--ink-mid);
	line-height: 2.1;
}

.about-text p:first-child {
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.9;
	margin-bottom: 1.8rem;
	padding-left: 1.2rem;
	border-left: 3px solid var(--ink);
}

.about-text p + p {
	margin-top: 1.5rem;
}

/* ═══ FOOTER ═══ */
.foot {
	border-top: 1px solid var(--line-strong);
	padding: 3rem 0;
}

.foot__copy {
	font-family: var(--font-en);
	font-size: 0.74rem;
	letter-spacing: 0.06em;
	color: var(--ink-light);
	text-align: center;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
	.works-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.skill-row {
		grid-template-columns: 2.5rem 1fr;
	}
	.skill-row__desc {
		grid-column: 2;
	}
}

@media (max-width: 600px) {
	html { font-size: 16px; }
	.wrap { padding: 0 1.3rem; }
	.sec { padding: 4.5rem 0; }
	.sec--works { padding-bottom: 5rem; }
	.works-grid {
		grid-template-columns: 1fr;
	}
	.sec-head {
		flex-direction: column;
		gap: 0.5rem;
	}
	.skill-row {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}
	.skill-row__idx { padding-top: 0; }
}
