:root {
	--theme-gradient: linear-gradient(
		-135deg,
		hsl(200, 100%, 40%),
		hsl(200, 100%, 40%),
		hsl(200, 100%, 60%),
		hsl(150, 100%, 60%),
		hsl(200, 100%, 60%),
		hsl(200, 100%, 40%),
		hsl(200, 100%, 40%)
	);
	--accent-color: hsl(200, 70%, 20%);
	--accent-border: hsl(200, 100%, 75%);
	--pad: clamp(16px, 3vh, 48px);
	--pad2: clamp(32px, 6vh, 96px);
	--footer-color: rgb(240, 240, 240);
	--card-bg: rgb(250, 250, 250);
	--card-gap: 20px;
	--card-border-radius: 8px;
	--transition-speed: 0.2s;
}

* {
	font-family: Verdana, Geneva, Tahoma, sans-serif;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-weight: normal;
	user-select: none;
	text-decoration: none;
}

html,
body {
	min-height: 100%;
	min-width: 280px;
	background-color: var(--footer-color);
	padding: 0 10px;
}

header {
	background-color: var(--card-bg);
	padding: 0;
	padding-right: var(--pad);
	max-width: 1600px;
	margin: 0 auto var(--pad) auto;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	min-height: 250px;
	border-radius: 0 0 12px 12px;
	position: relative;
}

header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 16px;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
}

.header-image {
	position: relative;
	width: 250px;
	flex-shrink: 0;
	overflow: hidden;
	margin-top: 16px;
	border-radius: 0 0 0 12px;
}

.header-image::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
	z-index: 0;
}

.header-image img {
	position: relative;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	z-index: 1;
}

.header-content {
	display: flex;
	flex-direction: column;
	gap: 12px;
	justify-content: center;
	flex: 1;
	padding: var(--pad2) 0 var(--pad2) var(--pad);
}

main {
	background-color: transparent;
	padding: 0;
	max-width: 1600px;
	margin: 0 auto;
}

footer {
	background-color: var(--card-bg);
	padding: var(--pad2) var(--pad);
	max-width: 1600px;
	margin: var(--pad) auto 0 auto;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: var(--pad);
	border-radius: 12px 12px 0 0;
	position: relative;
}

footer::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 16px;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
}

.footer-image {
	position: relative;
	width: 150px;
	height: 150px;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 8px;
}

.footer-image::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
	z-index: 0;
}

.footer-image img {
	position: relative;
	width: 200%;
	height: 200%;
	object-fit: cover;
	display: block;
	z-index: 1;
	transform: translate(-25%, -25%);
}

.footer-content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	justify-content: center;
	flex: 1;
	max-height: 150px;
}

/* Section Styling */
section.category-section {
	background-color: var(--card-bg);
	border-radius: 12px;
	padding: var(--pad);
	margin-bottom: var(--pad);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

section.category-section:last-child {
	margin-bottom: 0;
}

/* Gradient Animation */
@keyframes gradFade {
	0% {
		background-position: left;
	}
	100% {
		background-position: right;
	}
}

/* Header and Footer Main Heading */
header h1,
.back-link h1,
footer h1 {
	font-family: 'Goudy Bookletter 1911', serif;
	font-weight: 900;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: gradFade 10s linear infinite;
	font-size: clamp(3rem, 7vw, 6rem);
	margin: 0;
	line-height: 1.1;
}

header p {
	color: rgba(0, 0, 0, 0.6);
	font-size: clamp(1.2rem, 2.5vw, 1.5rem);
	line-height: 1.7;
	margin: 0;
}

footer p {
	color: rgba(0, 0, 0, 0.6);
	font-size: clamp(0.85rem, 1.8vw, 1rem);
	line-height: 1.4;
	margin: 0;
}

footer h1 {
	font-size: clamp(2rem, 5vw, 4rem);
	margin-bottom: 4px;
}

header a,
header a:visited,
header a:focus,
footer a,
footer a:visited,
footer a:focus {
	color: rgba(0, 0, 0, 0.4);
	border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
	transition: all var(--transition-speed) ease;
}

header a:hover,
footer a:hover {
	color: rgba(0, 0, 0, 0.6);
	border-bottom: 1px dotted rgba(0, 0, 0, 0.5);
}

/* Responsive Header/Footer */
@media (max-width: 768px) {
	header {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		padding: 0;
		padding-top: 16px;
	}

	.header-image {
		width: 100%;
		height: 150px;
		margin-top: 0;
		border-radius: 0;
	}

	.header-image img {
		object-position: center calc(-120px * (100vw / 700px));
	}

	.header-content {
		align-items: center;
		padding: var(--pad);
	}

	header h1,
	footer h1 {
		font-size: clamp(1.5rem, 6vw, 2.5rem);
		text-align: center;
	}

	footer {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.footer-image {
		width: 120px;
		height: 120px;
	}

	.footer-content {
		align-items: center;
	}

	footer p {
		text-align: center;
	}
}

@media (max-width: 480px) {
	.header-image {
		height: 120px;
	}

	.footer-image {
		width: 100px;
		height: 100px;
	}
}

/* Section Header */
.category-section h2 {
	font-family: 'Goudy Bookletter 1911', serif;
	text-transform: capitalize;
	color: var(--accent-color);
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 600;
	line-height: 1.2;
	padding: 0 0 12px 0;
	margin: 0 0 var(--pad) 0;
	position: relative;
}

.category-section h2::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	min-height: 1.2px;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
}

/* Cards Container - Responsive Grid */
.cards-container {
	display: grid;
	gap: var(--card-gap);
	grid-template-columns: repeat(auto-fill, 200px);
	grid-auto-rows: 350px;
	justify-content: start;
	align-items: start;
}

/* Archive Section - Special layout for small cards */
.archive-section .cards-container {
	display: flex;
	flex-wrap: wrap;
	gap: var(--card-gap);
}

.archive-section .card-small {
	flex: 0 0 auto;
}

/* Base Card Styling */
.card {
	background-color: white;
	border-radius: var(--card-border-radius);
	overflow: hidden;
	transition: all var(--transition-speed) ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
}

.card a {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.card img {
	width: 100%;
	height: 200px;
	display: block;
	opacity: 0.9;
	transition: opacity var(--transition-speed) ease,
		transform var(--transition-speed) ease;
	object-fit: contain;
	background-color: rgb(250, 250, 250);
}

.card-image-placeholder {
	width: 100%;
	height: 200px;
	background-color: rgb(220, 220, 220);
	display: block;
}

.card-content {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}

.card-title {
	color: rgb(50, 50, 50);
	font-size: 1.1em;
	font-weight: 600;
	line-height: 1.3;
}

.card-subtitle {
	color: rgb(120, 120, 120);
	font-size: 0.9em;
	line-height: 1.4;
}

/* Card Hover Effects */
.card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
	cursor: pointer;
}

.card:hover img {
	opacity: 1;
	transform: scale(1);
}

/* Hero Card - Large Featured Card */
.card-large {
	grid-column: span 2;
	width: 420px;
	height: 350px;
	position: relative;
	overflow: hidden;
}

.card-large a {
	flex-direction: row;
	align-items: flex-start;
	position: relative;
}

.card-large img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

.card-large .card-content {
	padding: 24px;
	flex: 1;
	position: relative;
	z-index: 1;
}

.card-large .card-title {
	font-size: 1.5em;
	text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.card-large .card-subtitle {
	font-size: 1em;
	text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

/* Tile Card - Standard Card */
.card-medium {
	width: 200px;
	height: 350px;
}

.card-medium img {
	height: 200px;
	width: 200px;
	object-fit: contain;
}

.card-medium .card-content {
	width: 200px;
}

/* Small Cards Group - Container for 4 small cards stacked vertically */
.small-cards-group {
	grid-column: span 1;
	width: 200px;
	height: 350px;
	display: flex;
	flex-direction: column;
	gap: calc(var(--card-gap) / 2);
	justify-content: flex-start;
}

/* Icon Card - Compact Card */
.card-small {
	width: 200px;
	height: 64px;
}

.card-small a {
	flex-direction: row;
	align-items: center;
	gap: 12px;
}

.card-small img,
.card-small .card-image-placeholder {
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	border-radius: 6px;
	margin: 2px;
	object-fit: contain;
}

.card-small .card-content {
	padding: 12px 12px 12px 0;
	flex-grow: 1;
}

.card-small .card-title {
	font-size: 0.95em;
}

/* Responsive Design */
@media (max-width: 1200px) {
	.card-large {
		grid-column: span 2;
	}
}

@media (max-width: 768px) {
	.cards-container {
		grid-template-columns: repeat(auto-fill, 200px);
		gap: 16px;
	}

	.card-large {
		grid-column: span 1;
		width: 200px;
	}

	.card-large a {
		flex-direction: column;
	}

	.card-large .card-title {
		font-size: 1.3em;
	}

	.card-large .card-content {
		padding: 20px;
		width: 200px;
	}
}

@media (max-width: 480px) {
	.cards-container {
		grid-template-columns: 200px;
		gap: 12px;
		justify-content: center;
	}

	.card-large {
		width: 200px;
	}

	.card-medium {
		width: 200px;
	}

	.card-small a {
		flex-direction: row;
	}

	.card-small img {
		width: 50px;
		height: 50px;
		margin: 10px;
	}
}

/* ============================================
   Page Styles (for sub-pages)
   ============================================ */

.page {
	display: block;
	min-height: calc(100vh - 105px);
	background-color: white;
	color: rgb(70, 70, 70);
	line-height: 1.6;
	max-width: 940px;
	width: 100%;
	padding: var(--pad);
	margin: 0 auto;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	position: relative;
	overflow: hidden;
}

.page::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 16px;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
	border-radius: 12px 12px 0 0;
}

.page h1 {
	font-family: 'Goudy Bookletter 1911', serif;
	font-weight: 900;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: gradFade 10s linear infinite;
	font-size: clamp(2.5rem, 5vw, 4rem);
	margin: 0;
	padding-top: 20px;
	line-height: 1.2;
}

.page h2 {
	font-family: 'Goudy Bookletter 1911', serif;
	color: var(--accent-color);
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 600;
	line-height: 1.2;
	padding: 30px 0 12px 0;
	margin: 0;
	position: relative;
}

.page h2::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	min-height: 1.2px;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	animation: gradFade 10s linear infinite;
}

.page h3 {
	font-family: 'Goudy Bookletter 1911', serif;
	color: var(--accent-color);
	font-size: clamp(1.25rem, 2.5vw, 1.75rem);
	font-weight: 600;
	line-height: 1.2;
	padding: 20px 0 8px 0;
	margin: 0;
	opacity: 0.9;
}

.page p {
	padding-top: 10px;
}

/* Reset card styles within .page to match homepage */
.page .card a {
	color: inherit;
	text-decoration: none;
	border: none;
}

.page .card a:hover {
	text-decoration: none;
	color: inherit;
	border: none;
}

.page .card-title {
	font-family: Verdana, Geneva, Tahoma, sans-serif;
	color: rgb(50, 50, 50);
	font-size: 1.1em;
	font-weight: 600;
	line-height: 1.3;
	padding: 0;
	margin: 0;
	opacity: 1;
	position: static;
}

.page .card-title::after {
	display: none;
}

.page .card-subtitle {
	font-family: Verdana, Geneva, Tahoma, sans-serif;
	color: rgb(120, 120, 120);
}

pre {
	max-width: 100%;
	width: 700px;
	padding: 20px 20px 20px 30px;
	background-color: rgb(240, 240, 240);
	line-height: 1.2;
	font-size: 16px;
	font-family: courier, monospace;
	overflow-x: auto;
}

.page a {
	color: rgba(5, 125, 205, 0.95);
	transition: all var(--transition-speed) ease;
}

.page a:hover {
	text-decoration: underline;
	color: rgba(5, 125, 205, 0.95);
}

/* Form Elements */
input[type='text'] {
	border: 1px solid rgb(240, 240, 240);
	padding: 8px 12px;
	font-family: Verdana, sans-serif;
	border-radius: 4px;
	transition: border-color var(--transition-speed) ease;
}

input[type='text']:focus {
	outline: none;
	border-color: var(--accent-border);
}

input[type='button'],
button {
	font-family: Verdana, sans-serif;
	color: white;
	background-color: rgba(5, 125, 205, 0.95);
	padding: 8px 12px;
	border: 1px solid white;
	border-radius: 4px;
	cursor: pointer;
	transition: all var(--transition-speed) ease;
}

input[type='button']:hover,
button:hover {
	border: 1px solid rgba(5, 125, 205, 0.95);
	background-color: rgba(5, 125, 205, 0.85);
}

ol,
ul {
	margin-left: 30px;
}

td {
	vertical-align: top;
}

/* ============================================
   About Page Social Icons
   ============================================ */

.social::before {
	content: '';
	display: inline-block;
	height: 28px;
	width: 24px;
	background-position: 0 4px;
	background-repeat: no-repeat;
	position: relative;
	top: 6px;
	margin-right: 6px;
	opacity: 0.8;
	transition: opacity var(--transition-speed) ease;
}

.social:hover::before {
	opacity: 1;
}

.linkedin::before {
	background-image: url('./_img/social/linkedin.svg');
}
.medium::before {
	background-image: url('./_img/social/medium.svg');
}
.github::before {
	background-image: url('./_img/social/github.svg');
}
.tumblr::before {
	background-image: url('./_img/social/tumblr.svg');
}

/* ============================================
   Back Link (for sub-pages)
   ============================================ */

.back-link {
	text-align: center;
	padding: var(--pad) 0;
}

.back-link a {
	font-family: 'Goudy Bookletter 1911', serif;
	font-size: clamp(1.25rem, 2.5vw, 1.5rem);
	font-weight: 600;
	background: var(--theme-gradient);
	background-size: 2000% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: gradFade 10s linear infinite;
	text-decoration: none;
	border: none;
}

.back-link a:hover {
	border: none;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 900px) {
	.page {
		max-width: 90%;
		padding: var(--pad) calc(var(--pad) * 0.75);
		border-radius: 8px;
	}

	.page::before {
		border-radius: 8px 8px 0 0;
	}
}

@media (max-width: 600px) {
	.page {
		max-width: 95%;
		padding: var(--pad) calc(var(--pad) * 0.5);
		box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
		border-radius: 4px;
	}

	.page::before {
		border-radius: 4px 4px 0 0;
	}

	pre {
		width: 100%;
		padding: 15px;
		font-size: 14px;
	}
}
