/*
  Calm, static, dark palette with warm amber and sage accents.
  Reading-first layout: one column, no build tools needed to view it.
*/

@font-face {
	font-family: 'Atkinson';
	src: url('/assets/fonts/atkinson-regular.woff') format('woff');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Atkinson';
	src: url('/assets/fonts/atkinson-bold.woff') format('woff');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg-main: #16181d;
	--bg-card: #1c1f26;
	--bg-input: #111317;
	--text-main: #e8e4dc;
	--text-muted: #9e9a92;
	--text-strong: #ffffff;
	--accent: #dfa032;
	--accent-hover: #f0b548;
	--accent-sage: #729c82;
	--border-color: #2b303b;
	--code-bg: #242832;
	--font-body: 'Atkinson', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background-color: var(--bg-main);
	color: var(--text-main);
	font-family: var(--font-body);
	font-size: 19px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}

.wrap {
	width: 720px;
	max-width: calc(100% - 2.5rem);
	margin: 0 auto;
}

main {
	flex: 1;
	padding: 3rem 0;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 0.8rem;
	color: var(--text-strong);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
	margin: 0 0 1.5rem;
}

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

a:hover,
a:focus-visible {
	color: var(--accent-hover);
	text-decoration: underline;
}

ul,
ol {
	margin: 0 0 1.5rem;
	padding-left: 1.5rem;
}

li {
	margin-bottom: 0.5rem;
}

hr {
	border: none;
	border-top: 1px solid var(--border-color);
	margin: 2.5rem 0;
}

code {
	padding: 0.2em 0.4em;
	background-color: var(--code-bg);
	color: var(--accent);
	border-radius: 4px;
	font-family: var(--font-mono);
	font-size: 0.88em;
}

pre {
	margin: 1.5rem 0;
	padding: 1.5rem;
	background: var(--bg-input);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	overflow-x: auto;
}

pre code {
	padding: 0;
	background: none;
	color: var(--text-main);
	font-size: 0.9em;
}

blockquote {
	margin: 1.75rem 0;
	padding: 0.5rem 0 0.5rem 1.5rem;
	border-left: 3px solid var(--accent-sage);
	background: rgba(114, 156, 130, 0.05);
	border-radius: 0 6px 6px 0;
	color: var(--text-muted);
	font-style: italic;
}

img {
	max-width: 100%;
	height: auto;
}

/* Header */
.site-header {
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--border-color);
	background: var(--bg-main);
}

.site-header nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	color: var(--text-strong);
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

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

.links {
	display: flex;
	gap: 1.5rem;
}

.links a {
	color: var(--text-muted);
	font-size: 1rem;
	font-weight: 500;
	padding-bottom: 0.2rem;
	border-bottom: 2px solid transparent;
}

.links a:hover,
.links a.active {
	color: var(--text-strong);
	border-bottom-color: var(--accent);
	text-decoration: none;
}

.social-links {
	display: flex;
	gap: 1rem;
	font-size: 0.9rem;
}

.social-links a {
	color: var(--text-muted);
}

.social-links a:hover {
	color: var(--accent);
}

/* Home */
.intro-row {
	display: flex;
	align-items: center;
	gap: 1.75rem;
}

.intro h1 {
	margin-bottom: 0.5rem;
}

.avatar {
	width: 120px;
	height: 120px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 2px solid var(--border-color);
	object-fit: cover;
	object-position: 50% 15%;
}

.subtitle {
	margin-bottom: 1.25rem;
	color: var(--accent);
	font-family: var(--font-mono);
	font-size: 0.95rem;
}

.bio-text {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.7;
}

.writings h2,
.writings > h1 {
	margin-bottom: 1rem;
}

.section-desc {
	margin-bottom: 2rem;
	color: var(--text-muted);
	font-size: 1.1rem;
}

/* Post list (home and blog) */
.post-list {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

.post-item {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.post-meta {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--text-muted);
	font-family: var(--font-mono);
	font-size: 0.9rem;
}

.lang-badge {
	padding: 0.1rem 0.4rem;
	background-color: var(--code-bg);
	border-radius: 4px;
	color: var(--accent);
	font-size: 0.85em;
	font-weight: 600;
}

.post-title {
	margin: 0;
	font-size: 1.5rem;
}

.post-title a {
	color: var(--text-strong);
}

.post-title a:hover {
	color: var(--accent);
}

.post-desc {
	margin: 0.35rem 0 0;
	color: var(--text-muted);
	font-size: 1.05rem;
	line-height: 1.6;
}

/* Single post */
.post-header {
	margin-bottom: 2.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
	margin: 0.5rem 0 0;
	font-size: 2.4rem;
	line-height: 1.25;
}

.post-date {
	color: var(--text-muted);
	font-family: var(--font-mono);
	font-size: 0.95rem;
}

.back-link {
	margin-top: 3rem;
}

/* About */
.about-photo {
	display: block;
	width: 100%;
	max-width: 320px;
	margin: 0 0 2rem;
	border-radius: 8px;
	border: 1px solid var(--border-color);
}

.intro-lead {
	margin-bottom: 1.5rem;
	color: var(--text-strong);
	font-size: 1.25rem;
}

.about h3 {
	margin-top: 2.5rem;
	margin-bottom: 1rem;
}

.about li {
	margin-bottom: 0.6rem;
	font-size: 1.1rem;
}

.contact-line {
	margin-top: 2rem;
	font-size: 1.1rem;
}

/* Contact */
.contact-page {
	max-width: 600px;
	margin: 0 auto;
}

.header-text {
	margin-bottom: 2.5rem;
	text-align: center;
}

.header-text p {
	margin: 0;
	color: var(--text-muted);
	font-size: 1.1rem;
}

.form-wrapper {
	padding: 2.5rem;
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 12px;
}

.contact-form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.input-group label {
	display: block;
	margin-bottom: 0.5rem;
	color: var(--text-main);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.input-group input,
.input-group textarea {
	width: 100%;
	padding: 0.85rem 1.15rem;
	background-color: var(--bg-input);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	color: var(--text-main);
	font-family: inherit;
	font-size: 1rem;
}

.input-group input:focus,
.input-group textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(223, 160, 50, 0.15);
}

.submit-btn {
	align-self: flex-start;
	padding: 0.85rem 1.75rem;
	background: var(--accent);
	border: none;
	border-radius: 8px;
	color: #16181d;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.submit-btn:hover:not(:disabled) {
	background: var(--accent-hover);
}

.submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.status {
	margin: 0;
	padding: 1rem;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 500;
	text-align: center;
}

.status.hidden {
	display: none;
}

.status.success {
	background-color: rgba(16, 185, 129, 0.15);
	border: 1px solid rgba(52, 211, 153, 0.3);
	color: #34d399;
}

.status.error {
	background-color: rgba(239, 68, 68, 0.15);
	border: 1px solid rgba(248, 113, 113, 0.3);
	color: #f87171;
}

/* 404 */
.not-found {
	padding: 4rem 0;
	text-align: center;
}

/* Footer */
.site-footer {
	padding: 3rem 1rem;
	border-top: 1px solid var(--border-color);
	color: var(--text-muted);
	font-size: 0.9rem;
	text-align: center;
}

.footer-content {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-width: 780px;
	margin: 0 auto;
}

.footer-content p {
	margin: 0;
}

.footer-content strong {
	color: var(--text-main);
}

.tech-stack {
	font-family: var(--font-mono);
	font-size: 0.85rem;
}

/* Small screens */
@media (max-width: 720px) {
	body {
		font-size: 17px;
	}

	main {
		padding: 2rem 0;
	}

	h1 {
		font-size: 2rem;
	}

	.site-header nav {
		flex-direction: column;
		align-items: flex-start;
	}

	.intro-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.form-wrapper {
		padding: 1.5rem;
	}
}
