/* COARAS Brand Story v2 — cinematic scroll enhanced (CC/WOW v2) */

/* ── CSS変数フォールバック（tokens.css なし環境でも動くように） ── */
:root {
	--font-display: 'Zen Old Mincho', 'Yu Mincho', serif;
	--font-body: 'Manrope', 'Hiragino Sans', 'Segoe UI', sans-serif;
	--color-ink: #0c2444;
	--coaras-brand-blue: #001489;
	--coaras-brand-blue-hover: #001070;
	--coaras-brand-ice: #e8eef2;
	--coaras-brand-dark: #0c2444;
	--coaras-brand-white-warm: rgba(255,255,255,0.95);
	--coaras-brand-accent-sky: #00a3ff;
	--coaras-bar-border: rgba(255,255,255,0.14);
	--max-site: 1120px;
	--pad: clamp(1rem, 5vw, 2.5rem);
	--text-lead: 1.0625rem;
	--ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; }

html {
	overflow-x: clip;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.85;
	color: var(--color-ink);
	background: #050a14;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--coaras-brand-accent-sky); outline-offset: 3px; }

.shell {
	width: min(100%, calc(var(--max-site) + var(--pad) * 2));
	margin-inline: auto;
	padding-inline: var(--pad);
}

.preview-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 300;
	background: #1a0a0a;
	color: #ffb4b4;
	text-align: center;
	font-size: 0.7rem;
	padding: 0.3rem;
	letter-spacing: 0.04em;
}

.coaras-site-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 200;
	font-size: 0.8125rem;
	background: rgba(0, 20, 137, 0.92);
	backdrop-filter: blur(8px);
	color: var(--coaras-brand-white-warm);
	border-bottom: 1px solid var(--coaras-bar-border);
}

.coaras-site-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem 1rem;
	padding-block: 0.45rem;
}

.coaras-site-bar__home {
	text-decoration: none;
	color: #fff;
	font-weight: 600;
}

.coaras-site-bar__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

.coaras-site-bar__links a {
	text-decoration: none;
	color: rgba(255, 255, 255, 0.82);
}

.coaras-site-bar__links a:hover { color: #fff; }

/* ── Intro ── */
.story-intro {
	position: relative;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding:
		calc(3.75rem + env(safe-area-inset-top, 0px))
		var(--pad)
		clamp(2.5rem, 6vh, 4rem);
	color: #fff;
	overflow: clip;
}

.story-intro .shell {
	width: min(100%, calc(var(--max-site) + var(--pad) * 2));
	margin-inline: auto;
	padding-inline: 0;
}

.story-intro__media {
	position: absolute;
	inset: 0;
}

.story-intro__media video,
.story-intro__media img,
.story-intro__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.story-intro__video {
	will-change: transform;
}

.story-intro__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(5, 10, 20, 0.35) 0%,
		rgba(5, 10, 20, 0.55) 40%,
		rgba(0, 20, 137, 0.75) 100%
	);
}

.story-intro__inner {
	position: relative;
	z-index: 2;
	max-width: 44rem;
}

.story-intro__label {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.28em;
	color: var(--coaras-brand-accent-sky);
	margin-bottom: 1rem;
}

.story-intro h1 {
	font-family: var(--font-display);
	font-size: clamp(2rem, 5.5vw, 3.4rem);
	font-weight: 500;
	line-height: 1.28;
	margin: 0 0 1.25rem;
}

.story-intro__lead {
	font-size: clamp(1rem, 2.2vw, 1.2rem);
	opacity: 0.92;
	margin: 0;
	max-width: 36rem;
}

.story-intro__hint {
	margin-top: 2rem;
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	opacity: 0.65;
	animation: pulse-hint 2.4s ease-in-out infinite;
}

@keyframes pulse-hint {
	0%, 100% { opacity: 0.45; transform: translateY(0); }
	50% { opacity: 0.9; transform: translateY(4px); }
}

/* ── Pinned cinematic block ── */
.story-cinema {
	position: relative;
	height: 720vh;
}

.story-cinema__pin {
	position: relative;
	height: 100vh;
	overflow: clip;
	background: #050a14;
}

.story-cinema__video,
.story-cinema__chapter-videos {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.story-cinema__chapter-video {
	position: absolute;
	inset: -10%;
	width: 120%;
	height: 120%;
	object-fit: cover;
	opacity: 0;
	z-index: 0;
	will-change: transform, opacity;
	transition: none;
}

.story-cinema__chapter-video.is-active {
	z-index: 1;
}

.story-cinema__mesh {
	position: absolute;
	inset: -20%;
	z-index: 1;
	pointer-events: none;
	background:
		radial-gradient(ellipse 55% 45% at 20% 30%, rgba(0, 163, 255, 0.22) 0%, transparent 55%),
		radial-gradient(ellipse 50% 40% at 80% 70%, rgba(0, 20, 137, 0.35) 0%, transparent 50%),
		radial-gradient(ellipse 40% 35% at 50% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 60%);
	mix-blend-mode: screen;
	will-change: transform;
}

.story-cinema__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(48px);
	pointer-events: none;
	z-index: 1;
	will-change: transform;
}
.story-cinema__orb--1 {
	width: min(42vw, 320px);
	height: min(42vw, 320px);
	top: 12%;
	left: 8%;
	background: rgba(0, 163, 255, 0.28);
}
.story-cinema__orb--2 {
	width: min(36vw, 260px);
	height: min(36vw, 260px);
	bottom: 18%;
	right: 10%;
	background: rgba(0, 20, 137, 0.45);
}
.story-cinema__orb--3 {
	width: min(28vw, 200px);
	height: min(28vw, 200px);
	top: 42%;
	right: 28%;
	background: rgba(255, 255, 255, 0.12);
}

.story-cinema__bg {
	position: absolute;
	inset: -6%;
	background-size: cover;
	background-position: center;
	transform: scale(1.05);
	will-change: transform, opacity;
	z-index: 2;
	opacity: 0.85;
}

.story-cinema__bg::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		120deg,
		rgba(5, 10, 20, 0.72) 0%,
		rgba(0, 20, 137, 0.38) 55%,
		rgba(5, 10, 20, 0.65) 100%
	);
}

.story-cinema__bg--0 { background-image: url('https://coaras.com/img/AdobeStock_1645328631.jpg'); opacity: 1; }
.story-cinema__bg--1 { background-image: url('https://coaras.com/img/coreas.jpeg'); opacity: 0; }
.story-cinema__bg--2 { background-image: url('https://coaras.com/img/AdobeStock_1645328631.jpg'); background-position: 60% 40%; opacity: 0; }
.story-cinema__bg--3 { background-image: url('https://coaras.com/img/coreas.jpeg'); background-position: 30% 60%; opacity: 0; }
.story-cinema__bg--4 { background-image: url('https://coaras.com/img/AdobeStock_1645328631.jpg'); background-position: 45% 55%; opacity: 0; }
.story-cinema__bg--5 { background-image: url('https://coaras.com/img/coreas.jpeg'); background-position: 70% 35%; opacity: 0; }

.story-cinema__grid {
	position: relative;
	z-index: 5;
	height: 100%;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr auto;
	padding: clamp(5rem, 12vh, 7rem) var(--pad) var(--pad);
	gap: 2rem;
}

@media (min-width: 900px) {
	.story-cinema__grid {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr;
		align-items: center;
	}
}

.story-cinema__kanji-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	order: -1;
	pointer-events: none;
}

@media (min-width: 900px) {
	.story-cinema__kanji-wrap { order: 0; }
}

.story-cinema__kanji {
	font-family: 'Zen Old Mincho', 'Yu Mincho', serif;
	font-size: clamp(6rem, 18vw, 15rem);
	font-weight: 400;
	line-height: 1;
	color: rgba(255, 255, 255, 0.88);
	letter-spacing: -0.03em;
	user-select: none;
	will-change: transform, opacity;
	text-align: center;
}

.story-cinema__slides {
	position: relative;
	min-height: 220px;
	color: #fff;
}

.story-chapter-slide {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transform: translateY(18px);
	padding-right: 0;
	will-change: opacity, transform, filter;
}

@media (min-width: 900px) {
	.story-chapter-slide { padding-right: 2rem; }
}

.story-chapter-slide.is-active {
	pointer-events: auto;
}

.story-chapter-slide__num {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	color: var(--coaras-brand-accent-sky);
	margin-bottom: 0.75rem;
}

.story-chapter-slide h2 {
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 3.2vw, 2.35rem);
	font-weight: 500;
	line-height: 1.38;
	margin: 0 0 1rem;
}

.story-chapter-slide p {
	margin: 0;
	font-size: clamp(0.95rem, 1.8vw, 1.0625rem);
	line-height: 1.9;
	opacity: 0.9;
	max-width: 32rem;
}

.story-cinema__progress {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: rgba(255, 255, 255, 0.12);
	z-index: 6;
}

.story-cinema__progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--coaras-brand-accent-sky), #fff);
	transform-origin: left;
}

/* ── Stone Style 寄り：大きな章番号 ── */
.story-cinema__stage-index {
	position: absolute;
	top: clamp(4rem, 10vh, 5.5rem);
	left: var(--pad);
	z-index: 6;
	display: flex;
	align-items: baseline;
	gap: 0.15em;
	font-family: var(--font-body);
	font-weight: 600;
	color: rgba(255, 255, 255, 0.92);
	pointer-events: none;
	line-height: 1;
}

.story-cinema__stage-current {
	font-size: clamp(2.5rem, 6vw, 4.5rem);
	letter-spacing: -0.04em;
}

.story-cinema__stage-sep,
.story-cinema__stage-total {
	font-size: clamp(0.85rem, 1.8vw, 1.1rem);
	opacity: 0.45;
	letter-spacing: 0.08em;
}

/* ── Lixus 寄り：右ナビ ── */
.story-cinema__nav {
	position: absolute;
	top: 50%;
	right: clamp(0.75rem, 2.5vw, 1.5rem);
	transform: translateY(-50%);
	z-index: 6;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.story-cinema__nav-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.5rem 0.35rem 0.35rem;
	border: none;
	background: transparent;
	color: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	text-align: left;
	font-family: var(--font-body);
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	transition: color 0.25s var(--ease-out);
}

.story-cinema__nav-item:hover,
.story-cinema__nav-item:focus-visible {
	color: rgba(255, 255, 255, 0.9);
}

.story-cinema__nav-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	border: 1px solid currentColor;
	flex-shrink: 0;
	transition: transform 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.story-cinema__nav-item.is-active {
	color: #fff;
}

.story-cinema__nav-item.is-active .story-cinema__nav-dot {
	background: var(--coaras-brand-accent-sky);
	border-color: var(--coaras-brand-accent-sky);
	transform: scale(1.35);
	box-shadow: 0 0 10px rgba(0, 163, 255, 0.65);
}

.story-cinema__nav-label {
	display: none;
}

@media (min-width: 900px) {
	.story-cinema__nav-label {
		display: inline;
		max-width: 5.5rem;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

/* ── 下部チャプターバー（今どこにいるか） ── */
.story-cinema__chapter-bar {
	position: absolute;
	left: var(--pad);
	right: calc(var(--pad) + 4rem);
	bottom: clamp(1.25rem, 4vh, 2rem);
	z-index: 6;
	pointer-events: none;
}

.story-cinema__chapter-eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	color: var(--coaras-brand-accent-sky);
}

.story-cinema__chapter-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(0.95rem, 2vw, 1.2rem);
	font-weight: 500;
	color: rgba(255, 255, 255, 0.88);
	max-width: 28rem;
	line-height: 1.45;
}

.story-char {
	display: inline-block;
	will-change: transform, opacity;
}

/* ── 体験終了 · About へ戻る ── */
.story-exit {
	position: relative;
	background: var(--coaras-brand-ice);
	color: var(--coaras-brand-dark);
	padding: clamp(3.5rem, 10vh, 5.5rem) var(--pad);
	text-align: center;
}

.story-exit__inner {
	max-width: 36rem;
	margin-inline: auto;
}

.story-exit__eyebrow {
	margin: 0 0 0.75rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.24em;
	color: var(--coaras-brand-blue);
}

.story-exit h2 {
	font-family: var(--font-display);
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 500;
	line-height: 1.35;
	margin: 0 0 1rem;
}

.story-exit__lead {
	margin: 0 0 2rem;
	font-size: var(--text-lead);
	color: rgba(12, 36, 68, 0.82);
	line-height: 1.85;
}

.story-exit__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
}

@media (min-width: 480px) {
	.story-exit__actions {
		flex-direction: row;
		justify-content: center;
		flex-wrap: wrap;
	}
}

.story-exit__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 52px;
	padding: 0.9rem 1.5rem;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	transition: transform 0.25s var(--ease-out), background 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.story-exit__btn--primary {
	background: var(--coaras-brand-blue);
	color: #fff;
	box-shadow: 0 12px 32px rgba(0, 20, 137, 0.22);
}

.story-exit__btn--primary:hover {
	background: var(--coaras-brand-blue-hover);
	transform: translateY(-2px);
	box-shadow: 0 16px 40px rgba(0, 20, 137, 0.28);
}

.story-exit__btn--secondary {
	background: #fff;
	color: var(--coaras-brand-blue);
	border: 1.5px solid rgba(0, 20, 137, 0.2);
}

.story-exit__btn--secondary:hover {
	border-color: var(--coaras-brand-blue);
	transform: translateY(-2px);
}

.story-exit__btn-icon {
	font-size: 1.1rem;
	line-height: 1;
}

/* ── Finale ── */
.story-finale {
	position: relative;
	background: var(--coaras-brand-ice);
	color: var(--coaras-brand-dark);
	padding: clamp(4rem, 12vh, 6rem) var(--pad);
}

.story-finale__inner {
	max-width: 52rem;
}

.story-finale__eyebrow {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	color: var(--coaras-brand-blue);
	margin-bottom: 0.75rem;
}

.story-finale h2 {
	font-family: var(--font-display);
	font-size: clamp(1.65rem, 3.8vw, 2.35rem);
	font-weight: 500;
	line-height: 1.4;
	margin: 0 0 1rem;
}

.story-finale__explain {
	font-size: var(--text-lead);
	color: rgba(12, 36, 68, 0.88);
	margin: 0 0 2.5rem;
	max-width: 40rem;
}

.story-finale__cards {
	display: grid;
	gap: 1.25rem;
}

@media (min-width: 768px) {
	.story-finale__cards { grid-template-columns: 1fr 1fr; }
}

.story-cta-card {
	background: #fff;
	border: 1px solid rgba(12, 36, 68, 0.1);
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 20px 48px rgba(12, 36, 68, 0.06);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.story-cta-card h3 {
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 500;
	margin: 0;
	line-height: 1.45;
}

.story-cta-card p {
	margin: 0;
	font-size: 0.9375rem;
	color: rgba(12, 36, 68, 0.78);
	flex: 1;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.85rem 1.25rem;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	transition: transform 0.25s var(--ease-out), background 0.25s var(--ease-out);
	margin-top: auto;
}

.btn-primary {
	background: var(--coaras-brand-blue);
	color: #fff;
	border: none;
}

.btn-primary:hover {
	background: var(--coaras-brand-blue-hover);
	transform: translateY(-2px);
}

.btn-secondary {
	background: transparent;
	color: var(--coaras-brand-blue);
	border: 1.5px solid var(--coaras-brand-blue);
}

.btn-secondary:hover {
	background: rgba(0, 20, 137, 0.05);
	transform: translateY(-2px);
}

.story-finale__note {
	margin-top: 1.5rem;
	font-size: 0.8125rem;
	color: rgba(12, 36, 68, 0.65);
}

.story-finale__note a {
	color: var(--coaras-brand-blue);
	font-weight: 600;
}

.site-footer {
	background: var(--coaras-brand-dark);
	color: var(--coaras-brand-white-warm);
	padding: 2.5rem var(--pad);
	font-size: 0.875rem;
}

.site-footer nav,
.coaras-footer-unified__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin-bottom: 1rem;
}

.coaras-footer-unified__contact { margin: 0 0 0.5rem; }
.coaras-footer-unified__copy { margin: 0; }

.site-footer a { color: rgba(255, 255, 255, 0.82); text-decoration: none; }
.site-footer a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
	.story-intro__hint { animation: none; }
	.story-intro__media img { animation: none; }
}

/* ══════════════════════════════════════════
   v2 enhancements
══════════════════════════════════════════ */

/* Ken Burns — intro video / image */
.story-intro__media {
	transform-origin: center center;
}

/* ── Scroll hint: より大きく ── */
.story-intro__hint {
	font-size: 0.8rem;
	letter-spacing: 0.25em;
}

/* ── Line-reveal wrappers（JS で動的に挿入） ── */
.story-reveal-outer {
	display: block;
	overflow: clip;
	line-height: inherit;
}
.story-reveal-inner {
	display: block;
	will-change: transform;
}

/* GSAP が opacity/transform を直接制御するため CSS transition は持たない */

/* ── Chapter number: アクセント下線 ── */
.story-chapter-slide__num {
	position: relative;
	display: inline-block;
	padding-bottom: 0.5rem;
}
.story-chapter-slide__num::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 2em;
	height: 1.5px;
	background: var(--coaras-brand-accent-sky);
	transform-origin: left;
	transform: scaleX(0);
	transition: transform 0.4s 0.1s var(--ease-out);
}
.story-chapter-slide.is-active .story-chapter-slide__num::after {
	transform: scaleX(1);
}

/* ── Progress bar: グロー ── */
.story-cinema__progress-bar {
	box-shadow: 0 0 8px rgba(0, 163, 255, 0.6);
}

/* ── Finale: カード hover 強化 ── */
.story-cta-card {
	transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.story-cta-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 28px 60px rgba(12, 36, 68, 0.13);
}

/* ══════════════════════════════════════════
   375px モバイル最適化
══════════════════════════════════════════ */
@media (max-width: 639px) {
	.story-cinema {
		height: 840vh;
	}
	.story-cinema__chapter-video.is-active {
		opacity: 0.45;
	}
	.story-cinema__stage-index {
		top: clamp(3.75rem, 9vh, 5rem);
	}
	.story-cinema__nav-num {
		display: none;
	}
	.story-cinema__chapter-bar {
		right: calc(var(--pad) + 2rem);
	}
	.story-cinema__grid {
		padding-top: clamp(3.5rem, 9vh, 5rem);
		gap: 1.25rem;
	}
	.story-cinema__kanji {
		font-size: clamp(4.5rem, 22vw, 7rem);
	}
	.story-chapter-slide h2 {
		font-size: clamp(1.25rem, 4.8vw, 1.65rem);
		line-height: 1.45;
	}
	.story-chapter-slide p {
		font-size: 0.9rem;
		line-height: 1.8;
	}
	.story-chapter-slide__num {
		font-size: 0.65rem;
	}
	.story-finale h2 {
		font-size: clamp(1.4rem, 5.5vw, 1.9rem);
	}
	.story-finale__cards {
		grid-template-columns: 1fr;
	}
}
