/* Modern Merged Aesthetic: Caesar Schinas + Kalleboo */
* {
	box-sizing: border-box;
}

:root {
	--bg-color: #f8fafc;
	--text-color: #334155;
	--heading-color: #0f172a;
	--accent-color: #0284c7;
	--accent-hover: #0369a1;
	--border-color: #cbd5e1;
	--card-bg: #ffffff;
	--subtext-color: #64748b;
	--grayish-blue: #2563eb;
	--font-heading: "Cormorant SC", Georgia, serif;
	--font-body: "Sorts Mill Goudy", Georgia, serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg-color: #0f172a;
		--text-color: #cbd5e1;
		--heading-color: #f8fafc;
		--accent-color: #38bdf8;
		--accent-hover: #7dd3fc;
		--border-color: #334155;
		--card-bg: #1e293b;
		--subtext-color: #94a3b8;
		--grayish-blue: #60a5fa;
	}
}

html {
	background-color: var(--bg-color);
	color: var(--text-color);
	font-family: var(--font-body);
	font-size: 19px;
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	padding: 0;
	margin: 0;
}

body {
	width: 100%;
	max-width: 42em;
	margin: 0 auto;
	padding: 2.5em 1.5em;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

/* Header Section */
header {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.6em;
	padding-bottom: 0.6em;
	border-bottom: 1px solid var(--border-color);
}

header .header-left {
	display: flex;
	flex-direction: column;
	text-align: left;
}

header h1 {
	font-family: var(--font-body); /* Sorts Mill Goudy (non SC) */
	font-size: 1.6em;
	font-weight: 400;
	color: var(--heading-color);
	margin: 0;
	line-height: 1.2;
}

header h1 b {
	font-weight: 700;
	color: var(--heading-color);
}

header h1 a {
	color: inherit;
	text-decoration: none;
	border-bottom: none;
}

header ruby {
	ruby-position: under;
	margin-top: 0.2em;
}

header ruby .ipa {
	display: block;
	font-size: 0.95rem;
	font-family: var(--font-body);
	color: var(--subtext-color);
	margin: 0;
	letter-spacing: 0.05em;
}

header ruby .ipa a {
	color: var(--subtext-color);
	text-decoration: none;
	border-bottom: 1px dotted var(--subtext-color);
}

header ruby .ipa a:hover {
	color: var(--accent-color);
	border-bottom-color: var(--accent-color);
}

img.headshot {
	width: 5.5em;
	height: 5.5em;
	aspect-ratio: 1;
	border-radius: 50%;
	border: none;
	box-shadow: none;
	object-fit: cover;
	margin-left: 1.5em;
	flex-shrink: 0;
}

/* Global Link Styling (Applies to all current and future <a> elements) */
a,
a:visited {
	color: var(--text-color);
	font-family: var(--font-body);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

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

/* Contact & Social Links List */
.contact-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7em;
	list-style: none;
	padding: 0;
	margin: 0.4em 0 1em 0;
}

.contact-grid li {
	margin: 0;
}

.contact-grid a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.contact-grid .icon {
	width: 1.1em;
	height: 1.1em;
	flex-shrink: 0;
	object-fit: contain;
}

@media (prefers-color-scheme: dark) {
	.contact-grid img.icon {
		filter: invert(0.95) hue-rotate(180deg);
	}
}

.item-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.item-list li {
	margin-bottom: 1em;
	padding: 0.8em 1em;
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 8px;
}

.item-list li h3 {
	margin: 0 0 0.2em 0;
	font-size: 1.2em;
	font-family: var(--font-heading);
}

.item-list li p {
	margin: 0;
	font-size: 0.95em;
	color: var(--subtext-color);
	font-family: var(--font-body);
}

.meta-tag {
	display: inline-block;
	font-family: var(--font-mono);
	font-size: 0.75em;
	padding: 0.1em 0.5em;
	background: rgba(2, 132, 199, 0.1);
	color: var(--accent-color);
	border-radius: 4px;
	margin-right: 0.5em;
}

/* Blog Posts List & Detail */
.post-item {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	padding: 1em;
	margin-bottom: 1em;
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 8px;
}

.post-item .post-date {
	font-family: var(--font-mono);
	font-size: 0.85em;
	color: var(--subtext-color);
}

.post-item h3 {
	margin: 0.2em 0;
	font-size: 1.3em;
	font-family: var(--font-heading);
}

.post-item p {
	margin: 0.3em 0 0 0;
	color: var(--subtext-color);
	font-size: 0.95em;
	font-family: var(--font-body);
}

#prev-next {
	display: flex;
	justify-content: space-between;
	margin-top: 2.5em;
	padding-top: 1em;
	border-top: 1px solid var(--border-color);
	font-family: var(--font-body);
}

/* Code Snippets */
pre, code {
	font-family: var(--font-mono);
	font-size: 0.9em;
}

pre {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	padding: 1em;
	border-radius: 6px;
	overflow-x: auto;
}

:not(pre) > code {
	background: rgba(148, 163, 184, 0.15);
	padding: 0.15em 0.35em;
	border-radius: 4px;
}

/* Footer Section */
footer {
	margin-top: auto;
	padding-top: 2em;
	border-top: 1px solid var(--border-color);
	font-family: var(--font-body);
	font-size: 0.85em;
	color: var(--subtext-color);
	text-align: center;
}

footer a {
	color: var(--subtext-color);
	text-decoration: underline;
}

footer a:hover {
	color: var(--accent-color);
}
