/* ===== Variables ===== */
:root {
	--bg: #e8e8e8;
	--surface: #f0f0f0;
	--surface-elevated: #f5f5f5;
	--text: #1a1a1a;
	--subtext: #4a4a4a;
	--accent: #08134c;
	--accent-hover: #3a3e51;
	--border: #c0c0c0;
	--code-bg: #e0e0e0;
	--max-width: 850px;
	--transition: 0.15s ease;
}

[data-theme="dark"] {
	--bg: #0d0d0d;
	--surface: #161616;
	--surface-elevated: #1e1e1e;
	--text: #e8e8e8;
	--subtext: #a0a0a0;
	--accent: #7a9aff;
	--accent-hover: #6b8cef;
	--border: #282828;
	--code-bg: #1a1a1a;
}

/* ===== Base ===== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: "JetBrains Mono", monospace;
	font-size: 14px;
	line-height: 1.6;
	margin: 0 auto;
	padding: 32px 20px;
	max-width: var(--max-width);
	transition:
		background var(--transition),
		color var(--transition);
}

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

a:hover {
	text-decoration: underline;
}

h2 {
	font-size: 1.1em;
	font-weight: 600;
	margin-bottom: 12px;
	color: var(--text);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 2px solid var(--border);
	padding-bottom: 6px;
}

h3 {
	font-size: 0.95em;
	font-weight: 600;
	color: var(--accent);
	margin-bottom: 10px;
	text-transform: lowercase;
}

/* ===== Header ===== */
.header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 32px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--border);
}

.header-content {
	flex: 1;
}

.header h1 {
	font-size: 1.8em;
	font-weight: 700;
	margin-bottom: 12px;
	color: var(--text);
	letter-spacing: -0.02em;
}

.site-title {
	position: relative;
	text-decoration: none;
	color: inherit;
}

.site-title::after {
	text-decoration: none;
}

.site-title:hover::after {
	text-decoration: none;

	width: 100%;
}

.site-title .prompt {
	display: inline-block;
	transition: transform 0.2s ease;
}

.site-title:hover .prompt {
	text-decoration: none;
	transform: translateX(4px);
}

/* ===== Navigation ===== */
.nav {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-top: 12px;
	align-items: center;
}

.nav-link {
	color: var(--text);
	font-weight: 500;
	font-size: 0.95em;
	padding: 6px 10px;
	transition: all var(--transition);
	border: 1px solid transparent;
	text-decoration: none;
}

.nav-link:hover {
	background: var(--code-bg);
	color: var(--accent);
	border: 1px solid var(--border);
	text-decoration: none;
}

.nav-item {
	position: relative;
}

.nav-trigger {
	color: var(--text);
	font-weight: 500;
	font-size: 0.95em;
	cursor: pointer;
	padding: 6px 10px;
	transition: all var(--transition);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid transparent;
}

.nav-trigger:hover {
	background: var(--code-bg);
	color: var(--accent);
	border: 1px solid var(--border);
}

.nav-trigger::after {
	/*content: "▾";*/
	font-size: 0.8em;
	opacity: 0.6;
}

.nav-dropdown {
	display: none;
	position: absolute;
	top: calc(100% - 4px);
	left: 0;
	background: var(--surface-elevated);
	border: 2px solid var(--border);
	padding: 4px;
	min-width: 180px;
	z-index: 100;
}

/* Create invisible bridge to prevent flickering */
.nav-item::before {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 8px;
	z-index: 99;
}

.nav-item:hover .nav-dropdown {
	display: block;
}

.nav-dropdown a {
	display: block;
	color: var(--text);
	padding: 8px 12px;
	font-size: 0.9em;
	transition: all var(--transition);
	border: 1px solid transparent;
}

.nav-dropdown a:hover {
	background: var(--code-bg);
	color: var(--accent);
	border: 1px solid var(--border);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
	background: var(--surface);
	border: 2px solid var(--border);
	padding: 8px 14px;
	cursor: pointer;
	color: var(--text);
	font-family: inherit;
	font-size: 0.9em;
	font-weight: 500;
	transition: all var(--transition);
}

.theme-toggle:hover {
	background: var(--code-bg);
	border-color: var(--accent);
}

/* ===== Profile Banner ===== */
.profile-banner {
	background: var(--surface);
	border: 2px solid var(--border);
	margin-bottom: 24px;
}

.profile-header {
	background: var(--code-bg);
	padding: 12px 16px;
	border-bottom: 2px solid var(--border);
	display: flex;
	align-items: center;
	gap: 8px;
}

.profile-label {
	color: var(--accent);
	font-weight: 600;
	font-size: 0.9em;
}

.profile-content {
	padding: 20px;
}

.profile-intro {
	margin-bottom: 16px;
}

.profile-name {
	font-size: 1.5em;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 6px;
}

.profile-title {
	color: var(--subtext);
	font-size: 0.95em;
	margin-bottom: 14px;
}

.profile-bio {
	line-height: 1.65;
	color: var(--text);
	margin-bottom: 16px;
}

.profile-meta {
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 12px 16px;
	font-size: 0.9em;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}

.meta-key {
	color: var(--accent);
	font-weight: 600;
}

.meta-value {
	color: var(--text);
}

/* ===== Two Column Layout ===== */
.content-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin-bottom: 24px;
}

/* ===== Section Boxes ===== */
.section-box {
	background: var(--surface);
	border: 2px solid var(--border);
	padding: 18px;
	transition: border-color var(--transition);
}

.section-box:hover {
	border-color: var(--accent);
}

.section-box.full-width {
	grid-column: 1 / -1;
}

/* ===== Tech Stack List ===== */
.tech-list {
	list-style: none;
}

.tech-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
	color: var(--text);
	font-size: 0.9em;
}

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

.tech-list strong {
	color: var(--accent);
	font-weight: 600;
	display: inline-block;
	min-width: 100px;
}

/* ===== Philosophy/Interests ===== */
.interest-list {
	list-style: none;
}

.interest-list li {
	padding: 6px 0 6px 12px;
	position: relative;
	color: var(--text);
	font-size: 0.9em;
}

.interest-list li::before {
	content: "▸";
	position: absolute;
	left: 0;
	color: var(--accent);
}

/* ===== Setup Grid ===== */
.setup-grid {
	display: grid;
	gap: 14px;
}

.setup-item {
	background: var(--code-bg);
	padding: 10px 14px;
	border-left: 3px solid var(--accent);
}

.setup-item-header {
	font-weight: 600;
	color: var(--accent);
	font-size: 0.85em;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.setup-item-content {
	color: var(--text);
	font-size: 0.9em;
	line-height: 1.5;
}

/* ===== Contact Links ===== */
.contact-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.contact-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: var(--code-bg);
	border: 2px solid var(--border);
	font-weight: 500;
	transition: all var(--transition);
	text-decoration: none;
}

.contact-link:hover {
	background: var(--accent);
	color: white;
	border-color: var(--accent);
	text-decoration: none;
}

.contact-icon {
	font-size: 1.2em;
}

/* ===== Footer ===== */
footer {
	text-align: center;
	padding: 24px 0;
	margin-top: 32px;
	border-top: 2px solid var(--border);
	color: var(--subtext);
	font-size: 0.9em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
	body {
		padding: 20px 16px;
		font-size: 13px;
	}

	.header {
		flex-direction: column;
	}

	.header h1 {
		font-size: 1.5em;
	}

	.nav {
		gap: 14px;
	}

	.content-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.profile-meta {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.contact-grid {
		grid-template-columns: 1fr;
	}
}

/* ===== Home Grid Layout ===== */
.home-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 24px;
}

.main-column {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* ===== Post List ===== */
.post-list {
	list-style: none;
}

.post-item {
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
}

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

.post-title {
	color: var(--text);
	font-weight: 500;
	flex: 1;
}

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

.post-date {
	color: var(--subtext);
	font-size: 0.85em;
	white-space: nowrap;
}

/* ===== Contact List ===== */
.contact-list {
	list-style: none;
}

.contact-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
}

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

.contact-list a {
	color: var(--text);
	font-weight: 500;
}

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

/* ===== Article Layout ===== */
.article-container {
	max-width: 720px;
	margin: 0 auto;
}

.article {
	background: var(--surface);
	border: 2px solid var(--border);
	padding: 32px;
	transition: border-color var(--transition);
}

.article:hover {
	border-color: var(--accent);
}

.article-header {
	margin-bottom: 32px;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--border);
}

.article-title {
	font-size: 1.8em;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 12px;
	line-height: 1.3;
}

.article-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.article-date {
	color: var(--subtext);
	font-size: 0.9em;
}

.article-stats {
	display: flex;
	gap: 16px;
	align-items: center;
}

.stat-btn,
.stat-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9em;
}

.stat-btn {
	background: transparent;
	border: 1px solid var(--border);
	padding: 4px 10px;
	cursor: pointer;
	color: var(--text);
	font-family: inherit;
	transition: all var(--transition);
}

.stat-btn:hover {
	background: var(--code-bg);
	border-color: var(--accent);
	color: var(--accent);
}

.stat-icon {
	font-style: normal;
	font-size: 1.1em;
}

.stat-count {
	color: var(--subtext);
	font-weight: 500;
}

/* ===== Article Content ===== */
.article-content {
	line-height: 1.7;
	color: var(--text);
}

.article-content h1,
.article-content h2,
.article-content h3 {
	margin-top: 28px;
	margin-bottom: 14px;
	font-weight: 600;
	color: var(--text);
}

.article-content h1 {
	font-size: 1.6em;
	border-bottom: 2px solid var(--border);
	padding-bottom: 8px;
}

.article-content h2 {
	font-size: 1.3em;
}

.article-content h3 {
	font-size: 1.1em;
	color: var(--accent);
}

.article-content p {
	margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
	margin-bottom: 16px;
	padding-left: 24px;
}

.article-content li {
	margin-bottom: 8px;
}

.article-content code {
	background: var(--code-bg);
	padding: 2px 6px;
	font-family: "JetBrains Mono", monospace;
	font-size: 0.9em;
	border: 1px solid var(--border);
}

.article-content pre {
	background: var(--code-bg);
	border: 2px solid var(--border);
	padding: 16px;
	overflow-x: auto;
	margin-bottom: 16px;
}

.article-content pre code {
	background: none;
	padding: 0;
	border: none;
}

.article-content blockquote {
	border-left: 3px solid var(--accent);
	padding-left: 16px;
	margin: 16px 0;
	color: var(--subtext);
	font-style: italic;
}

.article-content img {
	max-width: 100%;
	height: auto;
	border: 2px solid var(--border);
	margin: 16px 0;
}

.article-content a {
	color: var(--accent);
	font-weight: 500;
}

.article-content a:hover {
	color: var(--accent-hover);
	text-decoration: underline;
}

/* ===== Archive Layout ===== */
.archive-container {
	max-width: 720px;
	margin: 0 auto;
}

.archive-count {
	color: var(--subtext);
	font-size: 0.9em;
	margin-bottom: 20px;
}

.archive-list {
	list-style: none;
}

.archive-item {
	padding: 12px 0;
	border-bottom: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 20px;
}

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

.archive-link {
	color: var(--text);
	font-weight: 500;
	flex: 1;
}

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

.archive-date {
	color: var(--subtext);
	font-size: 0.85em;
	white-space: nowrap;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
	.home-grid {
		grid-template-columns: 1fr;
	}

	.article {
		padding: 20px 16px;
	}

	.article-title {
		font-size: 1.4em;
	}

	.article-meta {
		flex-direction: column;
		align-items: flex-start;
	}

	.post-item,
	.archive-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
}

.header {
	display: grid;
	grid-template-columns: 1fr auto; /* left grows, right fits */
	align-items: start;
	gap: 16px;
}

.header-content {
	min-width: 0;
} /* prevent overflow */

.header-rail {
	display: grid;
	align-content: start;
	justify-items: end; /* right align both */
	row-gap: 8px;
}

.theme-toggle {
	justify-self: end;
}

.header-image {
	width: 76px; /* adjust */
	height: auto;
	border-radius: 4px;
}
