/* ==========================================================================
   ranoBlog main.css
   サイト全体の共通スタイル（色・文字・ボタン・ヘッダー・フッター・アニメーション）。
   デザインの正本は mockups/mock-a-nayami.html。色や角丸はここの変数を使うこと。
   ========================================================================== */

/* ---------- 1. デザイントークン ---------- */
:root {
	--bg: #F6F9F8;
	--surface: #FFFFFF;
	--tint: #EEF5F3;
	--ink: #122128;
	--ink-2: #33434A;
	--muted: #5E6E74;
	--line: #DFE7E5;
	--accent: #0C7366;
	--accent-2: #0A5C52;
	--accent-ink: #FFFFFF;
	--accent-soft: #E1F1ED;
	--mark: #F2BE45;
	--coral: #E77A60;
	--sky: #5B9BD5;
	--on-dark: #EAF2F0;
	--on-dark-muted: #A9BDB9;
	--dark: #0F1D22;
	--dark-2: #16282E;

	--f-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
	--f-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
	--f-num: "Inter", "Helvetica Neue", Arial, sans-serif;

	--r-sm: 10px;
	--r: 16px;
	--r-lg: 24px;
	--sh-1: 0 1px 2px rgba(18, 33, 40, .04), 0 4px 12px rgba(18, 33, 40, .04);
	--sh-2: 0 2px 4px rgba(18, 33, 40, .04), 0 16px 40px rgba(18, 33, 40, .08);
	--ease: cubic-bezier(.2, .7, .2, 1);

	--wrap: 1120px;
	--gutter: 20px;
	--header-h: 72px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0E171A;
		--surface: #152227;
		--tint: #122025;
		--ink: #E7EFED;
		--ink-2: #C6D3D0;
		--muted: #97AAA6;
		--line: #243539;
		--accent: #3EC3AF;
		--accent-2: #5BD3C0;
		--accent-ink: #05201B;
		--accent-soft: #163430;
		--mark: #E8B84A;
		--coral: #EA8B73;
		--sky: #82B4E4;
		--dark: #0A1316;
		--dark-2: #112127;
		--sh-1: 0 1px 2px rgba(0, 0, 0, .3);
		--sh-2: 0 16px 40px rgba(0, 0, 0, .35);
		color-scheme: dark;
	}
}

/* ---------- 2. ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 12px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 1.9;
	letter-spacing: .03em;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "palt" 1;
}

p { margin: 0; }
img, video { display: block; max-width: 100%; height: auto; }
/* svg に height:auto を付けると <use> で呼んだ歯車などが消えるため、幅を変えるsvgだけ個別に height:auto を指定する */
svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; }

:focus-visible {
	outline: 3px solid var(--mark);
	outline-offset: 3px;
	border-radius: 4px;
}

h1, h2, h3, h4 {
	margin: 0;
	font-family: var(--f-display);
	line-height: 1.45;
	letter-spacing: .04em;
	text-wrap: balance;
	word-break: auto-phrase; /* 日本語を文節で改行する（対応ブラウザのみ） */
	font-feature-settings: "palt" 1;
}
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 900; }
h3 { font-weight: 700; }

.wrap {
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip {
	position: absolute;
	left: 12px;
	top: -60px;
	z-index: 100;
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--ink);
	color: var(--bg);
	text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- 3. セクション見出し ---------- */
.section { padding-block: 112px; }
.section--tint { background: var(--tint); }

.sec-head {
	display: grid;
	gap: 14px;
	max-width: 44em;
	margin-bottom: 48px;
}
.sec-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.sec-head__lead { color: var(--muted); font-size: 1.02rem; }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--accent);
	font-family: var(--f-num);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
}
.eyebrow::before {
	content: "";
	width: 24px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
}

/* ---------- 4. ボタン ---------- */
.btn {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 28px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font-family: var(--f-body);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-decoration: none;
	cursor: pointer;
	transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s, border-color .25s;
}
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }

.btn--primary {
	background: var(--accent);
	color: var(--accent-ink);
	box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn--primary:hover {
	background: var(--accent-2);
	transform: translateY(-2px);
	box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 34%, transparent);
}
.btn--primary::after {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 40%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
	animation: rb-shine 4.5s ease-in-out infinite;
}
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--mark { background: var(--mark); color: #122128; }
.btn--mark:hover { transform: translateY(-2px); }
.btn--outline-light { background: transparent; color: var(--on-dark); border-color: color-mix(in srgb, #fff 25%, transparent); }
.btn--outline-light:hover { border-color: var(--mark); color: var(--mark); transform: translateY(-2px); }
.btn--sm { min-height: 42px; padding: 0 20px; font-size: .88rem; }
.btn--block { width: 100%; }

.text-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .9rem;
	font-weight: 700;
	text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* ---------- 5. ヘッダー ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .3s, box-shadow .3s;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--sh-1); }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: var(--header-h);
}

.logo {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--ink);
	line-height: 1.25;
	text-decoration: none;
}
.logo-mark { flex: none; }
.logo-img { width: auto; max-height: 40px; }
.logo-text b { display: block; font-family: var(--f-num); font-size: 1.2rem; letter-spacing: .01em; }
.logo-text small { display: block; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; }

.gnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.gnav__list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.gnav__list a {
	display: block;
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--ink-2);
	font-size: .9rem;
	font-weight: 700;
	text-decoration: none;
	transition: background .2s, color .2s;
}
.gnav__list a:hover,
.gnav__list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.gnav__cta { margin-left: 8px; }

.menu-btn {
	display: none;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-left: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	cursor: pointer;
}
.menu-btn__bar,
.menu-btn__bar::before,
.menu-btn__bar::after {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: var(--ink);
	transition: transform .3s, top .3s, background .3s;
}
.menu-btn__bar { position: relative; }
.menu-btn__bar::before,
.menu-btn__bar::after { content: ""; position: absolute; left: 0; }
.menu-btn__bar::before { top: -6px; }
.menu-btn__bar::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-btn__bar { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-btn__bar::before { top: 0; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bar::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 1000px) {
	.menu-btn { display: grid; }
	.gnav {
		position: fixed;
		inset: var(--header-h) 0 auto 0;
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		margin: 0;
		padding: 16px var(--gutter) 24px;
		background: var(--surface);
		border-bottom: 1px solid var(--line);
		box-shadow: var(--sh-2);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity .25s, transform .25s, visibility .25s;
	}
	.admin-bar .gnav { top: calc(var(--header-h) + 46px); }
	.gnav.is-open { opacity: 1; visibility: visible; transform: none; }
	.gnav__list { flex-direction: column; }
	.gnav__list a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
	.gnav__cta { margin: 8px 0 0; }
}

/* ---------- 6. フッター ---------- */
.site-footer {
	padding-block: 72px 32px;
	background: var(--dark);
	color: var(--on-dark-muted);
	font-size: .88rem;
}
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.site-footer__brand .logo { color: var(--on-dark); }
.site-footer__brand .logo-text small { color: var(--on-dark-muted); }
.site-footer__brand p { max-width: 24em; margin: 16px 0 20px; line-height: 1.8; }
.site-footer__heading {
	margin-bottom: 14px;
	color: var(--on-dark);
	font-family: var(--f-num);
	font-size: .8rem;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.site-footer__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-footer__list a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer__list a:hover { color: var(--on-dark); text-decoration: underline; }
.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid color-mix(in srgb, #fff 10%, transparent);
	font-size: .78rem;
}

@media (max-width: 1000px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
	.site-footer__grid { grid-template-columns: 1fr; }
	.site-footer { padding-bottom: 110px; }
}

/* ---------- 7. スマホ下部の固定ボタン・トップへ戻る ---------- */
.m-cta { display: none; }
@media (max-width: 640px) {
	.m-cta {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 45;
		display: flex;
		gap: 10px;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
		background: color-mix(in srgb, var(--surface) 94%, transparent);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-top: 1px solid var(--line);
	}
	.m-cta .btn { flex: 1; min-height: 48px; padding: 0 12px; font-size: .9rem; }
}

.to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 40;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--surface);
	box-shadow: var(--sh-2);
	color: var(--ink);
	opacity: 0;
	pointer-events: none;
	transform: translateY(10px);
	transition: opacity .3s, transform .3s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
@media (max-width: 640px) { .to-top { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- 8. アニメーション ---------- */
@keyframes rb-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes rb-floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes rb-spin { to { transform: rotate(360deg); } }
@keyframes rb-grow { 0%, 15% { transform: scaleY(.25); } 60%, 100% { transform: scaleY(1); } }
@keyframes rb-draw { from { background-size: 0 36%; } to { background-size: 100% 36%; } }
@keyframes rb-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes rb-shine { 0% { transform: translateX(-120%) skewX(-20deg); } 60%, 100% { transform: translateX(220%) skewX(-20deg); } }
@keyframes rb-dash { to { stroke-dashoffset: -180; } }

.rise { animation: rb-rise .8s var(--ease) both; }
.d1 { animation-delay: .08s; }
.d2 { animation-delay: .18s; }
.d3 { animation-delay: .28s; }
.d4 { animation-delay: .38s; }
.floaty { animation: rb-floaty 6s ease-in-out infinite; }
/* .spin は <use> ではなく、それを包む <g> に付ける（<use> に付けると回転の中心がずれる） */
.spin { transform-box: fill-box; transform-origin: center; animation: rb-spin 10s linear infinite; }
.spin--rev { animation-direction: reverse; animation-duration: 7s; }
.grow { transform-box: fill-box; transform-origin: bottom; animation: rb-grow 3.4s ease-in-out infinite alternate; }
.blink { animation: rb-blink 1.8s ease-in-out infinite; }

/* スクロールで表示（対応ブラウザのみ。非対応でも最初から表示される） */
@supports (animation-timeline: view()) {
	.reveal { animation: rb-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}

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

/* ---------- 9. 共通の部品（タグ・チェックリスト・記事カード） ---------- */
.tag {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1.5;
}

.checks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; }
.checks li::before {
	content: "";
	width: 18px;
	height: 18px;
	margin-top: 6px;
	border-radius: 50%;
	background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.5L13 6.5' stroke='%230C7366' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-color-scheme: dark) {
	.checks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.5L13 6.5' stroke='%233EC3AF' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}

.tab {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink-2);
	font-size: .85rem;
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab[aria-pressed="true"],
.tab[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
	display: grid;
	align-content: start;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--surface);
	box-shadow: var(--sh-1);
	color: var(--ink);
	text-decoration: none;
	transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.post-card[hidden] { display: none; }
.post-card:hover { transform: translateY(-6px); box-shadow: var(--sh-2); }
.post-card:hover .post-card__title { color: var(--accent); }
.post-card__thumb {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}
.post-card__thumb svg { width: 34%; height: auto; transition: transform .5s var(--ease); }
.post-card:hover .post-card__thumb svg { transform: scale(1.1) rotate(-3deg); }
.post-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ease);
}
.post-card:hover .post-card__img { transform: scale(1.04); }
.post-card__thumb--sys { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--accent-soft)); }
.post-card__thumb--wp { background: linear-gradient(150deg, color-mix(in srgb, var(--sky) 28%, var(--surface)), color-mix(in srgb, var(--sky) 10%, var(--surface))); }
.post-card__thumb--seo { background: linear-gradient(150deg, color-mix(in srgb, var(--mark) 34%, var(--surface)), color-mix(in srgb, var(--mark) 12%, var(--surface))); }
.post-card__thumb--steel,
.post-card__thumb--default { background: linear-gradient(150deg, color-mix(in srgb, var(--muted) 26%, var(--surface)), color-mix(in srgb, var(--muted) 10%, var(--surface))); }
.post-card__thumb--ai { background: linear-gradient(150deg, color-mix(in srgb, var(--coral) 28%, var(--surface)), color-mix(in srgb, var(--coral) 10%, var(--surface))); }
.post-card__body { display: grid; gap: 10px; padding: 20px 22px 24px; }
.post-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; }
.post-card__cat { color: var(--accent); font-weight: 700; }
.post-card__meta time { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.post-card__title { font-size: 1rem; line-height: 1.7; transition: color .2s; }

@media (max-width: 1000px) { .posts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
	.section { padding-block: 80px; }
	.posts { grid-template-columns: 1fr; }
}

