:root {
	--bg: #070b14;
	--bg-elevated: #0f1626;
	--bg-card: rgba(18, 28, 48, 0.82);
	--border: rgba(148, 163, 184, 0.16);
	--border-strong: rgba(99, 102, 241, 0.45);
	--text: #e8eefc;
	--muted: #93a4bd;
	--accent: #6366f1;
	--accent-2: #22d3ee;
	--success: #34d399;
	--danger: #f87171;
	--warning: #fbbf24;
	--radius: 18px;
	--radius-sm: 12px;
	--shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
	--font: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
	--header-h: 64px;
	--overlay-bg: rgba(7, 11, 20, 0.55);
	--header-bg: rgba(7, 11, 20, 0.78);
	--chip-text: #c7d2fe;
	--link-hover: #67e8f9;
	--note-text: #fde68a;
	--flash-error-text: #fecaca;
	--status-not-started: #cbd5e1;
	--status-in-progress: #67e8f9;
	--status-in-progress-bg: rgba(34, 211, 238, 0.12);
	--status-done: #6ee7b7;
	--status-done-bg: rgba(52, 211, 153, 0.12);
	color-scheme: dark;
}

:root[data-theme="light"] {
	--bg: #f4f6fb;
	--bg-elevated: #ffffff;
	--bg-card: rgba(255, 255, 255, 0.92);
	--border: rgba(30, 41, 59, 0.12);
	--border-strong: rgba(99, 102, 241, 0.45);
	--text: #1a2233;
	--muted: #5b6b85;
	--shadow: 0 18px 40px rgba(30, 41, 59, 0.12);
	--overlay-bg: rgba(255, 255, 255, 0.75);
	--header-bg: rgba(255, 255, 255, 0.78);
	--chip-text: #4338ca;
	--link-hover: #0e7490;
	--note-text: #92400e;
	--flash-error-text: #b91c1c;
	--status-not-started: #64748b;
	--status-in-progress: #0e7490;
	--status-in-progress-bg: rgba(8, 145, 178, 0.10);
	--status-done: #047857;
	--status-done-bg: rgba(5, 150, 105, 0.10);
	color-scheme: light;
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	line-height: 1.65;
}

body {
	position: relative;
	overflow-x: hidden;
}

.bg-orb {
	position: fixed;
	border-radius: 50%;
	filter: blur(60px);
	pointer-events: none;
	z-index: 0;
	opacity: 0.55;
}

.bg-orb-a {
	width: 420px;
	height: 420px;
	top: -120px;
	left: -80px;
	background: rgba(99, 102, 241, 0.35);
}

.bg-orb-b {
	width: 380px;
	height: 380px;
	top: 20%;
	right: -120px;
	background: rgba(34, 211, 238, 0.18);
}

a {
	color: var(--accent-2);
	text-decoration: none;
	transition: color 0.15s ease;
}

a:hover {
	color: var(--link-hover);
	text-decoration: underline;
}

.container {
	width: min(1120px, calc(100% - 2rem));
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	background: var(--header-bg);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--header-h);
	padding: 0.65rem 0;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--text);
	text-decoration: none;
}

.brand:hover {
	text-decoration: none;
	color: var(--text);
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	color: var(--accent-2);
	background: linear-gradient(145deg, rgba(34, 211, 238, 0.16), rgba(99, 102, 241, 0.18));
	border: 1px solid rgba(34, 211, 238, 0.28);
	box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

.brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.brand-title {
	font-weight: 800;
	letter-spacing: 0.02em;
}

.brand-sub {
	font-size: 0.72rem;
	color: var(--muted);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.55rem;
	align-items: center;
}

.nav a {
	color: var(--muted);
	font-size: 0.92rem;
	font-weight: 600;
	padding: 0.4rem 0.7rem;
	border-radius: 999px;
	text-decoration: none;
}

.nav a:hover {
	color: var(--text);
	background: rgba(148, 163, 184, 0.08);
	text-decoration: none;
}

.nav a.is-active {
	color: var(--text);
	background: rgba(99, 102, 241, 0.18);
	box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.nav-external {
	border: 1px solid var(--border) !important;
	margin-left: 0.25rem;
}

#theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-left: 0.25rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease;
}

#theme-toggle:hover {
	color: var(--text);
	background: rgba(148, 163, 184, 0.08);
}

#theme-toggle .icon-moon {
	display: none;
}

:root[data-theme="light"] #theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="light"] #theme-toggle .icon-moon {
	display: block;
}

/* Main / footer */
.main {
	padding: 2rem 0 3.5rem;
	min-height: calc(100vh - 180px);
}

.site-footer {
	border-top: 1px solid var(--border);
	padding: 1.75rem 0 2.5rem;
	color: var(--muted);
	font-size: 0.9rem;
	position: relative;
	z-index: 1;
}

.footer-inner {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
	align-items: flex-start;
}

.footer-brand {
	margin: 0 0 0.25rem;
	color: var(--text);
	font-weight: 700;
}

.footer-links {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	align-items: flex-end;
}

/* Typography */
.hero, .page-head {
	margin-bottom: 1.6rem;
}

.eyebrow {
	color: var(--accent-2);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.75rem;
	font-weight: 800;
	margin: 0 0 0.45rem;
}

h1, h2, h3 {
	line-height: 1.25;
	margin: 0 0 0.55rem;
	letter-spacing: -0.01em;
}

h1 {
	font-size: clamp(1.85rem, 3.2vw, 2.55rem);
	font-weight: 800;
}

h2 {
	font-size: 1.25rem;
}

.h-quiet {
	font-size: 1rem;
	color: var(--muted);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.lede {
	color: var(--muted);
	max-width: 48rem;
	margin: 0;
}

.lede.tight {
	font-size: 0.95rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Cards */
.card {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
		var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	backdrop-filter: blur(8px);
}

.card-body {
	padding: 1.15rem 1.25rem 1.3rem;
}

.card-accent {
	height: 4px;
	background: var(--accent);
}

.card-accent.tall {
	height: 6px;
}

/* Dashboard */
.dashboard-top {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.ring-layout {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 1.25rem;
	align-items: center;
}

.ring-wrap {
	position: relative;
	width: 180px;
	height: 180px;
	margin: 0 auto;
}

.ring-wrap canvas {
	width: 180px !important;
	height: 180px !important;
}

.ring-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.ring-center-value {
	font-size: 1.7rem;
	font-weight: 800;
	line-height: 1;
}

.ring-center-label {
	font-size: 0.75rem;
	color: var(--muted);
	margin-top: 0.25rem;
	font-weight: 600;
}

.mini-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.6rem;
	margin-top: 1rem;
}

.mini-stats > div {
	background: rgba(148, 163, 184, 0.08);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0.65rem 0.7rem;
	text-align: center;
}

.mini-num {
	display: block;
	font-size: 1.25rem;
	font-weight: 800;
}

.mini-label {
	font-size: 0.75rem;
	color: var(--muted);
}

.chart-wrap {
	max-width: 260px;
	margin: 0.5rem auto 0;
}

.chart-caption {
	text-align: center;
	margin: 0.75rem 0 0;
}

/* Section */
.block {
	margin: 1.85rem 0;
}

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.85rem;
}

.section-head.tight {
	margin-bottom: 0.65rem;
}

.section-head h2 {
	margin: 0;
}

.chip {
	display: inline-flex;
	align-items: center;
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--chip-text);
	background: rgba(99, 102, 241, 0.18);
	border: 1px solid rgba(99, 102, 241, 0.28);
	text-transform: uppercase;
}

/* Highlight / next skill */
.highlight-body {
	display: grid;
	grid-template-columns: 1.5fr auto;
	gap: 1.25rem;
	align-items: end;
}

.highlight-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.75rem;
	text-align: right;
}

.highlight-card h3 {
	font-size: 1.4rem;
}

/* Category */
.grid {
	display: grid;
	gap: 1rem;
}

.category-grid,
.skill-grid {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.category-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.7rem;
}

.category-top h3 {
	margin: 0;
	font-size: 1rem;
}

.progress-bar {
	height: 8px;
	background: rgba(148, 163, 184, 0.14);
	border-radius: 999px;
	overflow: hidden;
}

.progress-bar.thick {
	height: 10px;
}

.progress-bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	box-shadow: 0 0 16px rgba(34, 211, 238, 0.35);
	transition: width 0.4s ease;
}

/* Skill cards */
.skill-card {
	position: relative;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.skill-card:hover {
	transform: translateY(-3px);
	border-color: var(--border-strong);
	box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.skill-card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.skill-card-link:hover {
	text-decoration: none;
	color: inherit;
}

.skill-card h2 {
	font-size: 1.12rem;
}

.skill-card p {
	color: var(--muted);
	font-size: 0.93rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 0.85rem;
}

.favorite-form {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 2;
	margin: 0;
}

.favorite-toggle {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--overlay-bg);
	color: var(--muted);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.favorite-toggle:hover {
	transform: scale(1.08);
	border-color: var(--warning);
}

.favorite-toggle.is-favorite {
	color: var(--warning);
	border-color: var(--warning);
}

.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0 0 0.85rem;
}

.tag-chip {
	display: inline-block;
	padding: 0.12rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	color: var(--muted);
	font-size: 0.78rem;
}

.card-link {
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--accent-2);
}

.card-meta {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.65rem;
}

/* お気に入り星ボタン（右上絶対配置）とステータスバッジの重なりを避ける */
.skill-card .card-meta,
.detail-card .card-meta {
	padding-right: 2.4rem;
}

.badge {
	display: inline-block;
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
	background: rgba(99, 102, 241, 0.16);
	color: var(--chip-text);
	font-size: 0.75rem;
	font-weight: 700;
}

.status {
	font-size: 0.75rem;
	font-weight: 800;
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.14);
	white-space: nowrap;
}

.status-NOT_STARTED { color: var(--status-not-started); }
.status-IN_PROGRESS {
	color: var(--status-in-progress);
	background: var(--status-in-progress-bg);
}
.status-DONE {
	color: var(--status-done);
	background: var(--status-done-bg);
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.68rem 1.15rem;
	border-radius: 999px;
	border: none;
	background: linear-gradient(135deg, #818cf8, #4f46e5);
	color: white;
	font-weight: 800;
	font-size: 0.92rem;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35);
	transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
	text-decoration: none;
	color: white;
}

.btn-secondary {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text);
	box-shadow: none;
}

.btn-secondary:hover {
	border-color: rgba(148, 163, 184, 0.4);
	color: var(--text);
	background: rgba(148, 163, 184, 0.06);
}

.btn-ghost {
	background: transparent;
	border: none;
	color: var(--muted);
	box-shadow: none;
	padding-left: 0.85rem;
	padding-right: 0.85rem;
}

.btn-ghost:hover {
	color: var(--text);
	background: rgba(148, 163, 184, 0.08);
}

/* Filter */
.filter-card {
	padding: 1rem 1.15rem 0.85rem;
	margin-bottom: 1.25rem;
}

.filter-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.75rem;
	align-items: end;
}

.filter-actions {
	display: flex;
	gap: 0.35rem;
	align-items: center;
}

.filter-checkbox {
	flex-direction: row !important;
	align-items: center;
	gap: 0.5rem !important;
	padding: 0.68rem 0.8rem;
	border-radius: 12px;
	border: 1px solid transparent;
}

.filter-checkbox input {
	width: auto;
	accent-color: var(--warning);
}

.filter-count {
	margin: 0.75rem 0 0;
}

label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.82rem;
	color: var(--muted);
	font-weight: 600;
}

input, select {
	width: 100%;
	padding: 0.68rem 0.8rem;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	color: var(--text);
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
	outline: none;
	border-color: rgba(99, 102, 241, 0.65);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

/* Detail */
.breadcrumb {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 0 0 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}

.crumb-sep {
	opacity: 0.5;
}

.detail-card {
	position: relative;
	margin-bottom: 1rem;
}

.detail-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	margin-top: 1rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.detail-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.status-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: end;
	margin-top: 0.75rem;
}

.status-form label {
	min-width: 220px;
	flex: 1;
}

.link-list {
	list-style: none;
	padding: 0;
	margin: 0.5rem 0 0;
}

.recent-change-list {
	list-style: none;
	margin: 0;
	padding: 1.15rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.recent-change-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4rem;
	font-size: 0.92rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--border);
}

.recent-change-list li:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.recent-change-time {
	margin-left: auto;
}

.link-list li {
	margin: 0;
	border-bottom: 1px solid var(--border);
}

.link-list li:last-child {
	border-bottom: none;
}

.article-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0.15rem;
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
}

.article-link:hover {
	color: var(--accent-2);
	text-decoration: none;
}

.article-arrow {
	color: var(--muted);
}

/* About */
.about-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1rem;
}

.feature-list {
	margin: 0.5rem 0 0;
	padding-left: 1.1rem;
	color: var(--muted);
}

.feature-list li {
	margin: 0.4rem 0;
}

.feature-list strong {
	color: var(--text);
}

.note {
	margin: 1rem 0 0;
	padding: 0.75rem 0.9rem;
	border-radius: var(--radius-sm);
	background: rgba(251, 191, 36, 0.08);
	border: 1px solid rgba(251, 191, 36, 0.22);
	color: var(--note-text);
	font-size: 0.9rem;
}

.code-block {
	background: #050914;
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 1rem;
	overflow: auto;
	font-size: 0.84rem;
	color: #cbd5e1;
	margin: 0.5rem 0 0;
}

.source-snippet {
	margin-bottom: 1rem;
}

.source-path {
	margin: 0 0 0.75rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.source-details {
	margin-top: 0.85rem;
}

.source-details summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--accent-2);
	font-size: 0.9rem;
}

.source-details summary:hover {
	color: #67e8f9;
}

.source-code {
	max-height: 480px;
	white-space: pre;
}

/* highlight.jsの背景/パディングは使わず、.code-blockの見た目に統一する */
.source-code .hljs {
	background: transparent;
	padding: 0;
	color: inherit;
}

.simple-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.5rem;
}

.simple-table th,
.simple-table td {
	text-align: left;
	padding: 0.7rem 0.45rem;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}

.simple-table th {
	color: var(--muted);
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Empty / flash */
.empty-card {
	padding: 2rem 1.5rem;
	text-align: center;
	color: var(--muted);
}

.empty-card h3,
.empty-card h1 {
	color: var(--text);
}

.empty-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 0.85rem;
	display: grid;
	place-items: center;
	border-radius: 16px;
	font-weight: 800;
	font-size: 1.2rem;
	color: var(--accent-2);
	background: rgba(34, 211, 238, 0.1);
	border: 1px solid rgba(34, 211, 238, 0.22);
}

.empty-success .empty-icon {
	color: var(--success);
	background: rgba(52, 211, 153, 0.1);
	border-color: rgba(52, 211, 153, 0.25);
}

.flash {
	padding: 0.85rem 1rem;
	border-radius: 14px;
	margin-bottom: 1rem;
	border: 1px solid var(--border);
	animation: flash-in 0.35s ease;
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.flash-hide {
	opacity: 0;
	transform: translateY(-6px);
}

.flash-success {
	background: rgba(52, 211, 153, 0.12);
	color: var(--status-done);
	border-color: rgba(52, 211, 153, 0.28);
}

.flash-error {
	background: rgba(248, 113, 113, 0.12);
	color: var(--flash-error-text);
	border-color: rgba(248, 113, 113, 0.28);
}

@keyframes flash-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cta-row {
	margin-top: 1.6rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.88em;
	background: rgba(148, 163, 184, 0.12);
	padding: 0.12rem 0.4rem;
	border-radius: 6px;
}

/* Responsive */
@media (max-width: 900px) {
	.dashboard-top,
	.detail-grid,
	.about-grid {
		grid-template-columns: 1fr;
	}

	.ring-layout {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
	}

	.highlight-body {
		grid-template-columns: 1fr;
	}

	.highlight-actions {
		align-items: flex-start;
		text-align: left;
	}

	.filter-row {
		grid-template-columns: 1fr;
	}

	.filter-actions {
		justify-content: flex-start;
	}

	.footer-links {
		align-items: flex-start;
	}
}

@media (max-width: 640px) {
	.header-inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.nav {
		width: 100%;
	}

	.mini-stats {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
