:root {
	--paper-start: #ffffff;
	--paper-end: #f8f9fa;
	--surface: #ffffff;
	--ink: #2c3e50;
	--muted: #666666;
	--line: rgba(0, 0, 0, 0.05);
	--nav-line: rgba(156, 225, 89, 0.2);
	--accent: #9ce159;
	--accent-warm: #8c5e29;
	--accent-soft: rgba(156, 225, 89, 0.16);
	--input-bg: #ffffff;
	--code-bg: #f8f9fa;
	--danger: #a33a2a;
	--danger-hover: #82291d;
	--success-border: #bdd8ce;
	--success-bg: #edf6f1;
	--success-ink: #25594f;
	--error-border: #e4b5ac;
	--error-bg: #fff1ee;
	--error-ink: #923427;
	--shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
	--shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12);
	--header-bg: rgba(255, 255, 255, 0.95);
	--header-ink: #2c3e50;
	--header-muted: #555555;
	--header-hover-bg: rgba(0, 0, 0, 0.05);
	--header-shadow: 0 2px 20px rgba(156, 225, 89, 0.15);
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper-start: #2a2a2a;
		--paper-end: #353535;
		--surface: #383838;
		--ink: #e1e1e1;
		--muted: rgba(255, 255, 255, 0.8);
		--line: rgba(255, 255, 255, 0.1);
		--nav-line: rgba(255, 255, 255, 0.1);
		--accent: #9ce159;
		--accent-warm: #9ce159;
		--input-bg: #2f2f2f;
		--code-bg: #2a2a2a;
		--danger: #e0685a;
		--danger-hover: #f08575;
		--success-border: #315943;
		--success-bg: #1c2c22;
		--success-ink: #9fd8bb;
		--error-border: #6b3a2f;
		--error-bg: #2c1c17;
		--error-ink: #f0a894;
		--shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
		--shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.38);
		--header-bg: rgba(30, 30, 30, 0.95);
		--header-ink: #ffffff;
		--header-muted: #bbbbbb;
		--header-hover-bg: rgba(255, 255, 255, 0.1);
		--header-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
	}
}

* {
	box-sizing: border-box;
}

html {
	min-height: 100%;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
		sans-serif;
	background: linear-gradient(135deg, var(--paper-start) 0%, var(--paper-end) 100%);
	color: var(--ink);
}

body {
	min-height: 100%;
	margin: 0;
	font-size: 16px;
	line-height: 1.65;
	overflow-x: hidden;
}

a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, var(--accent-warm) 36%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--accent-warm);
	text-decoration-color: currentColor;
}

.site-shell {
	width: min(100% - 40px, 960px);
	margin: 0 auto;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	padding: 16px 0;
	background: var(--header-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--nav-line);
}

.site-header.scrolled {
	box-shadow: var(--header-shadow);
}

.scroll-indicator {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.1);
}

.site-header.has-scroll-progress .scroll-indicator {
	display: block;
}

.scroll-progress {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, #9ce159, #8c5e29);
}

.site-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: transparent;
}

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	width: min(100%, 1200px);
	margin: 0 auto;
	padding: 0 32px;
}

.brand {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0;
	text-decoration: none;
	color: var(--header-ink);
}

.brand:hover {
	color: var(--header-ink);
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 32px;
	font-size: 14px;
	color: var(--header-muted);
}

.site-nav a {
	position: relative;
	overflow: hidden;
	padding: 8px 16px;
	border-radius: 25px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.3s ease;
}

.site-nav a:hover {
	color: var(--header-ink);
	background: var(--header-hover-bg);
	transform: translateY(-2px);
}

.site-main {
	padding: 48px 0 88px;
}

.hero {
	max-width: 640px;
}

.eyebrow {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--accent-warm);
}

.hero h1 {
	margin: 0;
	font-size: clamp(30px, 4.5vw, 46px);
	line-height: 1.12;
	letter-spacing: 0;
}

.hero p {
	max-width: 560px;
	margin: 14px 0 0;
	font-size: 17px;
	color: var(--muted);
}

.post-list {
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surface);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.post-item {
	border-bottom: 1px solid var(--line);
	transition:
		background-color 0.2s ease,
		box-shadow 0.2s ease;
}

.post-item:last-child {
	border-bottom: none;
}

.post-item:hover {
	background: var(--accent-soft);
}

.post-item-link {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	gap: 22px;
	padding: 24px 26px;
	text-decoration: none;
}

.post-item-link:focus-visible {
	outline: 2px solid var(--accent-warm);
	outline-offset: -4px;
}

.post-date {
	font-size: 14px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.post-title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
	letter-spacing: 0;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--accent-warm) 36%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.post-item-link:hover .post-title {
	color: var(--accent-warm);
	text-decoration-color: currentColor;
}

.post-summary {
	margin: 8px 0 0;
	color: var(--muted);
}

.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 24px 0 0;
}

.pagination-pages {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pagination-link,
.pagination-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	min-height: 38px;
	padding: 7px 11px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font: inherit;
	font-size: 14px;
	text-decoration: none;
}

.pagination-link:hover {
	color: var(--ink);
	background: var(--accent-soft);
}

.pagination-current {
	border-color: var(--accent-warm);
	background: var(--accent-warm);
	color: #fff;
	font-weight: 700;
}

.pagination-current:hover {
	color: #fff;
	background: var(--accent-warm);
}

.pagination-disabled,
.pagination-ellipsis {
	opacity: 0.55;
	pointer-events: none;
}

.empty-state {
	margin: 32px 0 0;
	padding: 34px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.empty-state h2 {
	margin: 0;
	font-size: 22px;
	letter-spacing: 0;
}

.empty-state p {
	margin: 10px 0 0;
	color: var(--muted);
}

.post-page {
	padding: 40px 44px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.post-page-header {
	padding-bottom: 28px;
	border-bottom: 1px solid var(--line);
}

.post-page-header h1 {
	margin: 10px 0 0;
	font-size: clamp(30px, 4.5vw, 46px);
	line-height: 1.16;
	letter-spacing: 0;
}

.post-page-header p {
	margin: 16px 0 0;
	font-size: 17px;
	color: var(--muted);
}

.post-share {
	display: flex;
	margin-top: 18px;
}

.post-share-footer {
	justify-content: flex-end;
	margin-top: 34px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
}

.copy-link-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 116px;
	min-height: 36px;
	padding: 7px 13px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
	color: var(--muted);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		color 0.15s ease,
		background-color 0.15s ease;
}

.copy-link-button:hover,
.copy-link-button.copied {
	border-color: var(--accent-warm);
	color: var(--accent-warm);
}

.post-body {
	padding-top: 34px;
	font-size: 18px;
	line-height: 1.78;
}

.post-body h2,
.post-body h3 {
	margin: 2em 0 0.65em;
	line-height: 1.25;
	letter-spacing: 0;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre {
	margin: 1.1em 0;
}

.post-body img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 20px;
}

.post-body blockquote {
	padding-left: 18px;
	border-left: 3px solid var(--accent-warm);
	color: var(--muted);
}

.post-body code {
	padding: 0.15em 0.3em;
	border-radius: 4px;
	background: var(--accent-soft);
	font-size: 0.9em;
}

.post-body pre {
	overflow-x: auto;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--code-bg);
}

.post-body pre code {
	padding: 0;
	background: transparent;
}

.auth-page {
	display: flex;
	justify-content: center;
}

.admin-panel {
	width: min(100%, 500px);
	padding: 28px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.admin-panel h1 {
	margin: 0;
	font-size: 28px;
	line-height: 1.18;
	letter-spacing: 0;
}

.admin-note {
	margin: 12px 0 20px;
	color: var(--muted);
}

.admin-form {
	display: grid;
	gap: 10px;
	margin-top: 18px;
}

.admin-form label {
	font-size: 14px;
	font-weight: 700;
	color: var(--muted);
}

.admin-form input {
	width: 100%;
	min-height: 42px;
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--input-bg);
	color: var(--ink);
	font: inherit;
}

.admin-form input:focus {
	outline: 2px solid var(--accent-soft);
	border-color: var(--accent-warm);
}

.admin-form button,
.admin-panel button {
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--accent-warm);
	border-radius: 999px;
	background: var(--accent-warm);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.admin-form button:hover,
.admin-panel button:hover {
	filter: brightness(0.95);
}

.form-error {
	margin: 0;
	color: var(--danger);
	font-size: 14px;
}

.admin-page {
	padding: 28px 30px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.admin-page-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}

.admin-page-header h1 {
	margin: 0;
	font-size: 32px;
	line-height: 1.1;
	letter-spacing: 0;
}

.admin-actions,
.form-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.admin-actions form {
	margin: 0;
}

.logout-form {
	display: inline-flex;
}

.button-link,
.post-editor .form-actions button,
.delete-form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--accent-warm);
	border-radius: 999px;
	background: var(--accent-warm);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.button-link:hover,
.post-editor .form-actions button:hover,
.delete-form button:hover {
	filter: brightness(0.95);
}

.logout-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.logout-button:hover {
	border-color: var(--danger);
	color: var(--danger);
}

.text-link {
	color: var(--accent-warm);
	font-weight: 700;
}

.danger-link {
	color: var(--danger);
	font-weight: 700;
}

.danger-link:hover {
	color: var(--danger-hover);
}

.danger-button {
	border-color: var(--danger) !important;
	background: var(--danger) !important;
	color: #fff;
}

.admin-post-list {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.admin-post-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 18px 14px;
	margin: 0 -14px;
	border-radius: 16px;
	border-bottom: 1px solid var(--line);
	transition: background-color 0.15s ease;
}

.admin-post-item:hover {
	background: var(--accent-soft);
}

.admin-post-item h2 {
	margin: 4px 0 0;
	font-size: 20px;
	line-height: 1.25;
	letter-spacing: 0;
}

.admin-post-meta {
	display: flex;
	gap: 10px;
	margin: 0;
	color: var(--muted);
	font-size: 14px;
}

.admin-post-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.admin-post-path {
	margin: 6px 0 0;
	color: var(--muted);
	font-size: 14px;
	overflow-wrap: anywhere;
}

.admin-post-path a + a,
.admin-post-path span {
	display: inline-block;
	margin-left: 10px;
	color: var(--muted);
}

.post-editor {
	display: grid;
	gap: 14px;
}

.field-group {
	display: grid;
	gap: 8px;
}

.field-group label,
.status-field legend {
	color: var(--muted);
	font-size: 14px;
	font-weight: 700;
}

.field-group input,
.field-group textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--input-bg);
	color: var(--ink);
	font: inherit;
}

.field-group textarea {
	resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
	outline: 2px solid var(--accent-soft);
	border-color: var(--accent-warm);
}

.EasyMDEContainer {
	color: var(--ink);
}

.EasyMDEContainer .CodeMirror,
.editor-toolbar,
.editor-preview,
.editor-preview-side {
	border-color: var(--line);
}

.EasyMDEContainer .CodeMirror {
	border-radius: 0 0 12px 12px;
	background: var(--input-bg);
	color: var(--ink);
	font: inherit;
	line-height: 1.65;
}

.editor-toolbar {
	border-radius: 12px 12px 0 0;
	background: var(--surface);
}

.editor-toolbar button {
	color: var(--ink) !important;
}

.editor-toolbar button.active,
.editor-toolbar button:hover {
	background: var(--accent-soft);
	border-color: var(--line);
}

.editor-statusbar {
	color: var(--muted);
}

.status-field {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0;
	padding: 0;
	border: 0;
}

.status-field label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.form-success,
.form-error-list {
	margin: 0 0 18px;
	padding: 12px 14px;
	border-radius: 16px;
}

.form-success {
	border: 1px solid var(--success-border);
	background: var(--success-bg);
	color: var(--success-ink);
}

.form-error-list {
	border: 1px solid var(--error-border);
	background: var(--error-bg);
	color: var(--error-ink);
}

.form-error-list p {
	margin: 0;
}

.delete-page {
	max-width: 720px;
}

.delete-box {
	margin-bottom: 20px;
	padding: 22px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--surface);
}

.delete-box h2 {
	margin: 6px 0 0;
	font-size: 24px;
	line-height: 1.25;
	letter-spacing: 0;
}

.delete-form {
	display: flex;
	align-items: center;
	gap: 12px;
}

.site-footer {
	padding: 28px 0 38px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 14px;
}

.site-footer p {
	margin: 0;
}

.error-page {
	max-width: 680px;
}

.error-page h1 {
	margin: 0;
	font-size: clamp(38px, 6vw, 64px);
	line-height: 1.06;
	letter-spacing: 0;
}

.error-page p {
	margin: 18px 0 0;
	color: var(--muted);
}

@media (max-width: 680px) {
	.site-shell {
		width: min(100% - 28px, 960px);
	}

	.site-header-inner {
		gap: 16px;
		padding: 0 16px;
	}

	.brand {
		font-size: 1.2rem;
	}

	.site-nav {
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 16px;
	}

	.site-nav a {
		padding: 8px;
		font-size: 0.9rem;
	}

	.site-main {
		padding: 40px 0 64px;
	}

	.hero h1 {
		font-size: 32px;
	}

	.post-item {
		display: block;
	}

	.post-item-link {
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 18px;
	}

	.pagination {
		flex-wrap: wrap;
		gap: 8px;
	}

	.admin-post-item {
		padding: 20px 0;
		margin: 0;
	}

	.empty-state {
		padding: 24px;
	}

	.post-page {
		padding: 24px;
	}

	.admin-page {
		padding: 24px;
	}

	.admin-panel {
		padding: 24px;
	}

	.admin-page-header,
	.admin-post-item,
	.form-actions,
	.delete-form {
		align-items: stretch;
		flex-direction: column;
	}

	.admin-actions {
		align-items: stretch;
		flex-direction: column;
		width: 100%;
	}

	.status-field {
		align-items: flex-start;
		flex-direction: column;
	}
}
