/* Front page: full-screen section scroll */

html {
	scroll-snap-type: y mandatory;
	scroll-behavior: smooth;
}

html:has(body.admin-bar) {
	scroll-padding-top: 32px;
}

@media (max-width: 782px) {
	html:has(body.admin-bar) {
		scroll-padding-top: 46px;
	}
}

body {
	background: transparent;
}

/*
 * 背景は全セクション共通の固定レイヤー1枚。
 * --bg-a / --bg-b（色）、--bg-angle（角度）、--bg-from / --bg-to（位置）を
 * JS がスクロール量に応じて補間して書き換える。
 */
.bg-stage {
	position: fixed;
	inset: 0 0 auto;
	z-index: -1;
	height: 100vh;
	height: 100lvh;
	overflow: hidden;
	background-color: var(--bg-a);
	background-image: linear-gradient(var(--bg-angle, 160deg), var(--bg-a) var(--bg-from, 0%), var(--bg-b) var(--bg-to, 100%));
	pointer-events: none;
}

.bg-stage__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Sections ---------------------------------------------------------------- */

.section {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100vh;
	padding: clamp(96px, 14vh, 160px) clamp(20px, 6vw, 96px) clamp(64px, 12vh, 140px);
	overflow: hidden;
	/* --ink / --accent はセクション要素の style 属性で指定（frutto_v3_section_attrs()） */
	color: var(--ink, #111);
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.section__inner {
	max-width: 72rem;
}

.section__eyebrow {
	margin: 0 0 1.25rem;
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	opacity: 0.75;
}

.section__heading {
	margin: 0;
	font-size: clamp(3rem, 10vw, 8rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
}

.section__lead {
	max-width: 36em;
	margin: 1.5rem 0 0;
}

/* 最初のセクション: 見出しボックスを上下左右中央に配置（テキストは左揃え） */
.section--top {
	align-items: center;
	justify-content: center;
	padding-block: 0;
	text-align: left;
}

.section--top .section__inner {
	max-width: none;
}

.section--top .section__heading {
	font-family: "Caveat", cursive;
	font-size: clamp(3.5rem, 13.23vw, 200px); /* 幅 1512px で 200px（2 行目がコンテンツ幅いっぱい）、それ未満は比率で縮小 */
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.07em;
}

/* ヘッダーは画面上部に固定 */
.site-header {
	position: fixed;
}

/* 最後のセクションの後ろにあるフッターまでスクロールできるよう、ページ末尾もスナップ位置にする */
.site-footer {
	scroll-snap-align: end;
}

/* Journal ------------------------------------------------------------------ */

.section--journal {
	align-items: center;
	justify-content: flex-start;
	/* デザインは上寄せ（見出しの行ボックス上端が 185px） */
	padding: 185px clamp(20px, 4vw, 48px) 80px;
}

.journal {
	width: 100%;
	max-width: 1200px;
}

.journal__more {
	margin-top: 32px;
}

@media (max-width: 767px) {
	.section--journal {
		padding-top: 120px;
	}
}

/* Product sections: QUACK WORKS / ncolor ---------------------------------- */

.section:has(> .product) {
	align-items: center;
	justify-content: center;
	padding: 0 clamp(20px, 4vw, 48px);
}

.product {
	display: flex;
	gap: 20px;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: 1200px;
}

.product__body {
	flex: 0 1 560px;
}

.product__logo {
	margin: 0;
	line-height: 0;
}

.product__logo img {
	max-width: 100%;
	height: auto;
}

.product__catch {
	margin: 14px 0 0;
	font-weight: 600;
}

/* 本文（サービスの Classic エディタ） */
.product__lead {
	margin: 31px 0 0;
}

.product__lead > * {
	margin-block: 0;
}

.product__lead > * + * {
	margin-top: 1.7em;
}

.product__button {
	margin-top: 33px;
}

/* QUACK WORKS のイラスト */
.product__visual {
	flex: 0 1 580px;
	width: 580px;
	min-width: 0;
	max-width: 100%;
	height: auto;
}

/* ncolor の色相スライダー（input[type=range] を CSS で描画） */
.hue-slider {
	flex: 0 1 480px;
	margin-top: 5px;
	text-align: center;
}

.hue-slider__input {
	display: block;
	width: 100%;
	height: 32px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.hue-slider__input::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: #fff;
}

.hue-slider__input::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: #fff;
}

.hue-slider__input::-webkit-slider-thumb {
	width: 32px;
	height: 32px;
	margin-top: -13px; /* (6 - 32) / 2 */
	border: 0;
	border-radius: 50%;
	background: var(--accent);
	-webkit-appearance: none;
	appearance: none;
}

.hue-slider__input::-moz-range-thumb {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: var(--accent);
}

/* キーボード操作時はつまみの周りにリングを出す */
.hue-slider__input:focus-visible {
	outline: none;
}

.hue-slider__input:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent);
}

.hue-slider__input:focus-visible::-moz-range-thumb {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent);
}

.hue-slider__code {
	display: block;
	margin-top: 10px;
	font-size: 12px;
}

@media (max-width: 767px) {
	.section:has(> .product) {
		padding-block: 84px 60px;
	}

	.product {
		flex-direction: column;
		gap: 24px;
		align-items: flex-start;
	}

	.product__body {
		flex: none;
		margin-top: 0;
	}

	.product__lead {
		margin-top: 16px;
	}

	.product__button {
		margin-top: 20px;
	}

	.product__visual {
		flex: none;
		align-self: center;
		width: min(460px, 60vw, 30vh);
	}

	.hue-slider {
		flex: none;
		width: 100%;
		max-width: 480px;
		margin: 16px auto 0;
	}
}

/* Company（画面より背が高いので height: auto。本文幅 960px） ----------------- */

/* 中身の見た目（.company / .company__*）は固定ページ「Company」と共通なので main.css */
.section--company {
	justify-content: flex-start;
	height: auto;
	min-height: 100vh;
	padding: 105px max(clamp(20px, 4vw, 48px), (100% - 960px) / 2) 0;
	overflow: visible;
}

@media (max-width: 767px) {
	.section--company {
		padding-top: 100px;
	}
}

/* Reveal (JS 有効時のみ) ---------------------------------------------------- */

.js .section__inner > * {
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
		transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .section.is-active .section__inner > * {
	opacity: 1;
	transform: none;
}

.js .section.is-active .section__inner > :nth-child(2) {
	transition-delay: 0.08s;
}

.js .section.is-active .section__inner > :nth-child(3) {
	transition-delay: 0.16s;
}

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

	.js .section__inner > * {
		transform: none;
		transition-duration: 0.01ms;
	}
}
