/* ==========================================================================
   dotwave2026 — デザインシステム
   白 × マスタードイエロー × 黒 / ドット・大円モチーフ
   ========================================================================== */

:root {
	--c-bg: #ffffff;
	--c-ink: #111111;
	--c-accent: #e8c55f;
	--c-gray: #757575;
	--font-en: "Jost", sans-serif;
	--font-ja: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
	--inner-w: 1080px;
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; } /* 装飾円のはみ出しによる横スクロール防止 */
body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-ink);
	font-family: var(--font-ja);
	font-size: 16px;
	line-height: 1.9;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
.font-en { font-family: var(--font-en); letter-spacing: 0.06em; }
.l-inner { max-width: var(--inner-w); margin-inline: auto; padding-inline: clamp(24px, 5vw, 64px); }

/* --- skip link（Task 3 レビュー反映） --- */
.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed;
	top: 8px; left: 8px;
	z-index: 100;
	width: auto; height: auto;
	clip-path: none;
	background: var(--c-ink);
	color: #fff;
	padding: 8px 16px;
}

/* --- WebGL canvas（常駐背景） --- */
.dotfield {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}
/* フォールバック: WebGL不可・reduced-motion 時は静的ドットパターン */
body.no-webgl .dotfield { display: none; }
body.no-webgl {
	background-image: radial-gradient(circle, rgba(17, 17, 17, 0.16) 1.5px, transparent 1.5px);
	background-size: 28px 28px;
}

/* --- header --- */
.site-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 10;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 32px;
}
.site-header__logo { display: block; line-height: 0; }
.site-header__logo img { display: block; width: clamp(96px, 10vw, 128px); height: auto; }
.site-header__nav {
	display: flex;
	gap: 30px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
}
.site-header__nav a { position: relative; }
.site-header__nav a::after {
	content: "";
	position: absolute;
	left: 0; bottom: -5px;
	width: 100%; height: 2px;
	background: var(--c-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s var(--ease-out);
}
.site-header__nav a:hover::after,
.site-header__nav a:focus-visible::after,
.site-header__nav a[aria-current="page"]::after { transform: scaleX(1); }
/* スクロール後の半透明白背景（黒フッター上での不可視化対策）。
   背景だけを別レイヤーにして opacity でフェードさせる（パッと出るのを防ぐ）。
   z-index: -1 でロゴ・ナビの下に敷く。 */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(255, 255, 255, 0.82);
	/* ぼかしも 0 から動かす（Safari の「opacity:0 でも backdrop-filter が効く」対策も兼ねる） */
	-webkit-backdrop-filter: blur(0px);
	backdrop-filter: blur(0px);
	opacity: 0;
	transition: opacity 0.5s var(--ease-out), backdrop-filter 0.5s var(--ease-out), -webkit-backdrop-filter 0.5s var(--ease-out);
	pointer-events: none;
}
.site-header.is-scrolled::before {
	opacity: 1;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

/* --- sections 共通 --- */
.section-heading {
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 500;
	margin-bottom: 40px;
}
.section-heading::after {
	content: "";
	display: block;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--c-accent);
	margin-top: 12px;
}

/* --- hero --- */
.hero {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding: 0 8vw;
	position: relative;
}
.hero__copy {
	font-size: clamp(36px, 7vw, 84px);
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.04em;
}
.hero__copy > span { display: block; } /* 行の改行は直接の子spanだけに（分割後の.charには効かせない） */
.hero__copy .wave-origin { font-style: normal; } /* 波の発生点マーカー（句点。見た目は通常の文字） */
/* スクロールの誘導: 縦に並んだドットを波が上から下へ通り抜ける（プリローダーの波打つドットと同じ言語）。
   実際にスクロールしている間はラベルを引っ込め（body.is-scrolling）、止まると戻る。
   スクロール速度に応じた波紋は wavefield.js 側で発生させる。 */
.hero__scroll {
	position: absolute;
	bottom: 32px; left: 50%;
	transform: translateX(-50%); /* ページ中央に配置 */
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--c-gray);
	transition: opacity 0.5s var(--ease-out);
}
body.is-scrolling .hero__scroll { opacity: 0; }
.hero__scroll-dots { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.hero__scroll-dots i {
	width: 5px; height: 5px;
	border-radius: 50%;
	background: var(--c-gray);
	opacity: 0.3;
	animation: scroll-dot 1.9s ease-in-out infinite;
}
/* 下のドットほど遅らせる = 波が上から下へ通り抜ける */
.hero__scroll-dots i:nth-child(1) { animation-delay: 0s; }
.hero__scroll-dots i:nth-child(2) { animation-delay: 0.11s; }
.hero__scroll-dots i:nth-child(3) { animation-delay: 0.22s; }
.hero__scroll-dots i:nth-child(4) { animation-delay: 0.33s; }
.hero__scroll-dots i:nth-child(5) { animation-delay: 0.44s; }
.hero__scroll-dots i:nth-child(6) { animation-delay: 0.55s; }
/* 波の峰＝横に振れて膨らみ、色がアクセントに乗る */
@keyframes scroll-dot {
	0%, 45%, 100% { transform: translateX(0) scale(1); opacity: 0.3; background: var(--c-gray); }
	22% { transform: translateX(3px) scale(1.6); opacity: 1; background: var(--c-accent); }
}
@media (prefers-reduced-motion: reduce) {
	.hero__scroll-dots i { animation: none; }
}

/* --- concept --- */
.concept { min-height: 120svh; display: flex; align-items: center; padding: 120px 8vw; }
.concept__statement p {
	font-size: clamp(18px, 2.4vw, 26px);
	font-weight: 500;
	line-height: 2.2;
}
.concept__statement p + p { margin-top: 2.2em; }

/* --- service --- */
.service { padding: 140px 0; position: relative; isolation: isolate; }
.service .l-inner { position: relative; }
.service__grid {
	display: grid;
	/* 中央を大きく */
	grid-template-columns: 1fr 1.18fr 1fr;
	align-items: start;
	gap: 3%;
}
.service-card {
	position: relative;
	/* 正円。テキストは円内に中央配置 */
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 13%;
	transition: transform 0.5s var(--ease-out);
}
/* 上下に互い違いにずらしてリズムを出す */
.service-card:nth-child(1) { margin-top: 0; }
.service-card:nth-child(2) { margin-top: 96px; }
.service-card:nth-child(3) { margin-top: 36px; }
/* ベタ塗りの塗り分け（黄・黒・黄）と文字色 */
.service-card:nth-child(odd) { background: var(--c-accent); color: var(--c-ink); }
.service-card:nth-child(even) { background: var(--c-ink); color: #fff; }
/* ホバー: 浮き上がり＋波紋リングが広がる */
.service-card:hover { transform: translateY(-10px) scale(1.03); }
.service-card::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--c-ink); /* 白背景でも見えるよう濃色（黒カードの白リング不可視を修正） */
	opacity: 0;
	pointer-events: none;
}
.service-card:hover::after { animation: card-ripple 0.9s ease-out; }
@keyframes card-ripple {
	0% { opacity: 0.5; transform: scale(1); }
	100% { opacity: 0; transform: scale(1.3); }
}
.service-card__num {
	font-size: 15px;
	font-weight: 600;
	color: inherit;
	opacity: 0.7;
}
.service-card__num::after {
	content: "";
	display: inline-block;
	width: 8px; height: 8px;
	border-radius: 50%;
	background: currentColor;
	margin-left: 8px;
	opacity: 0.85;
}
.service-card__title { font-size: 20px; font-weight: 700; margin: 10px 0 12px; color: inherit; }
.service-card__text { font-size: 13px; line-height: 1.85; color: inherit; opacity: 0.82; }

/* --- cta（Works導線） --- */
.cta { padding: 60px 0 160px; text-align: center; }
.cta__works {
	display: inline-block;
	font-family: var(--font-en);
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 500;
	border-bottom: 2px solid var(--c-ink);
	padding-bottom: 6px;
	transition: color 0.3s, border-color 0.3s;
}
.cta__works:hover { color: var(--c-ink); border-color: var(--c-accent); }

/* --- works 一覧 --- */
.page-hero { padding-top: 180px; padding-bottom: 60px; } /* 左右余白は .l-inner に任せる */
.page-hero__title { font-size: clamp(32px, 5vw, 56px); font-weight: 500; }
.page-hero__title::after {
	content: "";
	display: block;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--c-accent);
	margin-top: 12px;
}
.works-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	padding-bottom: 120px;
}
.works-card { background: rgba(255, 255, 255, 0.92); }
.works-card__thumb { aspect-ratio: 880 / 480; overflow: hidden; }
.works-card__thumb img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform 0.5s var(--ease-out);
}
.works-card:hover .works-card__thumb img { transform: scale(1.05); }
.works-card__body { padding: 16px 4px; }
.works-card__cat { font-size: 12px; color: var(--c-gray); }
.works-card__title { font-size: 16.5px; font-weight: 700; margin-top: 6px; }

/* --- 制作実績のモック画面（枠内でデザインをスクロール） --- */
.mockups {
	display: flex;
	align-items: flex-end;
	gap: 32px;
	margin-bottom: 48px;
}
.mock { margin: 0; position: relative; }
.mock--desktop { flex: 1 1 auto; min-width: 0; max-width: 680px; }
.mock--phone { flex: 0 0 clamp(160px, 24vw, 300px); }
/* 端末枠は 2022 テーマの mockup_pc / mockup_sp をそのまま流用（枠画像が寸法の基準） */
.mock__frame {
	display: block;
	width: 100%;
	height: auto;
	position: relative;
	z-index: 1; /* 枠を前面に。画面部分は透明なのでデザインが覗く＝枠で切り抜かれる */
	pointer-events: none; /* 枠越しでも下のデザインをスクロールできるように */
}
/* デザインを枠画像の画面部分（透明の抜き）にぴったり合わせる。値は枠画像の実寸比 */
.mock--desktop .mock__screen { top: 1.96%; left: 1.35%; width: 97.3%; height: 66.95%; }
.mock--phone .mock__screen { top: 7.85%; left: 5.64%; width: 88.63%; height: 85.47%; }
/* 共通: 枠内スクロール（デザイン全体を上下に見せる） */
.mock__screen {
	position: absolute;
	overflow-y: auto;
	overflow-x: hidden;
	background: #fff;
	-webkit-overflow-scrolling: touch;
	/* Firefox: 細いバー。トラックは透明にして白い帯が出ないように */
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
}
.mock__screen img { width: 100%; height: auto; display: block; }
/* WebKit: トラックを透明にして、つまみだけを角丸のピルとして枠の内側に浮かせる */
.mock__screen::-webkit-scrollbar { width: 12px; }
.mock__screen::-webkit-scrollbar-track { background: transparent; }
.mock__screen::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.28);
	border-radius: 999px;
	/* 透明ボーダー + padding-box で、右端から浮かせつつ細く見せる */
	border: 3px solid transparent;
	background-clip: padding-box;
}
.mock__screen::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.45); }
/* 画面の角にバーの端が乗らないよう上下を詰める */
.mock--desktop .mock__screen::-webkit-scrollbar-track { margin: 3px 0; }
.mock--phone .mock__screen::-webkit-scrollbar-track { margin: 10px 0; }
.mock__screen:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.mock__visit { margin: 0 0 48px; }
.mock__visit a {
	font-size: 15px; letter-spacing: 0.08em;
	border-bottom: 2px solid var(--c-ink);
	padding-bottom: 4px;
	transition: border-color 0.3s;
}
.mock__visit a:hover { border-color: var(--c-accent); }
@media (max-width: 720px) {
	.mockups { flex-direction: column; align-items: center; gap: 28px; }
	.mock--desktop { flex: none; width: 100%; max-width: 560px; }
	.mock--phone { flex: none; width: clamp(200px, 62vw, 280px); }
}

/* --- 記事詳細・固定ページ --- */
.page-body { padding-bottom: 140px; }
/* page-hero を持たないテンプレート（index.php 等）では固定ヘッダー分の上余白を確保 */
.site-main > .page-body:first-child { padding-top: 160px; }
.entry-meta { font-size: 13px; color: var(--c-gray); margin-bottom: 28px; }
.entry-thumb { margin-bottom: 40px; }
.entry-content { max-width: 760px; }
.entry-content :is(h2, h3) { margin: 2em 0 0.8em; line-height: 1.5; }
.entry-content p { margin: 1.2em 0; }
.entry-content :is(ul, ol) { padding-left: 1.4em; }
.entry-content img { margin: 1.5em 0; }
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.page-title { font-size: clamp(26px, 4vw, 40px); font-weight: 700; line-height: 1.5; margin-bottom: 16px; }

/* --- news 一覧 --- */
.news-list { max-width: 760px; padding-bottom: 120px; }
.news-item { border-bottom: 1px solid #ddd; }
.news-item a { display: flex; gap: 28px; align-items: baseline; padding: 22px 4px; }
.news-item time { font-family: var(--font-en); font-size: 14px; color: var(--c-gray); flex-shrink: 0; }
.news-item:hover { background: rgba(232, 197, 95, 0.12); }

/* --- pagination --- */
.pagination { padding-bottom: 120px; text-align: center; }
.pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 6px 0;
	margin: 0 4px;
	font-family: var(--font-en);
	border: 1px solid var(--c-ink);
}
.pagination .page-numbers.current { background: var(--c-ink); color: #fff; }

/* --- footer --- */
.site-footer { position: relative; background: var(--c-ink); color: #fff; padding: 80px 0 32px; margin-top: 40px; }
/* 上端の波（横に流れて波打つ） */
.site-footer__wave {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: clamp(64px, 9vw, 130px);
	transform: translateY(-99%);
	overflow: hidden;
	line-height: 0;
	pointer-events: none;
}
.site-footer__wave svg {
	display: block;
	width: 200%;
	height: 100%;
	/* 大きな波が左から右へ流れる（translateX を -50%→0 で右方向に送る） */
	animation: footer-wave 7s linear infinite;
}
@keyframes footer-wave {
	from { transform: translateX(-50%); }
	to { transform: translateX(0); }
}
/* ロゴを外したのでタグラインがフッターの先頭。ステートメントとして少し大きく */
.site-footer__tagline {
	font-size: clamp(17px, 2vw, 22px);
	line-height: 1.8;
	font-weight: 500;
	color: var(--c-accent);
}
.site-footer__info { margin-top: 36px; font-size: 14px; }
.site-footer__info div { display: flex; gap: 20px; padding: 4px 0; }
.site-footer__info dt { width: 4em; color: #999; }
.site-footer__info a { text-decoration: underline; }
.site-footer__copyright { margin-top: 48px; font-size: 12px; color: #888; }

/* --- 404 --- */
.error-page { min-height: 70svh; display: flex; flex-direction: column; justify-content: center; }
.error-page__code { font-family: var(--font-en); font-size: clamp(64px, 12vw, 140px); font-weight: 600; line-height: 1; }
.error-page__code::after {
	content: "";
	display: inline-block;
	width: 0.16em; height: 0.16em;
	border-radius: 50%;
	background: var(--c-accent);
	margin-left: 0.08em;
}

/* --- responsive --- */
@media (max-width: 900px) {
	.service__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
	.works-grid { grid-template-columns: 1fr 1fr; }
	/* 多段になるので互い違いのずらしは解除 */
	.service-card:nth-child(1),
	.service-card:nth-child(2),
	.service-card:nth-child(3) { margin-top: 0; }
}
@media (max-width: 640px) {
	.site-header { padding: 16px 20px; }
	.hero { padding: 0 6vw; }
	.hero__copy { font-size: clamp(22px, 6.4vw, 40px); letter-spacing: 0; }
	.service__grid, .works-grid { grid-template-columns: 1fr; }
	.service-card { max-width: 340px; margin-inline: auto; } /* 1カラム時に円が大きくなりすぎないよう制限 */
	.news-item a { flex-direction: column; gap: 4px; }
}

/* --- プリローダー（ローディング画面） --- */
/* JS有効時のみ表示（非JSでは出さない＝サイトが隠れない） */
#preloader { display: none; }
.js #preloader {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: var(--c-bg);
	align-items: center;
	justify-content: center;
	transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
.js #preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 30px;
	animation: pl-logo-in 1s var(--ease-out) both;
}
.preloader__logo svg { width: clamp(190px, 32vw, 320px); height: auto; display: block; overflow: visible; }
.preloader__dot { transform-box: fill-box; transform-origin: center; animation: pl-dot-pulse 1.1s ease-in-out infinite; }
.preloader__wave { display: flex; gap: 11px; }
.preloader__wave span {
	width: 10px; height: 10px;
	border-radius: 50%;
	background: var(--c-ink);
	animation: pl-wave 1s ease-in-out infinite;
}
.preloader__wave span:nth-child(1) { animation-delay: 0s; }
.preloader__wave span:nth-child(2) { animation-delay: 0.12s; }
.preloader__wave span:nth-child(3) { animation-delay: 0.24s; background: var(--c-accent); }
.preloader__wave span:nth-child(4) { animation-delay: 0.36s; }
.preloader__wave span:nth-child(5) { animation-delay: 0.48s; }
@keyframes pl-logo-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pl-dot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes pl-wave { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-14px); opacity: 1; } }

/* --- スクロール連動の登場アニメーション --- */
/* JS有効かつモーション許可時のみ事前に隠す（非JS・reduced-motionでは常に表示） */
@media (prefers-reduced-motion: no-preference) {
	.js :is(
		.service-card, .cta__works, .works-card, .news-item,
		.entry-content
	),
	.js .concept__statement p {
		opacity: 0;
		transform: translateY(32px);
		transition: opacity 1.8s var(--ease-out), transform 1.8s var(--ease-out);
	}
	.js .reveal-in { opacity: 1 !important; transform: none !important; }

	/* 一文字ずつ下からニョキッと迫り上がる（キービジュ＋各見出し共通） */
	.js :is(.hero__copy, .section-heading, .page-hero__title, .page-title) { opacity: 0; } /* 分割完了までチラ見え防止 */
	.js .chars-ready { opacity: 1; }
	.char { display: inline-block; overflow: hidden; vertical-align: top; padding-top: 0.12em; margin-top: -0.12em; }
	.char__in { display: inline-block; transform: translateY(115%); transition: transform 0.75s var(--ease-out); }
	.chars-in .char__in { transform: translateY(0); }
}

/* --- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
