/* =========================================================
   Karotter Login – 共通スタイルシート
   既定はダークブルー、[data-theme="light"] でライトモード
   ========================================================= */

:root {
	--bg: #0A1428;
	--bg-alt: #101D38;
	--bg-elevated: #16243F;
	--ink: #EFF3FA;
	--ink-soft: #A9B7CE;
	--line: rgba(239, 243, 250, 0.10);
	--line-strong: rgba(239, 243, 250, 0.18);
	--orange: #FF7A33;
	--orange-strong: #FF9257;
	--green: #4FD1A5;
	--code-bg: #060B16;
	--code-text: #DCE6F5;
	--shadow: 0 18px 40px rgba(3, 8, 20, 0.45);

	--radius-s: 8px;
	--radius-m: 14px;
	--radius-l: 22px;
	--max: 1120px;

	--font-display: "Space Grotesk", "Hiragino Sans", sans-serif;
	--font-body: "Inter", "Hiragino Sans", "Yu Gothic", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, monospace;

	color-scheme: dark;
}

html[data-theme="light"] {
	--bg: #F5F7FC;
	--bg-alt: #E9EEF7;
	--bg-elevated: #FFFFFF;
	--ink: #0E1730;
	--ink-soft: #51607A;
	--line: #DDE4F0;
	--line-strong: #C7D1E4;
	--orange: #E85A00;
	--orange-strong: #C94C00;
	--green: #167A56;
	--code-bg: #0E1730;
	--code-text: #EAF0FB;
	--shadow: 0 18px 40px rgba(20, 30, 60, 0.10);
	color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	transition: background 0.25s ease, color 0.25s ease;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ink);
	color: var(--bg);
	padding: 10px 16px;
	z-index: 200;
	border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 12px; top: 0; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.eyebrow {
	font-family: var(--font-mono);
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--orange);
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
	letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p { color: var(--ink-soft); margin: 0; }
strong { color: var(--ink); }

code {
	font-family: var(--font-mono);
	background: var(--bg-alt);
	border: 1px solid var(--line);
	border-radius: 5px;
	padding: 2px 7px;
	font-size: 0.88em;
	color: var(--orange-strong);
}

/* ---------- Header ---------- */
header.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.nav-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	position: relative;
}
.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.05rem;
	text-decoration: none;
}
.logo img {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	flex-shrink: 0;
}
nav.main-nav ul {
	list-style: none;
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
}
nav.main-nav a {
	text-decoration: none;
	font-size: 0.92rem;
	color: var(--ink-soft);
	font-weight: 500;
	transition: color 0.15s ease;
}
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
	background: var(--bg-alt);
	color: var(--ink-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 0.95rem;
	transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { color: var(--orange); border-color: var(--orange); }
.theme-toggle .fa-sun { display: none; }
html[data-theme="light"] .theme-toggle .fa-sun { display: block; }
html[data-theme="light"] .theme-toggle .fa-moon { display: none; }
.theme-toggle:active { transform: rotate(20deg); }

.nav-toggle-label {
	display: none;
	cursor: pointer;
	font-size: 1.3rem;
	padding: 4px 8px;
	color: var(--ink);
}
#nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 0.95rem;
	padding: 12px 22px;
	border-radius: 999px;
	text-decoration: none;
	border: 1.5px solid transparent;
	transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--orange); color: #0A0E18; }
.btn-primary:hover { background: var(--orange-strong); box-shadow: 0 10px 26px rgba(255, 122, 51, 0.25); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- Reveal-on-scroll (ほどよいアニメーション) ---------- */
.reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-group .reveal:nth-child(1) { transition-delay: 0.02s; }
.reveal-group .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-group .reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal-group .reveal:nth-child(4) { transition-delay: 0.20s; }
.reveal-group .reveal:nth-child(5) { transition-delay: 0.26s; }
.reveal-group .reveal:nth-child(6) { transition-delay: 0.32s; }

@keyframes fade-up {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}
.hero-anim > * { animation: fade-up 0.7s ease both; }
.hero-anim > *:nth-child(1) { animation-delay: 0.02s; }
.hero-anim > *:nth-child(2) { animation-delay: 0.1s; }
.hero-anim > *:nth-child(3) { animation-delay: 0.18s; }
.hero-anim > *:nth-child(4) { animation-delay: 0.26s; }
.hero-anim > *:nth-child(5) { animation-delay: 0.34s; }

/* ---------- Hero ---------- */
.hero { padding: 76px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.hero h1 { margin: 18px 0 20px; }
.hero .lede { font-size: 1.08rem; max-width: 46ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	padding: 6px 13px;
	color: var(--ink-soft);
}
.badge i { color: var(--green); font-size: 0.85em; }

/* ---------- Signature: connection diagram ---------- */
.flow-card {
	background: var(--bg-elevated);
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	padding: 34px 28px 28px;
	box-shadow: var(--shadow);
}
.flow-nodes { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 0 0 auto; }
.flow-node .icon-box {
	width: 64px; height: 64px; border-radius: 18px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.5rem; color: #0A0E18;
	transition: transform 0.3s ease;
}
.flow-card:hover .icon-box { transform: translateY(-3px); }
.flow-node.site .icon-box { background: var(--ink-soft); color: var(--bg); }
.flow-node.karotter .icon-box { background: var(--orange); }
.flow-node span { font-size: 0.82rem; font-family: var(--font-mono); color: var(--ink-soft); }

.flow-line {
	flex: 1 1 auto; height: 2px;
	background-image: repeating-linear-gradient(to right, var(--ink-soft) 0 8px, transparent 8px 16px);
	background-size: 32px 2px;
	position: relative; margin: 0 6px;
	animation: dash-move 1.6s linear infinite;
}
@keyframes dash-move { to { background-position: 32px 0; } }
.flow-line i {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
	background: var(--bg-elevated); padding: 0 6px; color: var(--orange); font-size: 0.95rem;
}

.flow-steps {
	list-style: none; display: grid; grid-template-columns: repeat(4, 1fr);
	gap: 14px; margin: 30px 0 0; padding: 0; counter-reset: step;
}
.flow-steps li { counter-increment: step; font-size: 0.78rem; color: var(--ink-soft); border-top: 2px solid var(--line); padding-top: 10px; }
.flow-steps li::before {
	content: counter(step, decimal-leading-zero); display: block;
	font-family: var(--font-mono); color: var(--orange); font-size: 0.75rem; margin-bottom: 4px;
}

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { max-width: 62ch; margin-bottom: 48px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head p { margin-top: 14px; font-size: 1.02rem; }
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Features grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
	border: 1px solid var(--line);
	border-radius: var(--radius-m);
	padding: 26px 24px;
	background: var(--bg-elevated);
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.feature-card .icon {
	width: 42px; height: 42px; border-radius: 12px;
	background: var(--bg-alt); color: var(--orange);
	display: flex; align-items: center; justify-content: center;
	font-size: 1.05rem; margin-bottom: 16px;
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { font-size: 0.93rem; }

/* ---------- How it works / steps ---------- */
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps-list li { display: grid; grid-template-columns: 64px 1fr; gap: 22px; padding: 26px 0; border-top: 1px solid var(--line); }
.steps-list li:last-child { border-bottom: 1px solid var(--line); }
.step-num { font-family: var(--font-mono); font-size: 0.95rem; color: var(--orange); }
.steps-list h3 { margin-bottom: 6px; }
.steps-list p { font-size: 0.95rem; }

/* ---------- Code ---------- */
.code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.code-panel { background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); }
.code-panel .code-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
	font-family: var(--font-mono); font-size: 0.78rem; color: rgba(220,230,245,0.55);
}
.copy-btn {
	background: transparent; border: 1px solid rgba(220,230,245,0.25);
	color: rgba(220,230,245,0.85); border-radius: 6px;
	font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 10px; cursor: pointer;
	transition: border-color 0.15s ease;
}
.copy-btn:hover { border-color: var(--orange); }
.code-panel pre { margin: 0; padding: 18px 16px 22px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.65; }
.tok-tag { color: #8FBF8A; }
.tok-str { color: #FFB27A; }
.tok-com { color: rgba(220,230,245,0.4); }
.tok-fn { color: #7DC4E0; }

/* ---------- Setup ---------- */
.setup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.setup-card {
	border: 1px solid var(--line); border-radius: var(--radius-m);
	padding: 22px 18px; background: var(--bg-alt);
	transition: transform 0.25s ease;
}
.setup-card:hover { transform: translateY(-3px); }
.setup-card .step-num { display: block; margin-bottom: 10px; }
.setup-card h3 { font-size: 0.98rem; margin-bottom: 6px; }
.setup-card p { font-size: 0.86rem; }
.setup-note { margin-top: 26px; font-size: 0.9rem; display: flex; align-items: flex-start; gap: 10px; }
.setup-note i { color: var(--green); margin-top: 3px; }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details.faq-item { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 4px 20px; background: var(--bg-elevated); }
details.faq-item summary {
	cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary .chev { transition: transform 0.2s ease; color: var(--orange); flex-shrink: 0; }
details.faq-item[open] summary .chev { transform: rotate(45deg); }
details.faq-item .faq-answer { padding: 0 0 18px; font-size: 0.93rem; }

/* ---------- CTA band ---------- */
.cta-band {
	background: var(--bg-elevated);
	border: 1px solid var(--line-strong);
	color: var(--ink);
	border-radius: var(--radius-l);
	padding: 56px 48px;
	display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
	position: relative; overflow: hidden;
}
.cta-band::before {
	content: "";
	position: absolute; inset: 0;
	background: radial-gradient(600px 300px at 90% 0%, color-mix(in srgb, var(--orange) 18%, transparent), transparent 70%);
	pointer-events: none;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { max-width: 44ch; }

/* ---------- Article (docs / about / blog shared) ---------- */
.article-hero { padding: 64px 0 20px; }
.article-body { max-width: 72ch; }
.article-body h2 { margin-top: 52px; margin-bottom: 16px; }
.article-body h3 { margin-top: 30px; margin-bottom: 10px; }
.article-body p { margin-top: 14px; font-size: 1rem; }
.article-body ul, .article-body ol { color: var(--ink-soft); font-size: 1rem; padding-left: 22px; }
.article-body li { margin-top: 8px; }
.article-meta {
	display: flex; align-items: center; gap: 14px;
	font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft);
	margin-bottom: 18px;
}
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-soft); }

.callout {
	border: 1px solid var(--line-strong);
	background: var(--bg-elevated);
	border-radius: var(--radius-m);
	padding: 22px 24px;
	margin: 30px 0;
	display: flex;
	gap: 14px;
}
.callout i { color: var(--orange); font-size: 1.1rem; margin-top: 2px; }
.callout p { font-size: 0.94rem; }
.callout strong { display: block; margin-bottom: 4px; }

.mockup-window {
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-m);
	background: var(--bg-elevated);
	overflow: hidden;
	margin: 24px 0;
	box-shadow: var(--shadow);
}
.mockup-titlebar {
	display: flex; align-items: center; gap: 8px;
	padding: 12px 16px; border-bottom: 1px solid var(--line);
	font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-soft);
}
.mockup-titlebar .dot-group { display: flex; gap: 6px; }
.mockup-titlebar .dot-group span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.mockup-body { padding: 22px 20px; }
.mockup-field {
	display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
}
.mockup-field label { font-size: 0.78rem; font-family: var(--font-mono); color: var(--ink-soft); }
.mockup-field .mockup-input {
	border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px;
	font-size: 0.88rem; color: var(--ink); background: var(--bg-alt);
}
.mockup-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--orange); color: #0A0E18; border-radius: 999px;
	padding: 9px 18px; font-size: 0.85rem; font-weight: 600; margin-top: 4px;
}

.step-cards { display: flex; flex-direction: column; gap: 16px; margin: 26px 0; }
.step-card {
	display: grid; grid-template-columns: 46px 1fr; gap: 18px;
	border: 1px solid var(--line); border-radius: var(--radius-m);
	padding: 20px 22px; background: var(--bg-elevated);
}
.step-card .step-circle {
	width: 34px; height: 34px; border-radius: 50%;
	background: var(--orange); color: #0A0E18;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem;
}
.step-card h3 { margin-bottom: 6px; }
.step-card p { font-size: 0.94rem; }

.author-card {
	display: flex; align-items: center; gap: 16px;
	border: 1px solid var(--line); border-radius: var(--radius-m);
	padding: 20px 22px; background: var(--bg-elevated); margin-top: 44px;
}
.author-card .avatar {
	width: 48px; height: 48px; border-radius: 50%;
	background: var(--orange); color: #0A0E18;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-family: var(--font-display); flex-shrink: 0;
}
.author-card p { font-size: 0.88rem; }

.about-grid {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin: 30px 0;
}
.about-card {
	border: 1px solid var(--line); border-radius: var(--radius-m);
	padding: 24px; background: var(--bg-elevated);
}
.about-card h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.about-card h3 i { color: var(--orange); }
.about-card p { font-size: 0.93rem; }

/* ---------- Footer ---------- */
footer.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; margin-bottom: 36px; }
.footer-grid h4 {
	font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
	color: var(--ink-soft); margin: 0 0 14px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-grid a { text-decoration: none; font-size: 0.9rem; color: var(--ink-soft); transition: color 0.15s ease; }
.footer-grid a:hover { color: var(--ink); }
.footer-bottom {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
	padding-top: 26px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-soft);
}
.disclaimer { font-size: 0.78rem; color: var(--ink-soft); max-width: 70ch; margin-bottom: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.hero-grid { grid-template-columns: 1fr; }
	.feature-grid { grid-template-columns: repeat(2, 1fr); }
	.code-grid { grid-template-columns: 1fr; }
	.setup-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
	nav.main-nav { display: none; }
	.nav-toggle-label { display: block; }
	#nav-toggle:checked ~ .nav-row nav.main-nav {
		display: flex; position: absolute; top: 100%; left: 0; right: 0;
		background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 24px 20px;
	}
	#nav-toggle:checked ~ .nav-row nav.main-nav ul { flex-direction: column; gap: 16px; }
	.flow-steps { grid-template-columns: repeat(2, 1fr); }
	.feature-grid { grid-template-columns: 1fr; }
	.setup-grid { grid-template-columns: 1fr; }
	.steps-list li { grid-template-columns: 1fr; gap: 6px; }
	.cta-band { padding: 40px 26px; }
	.footer-grid { grid-template-columns: 1fr; }
	.step-card { grid-template-columns: 1fr; }
}
