/*
  inou! — corporate site stylesheet

  Design tokens and layout are adapted from Bear Blog's default CSS
  (https://github.com/HermanMartinus/bearblog, MIT), by way of the Astro blog
  starter. Changes for a Japanese-language site: system font stack instead of
  Atkinson Hyperlegible (no CJK glyphs), smaller body size with looser leading,
  and a deeper accent taken from the deck theme.
*/

:root {
	--accent: #156082;
	--accent-dark: #0e4459;
	--accent-light: #e7f0f4;
	--black: 15, 18, 25;
	--gray: 96, 115, 159;
	--gray-light: 229, 233, 240;
	--gray-dark: 34, 41, 57;
	--gray-gradient: rgba(var(--gray-light), 50%), #fff;
	--shadow-card: 0 4px 10px rgba(0, 0, 0, 0.1);
	--shadow-hero:
		0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%),
		0 16px 32px rgba(var(--gray), 33%);
	--radius: 8px;
	--measure: 720px;
	--measure-wide: 1040px;
}

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

body {
	font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP",
		"Yu Gothic Medium", "Meiryo", sans-serif;
	margin: 0;
	padding: 0;
	text-align: left;
	background: linear-gradient(var(--gray-gradient)) no-repeat;
	background-size: 100% 600px;
	word-wrap: break-word;
	overflow-wrap: break-word;
	color: rgb(var(--gray-dark));
	font-size: 17px;
	line-height: 1.9;
	font-feature-settings: "palt" 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5rem 0;
	color: rgb(var(--black));
	line-height: 1.45;
	font-weight: 700;
}

h1 {
	font-size: 2.441em;
	line-height: 1.3;
}
h2 {
	font-size: 1.953em;
}
h3 {
	font-size: 1.563em;
}
h4 {
	font-size: 1.25em;
}

p {
	margin: 0 0 1em;
}

a {
	color: var(--accent);
}
a:hover {
	color: var(--accent-dark);
}

strong,
b {
	font-weight: 700;
}

img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
}

hr {
	border: none;
	border-top: 1px solid rgb(var(--gray-light));
	margin: 3em 0;
}

.sr-only {
	border: 0;
	padding: 0;
	margin: 0;
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: #fff;
	padding: 0.6em 1em;
	z-index: 10;
}
.skip-link:focus {
	left: 0;
}

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

.site-header {
	margin: 0;
	padding: 0 1em;
	background: #fff;
	box-shadow: 0 2px 8px rgba(var(--black), 5%);
	position: relative;
	z-index: 2;
}

.site-header nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0 1em;
	max-width: var(--measure-wide);
	margin: 0 auto;
}

.brand {
	margin: 0;
	font-size: 1.35em;
	font-weight: 700;
	letter-spacing: -0.01em;
	padding: 0.5em 0;
}
.brand a {
	color: var(--accent);
	text-decoration: none;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.4em;
}

.nav-links a {
	display: inline-block;
	padding: 1.1em 0.6em;
	color: rgb(var(--black));
	border-bottom: 4px solid transparent;
	text-decoration: none;
	font-size: 0.95em;
}
.nav-links a:hover {
	color: var(--accent);
}
.nav-links a[aria-current="page"] {
	font-weight: 700;
	border-bottom-color: var(--accent);
}

/* ---------- Layout ---------- */

main {
	display: block;
}

.wrap-wide {
	width: var(--measure-wide);
	max-width: calc(100% - 2em);
	margin: 0 auto;
}

/*
   One container width keeps every section's left edge on the same line.
   Body copy is then held to a readable measure, but only as a DIRECT child —
   text inside cards is already narrow and must not be clamped again.
*/
.wrap-wide > p,
.wrap-wide > ol.refs,
.wrap-wide > ul:not(.cards),
.stack > article > p,
.page-title .lead {
	max-width: var(--measure);
}

.wrap-wide > .flow-loop {
	max-width: none;
}

section {
	padding: 3.5em 0;
}

.band {
	background: var(--accent-light);
	border-block: 1px solid rgba(var(--gray-light), 0.9);
}

.page-title {
	padding: 2.5em 0 0;
}
.page-title h1 {
	margin-bottom: 0.3em;
}
.page-title .lead {
	color: rgba(var(--gray-dark), 0.85);
	font-size: 1.1em;
	margin: 0;
}

.eyebrow {
	display: block;
	font-size: 0.82em;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: var(--accent);
	margin-bottom: 0.6em;
	line-height: 1.4;
}

.lead {
	font-size: 1.15em;
	line-height: 1.85;
}

.note {
	font-size: 0.86em;
	color: rgba(var(--gray-dark), 0.75);
	line-height: 1.7;
}

/* ---------- Hero ---------- */

.hero {
	padding: 4em 0 0;
}

.hero .logotype {
	font-size: 3.4em;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--accent);
	line-height: 1;
	margin: 0 0 0.35em;
}

.hero h1 {
	font-size: 1.85em;
	margin-bottom: 0.6em;
}

.hero .lead {
	max-width: 34em;
}

.hero-figure {
	margin: 2.5em auto 0;
}

figure {
	margin: 0;
}
figcaption {
	font-size: 0.84em;
	line-height: 1.7;
	color: rgba(var(--gray-dark), 0.75);
	margin-top: 0.8em;
}

/* ---------- Process flow ---------- */

.flow {
	list-style: none;
	display: flex;
	gap: 0.6em;
	padding: 0;
	margin: 2em 0 0;
	counter-reset: step;
}

.flow > li {
	flex: 1 1 0;
	position: relative;
	background: #fff;
	border: 1px solid rgba(var(--gray-light), 0.9);
	border-top: 3px solid var(--accent);
	border-radius: var(--radius);
	padding: 1.1em 1em;
	box-shadow: var(--shadow-card);
}

.flow > li h3 {
	font-size: 1.05em;
	margin: 0 0 0.35em;
}

.flow > li p {
	margin: 0;
	font-size: 0.86em;
	line-height: 1.7;
	color: rgba(var(--gray-dark), 0.8);
}

.flow > li + li::before {
	content: "";
	position: absolute;
	left: -0.55em;
	top: 50%;
	width: 0;
	height: 0;
	border-left: 0.42em solid rgba(var(--gray), 0.55);
	border-top: 0.34em solid transparent;
	border-bottom: 0.34em solid transparent;
	transform: translateY(-50%);
}

.flow-loop {
	margin-top: 1em;
	text-align: right;
}

/* ---------- Cards ---------- */

.cards {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.2em;
	padding: 0;
	margin: 2em 0 0;
}

.cards > li {
	background: #fff;
	border: 1px solid rgba(var(--gray-light), 0.9);
	border-radius: 12px;
	padding: 1.4em 1.5em;
	box-shadow: 0 14px 30px rgba(var(--gray), 0.12);
}

.cards h3 {
	font-size: 1.1em;
	margin: 0 0 0.4em;
}

.cards p {
	margin: 0;
	font-size: 0.92em;
	color: rgba(var(--gray-dark), 0.85);
}

/* ---------- Definition-style lists ---------- */

.stack {
	display: grid;
	gap: 1.6em;
	margin: 2em 0 0;
}

.stack > article {
	border-left: 3px solid var(--accent);
	padding-left: 1.3em;
}

.stack h3 {
	font-size: 1.2em;
	margin-bottom: 0.3em;
}

.stack p:last-child {
	margin-bottom: 0;
}

.figure-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5em;
	margin: 2em 0 0;
}

.figure-pair img {
	width: 100%;
	box-shadow: var(--shadow-card);
	background: #fff;
}

/* ---------- Tables ---------- */

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0 0;
	font-size: 0.92em;
}

th,
td {
	text-align: left;
	padding: 0.65em 0.8em;
	border-bottom: 1px solid rgb(var(--gray-light));
}

thead th {
	background: var(--accent);
	color: #fff;
	font-weight: 700;
}

td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* ---------- References ---------- */

.refs {
	list-style: none;
	padding: 0;
	margin: 1.5em 0 0;
	display: grid;
	gap: 1em;
}

.refs > li {
	font-size: 0.88em;
	line-height: 1.7;
	padding-left: 1.4em;
	text-indent: -1.4em;
	color: rgba(var(--gray-dark), 0.9);
}

/* ---------- Call to action ---------- */

.cta {
	text-align: center;
}

.cta > .wrap-wide > p,
.cta > .wrap-wide > h2 {
	margin-inline: auto;
}

.button {
	display: inline-block;
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	border-radius: var(--radius);
	padding: 0.75em 2em;
	margin-top: 0.5em;
}
.button:hover {
	background: var(--accent-dark);
	color: #fff;
}

/* ---------- Footer ---------- */

.site-footer {
	padding: 3em 1em 4em;
	margin-top: 2em;
	background: linear-gradient(var(--gray-gradient)) no-repeat;
	color: rgb(var(--gray));
	text-align: center;
	font-size: 0.88em;
	border-top: 1px solid rgb(var(--gray-light));
}

.site-footer nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4em 1.2em;
	margin-bottom: 1.2em;
}

.site-footer a {
	color: rgb(var(--gray));
}
.site-footer a:hover {
	color: rgb(var(--gray-dark));
}

.site-footer p {
	margin: 0.3em 0;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 720px) {
	body {
		font-size: 16px;
	}

	section {
		padding: 2.5em 0;
	}

	.hero {
		padding-top: 2.5em;
	}
	.hero .logotype {
		font-size: 2.6em;
	}
	.hero h1 {
		font-size: 1.45em;
	}

	h1 {
		font-size: 1.85em;
	}
	h2 {
		font-size: 1.5em;
	}
	h3 {
		font-size: 1.25em;
	}

	.site-header nav {
		justify-content: flex-start;
	}
	.nav-links a {
		padding: 0.7em 0.55em;
	}

	.flow {
		flex-direction: column;
		gap: 1.1em;
	}
	.flow > li + li::before {
		left: 50%;
		top: -0.75em;
		transform: translateX(-50%);
		border-left: 0.34em solid transparent;
		border-right: 0.34em solid transparent;
		border-top: 0.42em solid rgba(var(--gray), 0.55);
		border-bottom: none;
	}
	.flow-loop {
		text-align: left;
	}

	.cards,
	.figure-pair {
		grid-template-columns: 1fr;
	}

	table {
		font-size: 0.85em;
	}
	th,
	td {
		padding: 0.55em 0.5em;
	}
}

/* ---------- Cropped figure ---------- */

/*
   grinding-reproducibility.png carries the source figure's own summary table
   below the two plots. The same numbers are published as a real <table> next to
   it, so the bottom of the image is cropped away here rather than shipping the
   figures twice. 1110x721 source; the plots end at roughly y=390.
*/
.crop-plots {
	display: block;
	width: 100%;
	aspect-ratio: 1110 / 390;
	object-fit: cover;
	object-position: top center;
	background: #fff;
}

/* ---------- Contact ---------- */

.contact-mail {
	font-size: 1.15em;
	font-weight: 700;
	margin-bottom: 0.3em;
}

/* ---------- Embedded video ---------- */

/*
   YouTube embed. The video is hosted on the lab's own channel rather than
   shipped with the repo — the source file is 4.8MB, which is more than the
   whole site put together.
*/
.video {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
	box-shadow: var(--shadow-hero);
}

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