/* Google Fonts: Newsreader (elegant editorial serif) and Inter (clean sans-serif) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,700;1,6..72,400&display=swap');

:root {
	--bg-color: #fbfaf8;
	--text-light: #fff;
	--text-dark: #1a1a1a;
	--text-muted: #66605c;
	--accent-color: #b83a26;
	--border-color: #e5ded8;
	--border-dark: #1a1a1a;
	--font-serif: 'Newsreader', Georgia, serif;
	--font-sans: 'Inter', system-ui, sans-serif;
	--workspace-bg: #ffffff;
	--badge-beta-bg: #FFF6D8;
	--badge-beta-color: #7A5A00;
	--badge-coming-soon-bg: #F5F5F5;
	--badge-coming-soon-color: #666666;
	--badge-archived-bg: #F1F1F1;
	--badge-archived-color: #999999;
	--badge-type-border-color: #d4d4d4;
}

.dark-theme {
	--bg-color: #121110;
	--text-dark: #e8e5e0;
	--text-muted: #a09a95;
	--accent-color: #e0533c;
	--border-color: #2c2a28;
	--border-dark: #e8e5e0;
	--workspace-bg: #1c1a19;
	--badge-beta-bg: #382d1a;
	--badge-beta-color: #ffd166;
	--badge-coming-soon-bg: #292827;
	--badge-coming-soon-color: #a8a4a0;
	--badge-archived-bg: #21201f;
	--badge-archived-color: #8c8884;
	--badge-type-border-color: #403e3c;
}

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

/* reset ul, li back to default*/
ul {
	list-style: initial;
}

li {
	margin: 5px 20px;
}

button,
input,
select,
textarea {
	font-family: inherit;
}

html,
body {
	background-color: var(--bg-color);
}

body {
	color: var(--text-dark);
	font-family: var(--font-sans);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	padding: 0 20px;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

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

/* Smooth theme transition class - applied only during active toggling */
.theme-transition,
.theme-transition * {
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

.container {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 40px 0 0 0;
	flex: 1;
}

/* Header */
header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--border-color);
	margin-bottom: 50px;
}

.logo-group {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.logo {
	font-family: var(--font-serif);
	font-size: 24px;
	font-weight: 700;
	text-decoration: none;
	color: var(--text-dark);
	letter-spacing: -0.5px;
}

.logo-sub {
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--text-muted);
}

nav {
	display: flex;
	gap: 24px;
}

nav a {
	font-size: 13px;
	font-weight: 400;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.2s ease;
	position: relative;
	padding-bottom: 4px;
}

nav a:hover,
nav a.active {
	color: var(--text-dark);
}

nav a.active::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background-color: var(--accent-color);
}

.block {
	display: block;
}

/* Hero Section */
.hero {
	margin-bottom: 45px;
}

.hero-desc {
	font-family: var(--font-serif);
	font-size: 20px;
	line-height: 1.6;
	color: var(--text-dark);
	margin-bottom: 20px;
}

.title {
	margin: 10px 0;
}

details {
	margin: 10px 0;
	padding: 5px 0;
}


/* Headers will always be the header with fancy sans-serif styling */
h1,
h2 {
	font-family: var(--font-serif);
	font-size: 30px;
	line-height: 1.1;
	font-weight: 500;
	max-width: 800px;
}

h1 {
	font-size: 64px;
	margin-bottom: 14px;
}

h1 span.accent {
	color: var(--accent-color);
}

/* Divider block */
.section-divider {
	border: none;
	border-top: 2px solid var(--border-dark);
	margin-bottom: 24px;
}

.section-divider-light {
	border: none;
	border-top: 1px solid var(--border-color);
	margin: 30px 0;
}

/* Articles */
#articles ul {
	margin: 24px 0;
	list-style: none;
}

#articles ul li {
	font-family: var(--font-serif);
	line-height: 1.1;
	font-weight: 500;
	margin-bottom: 10px;
	list-style: none;
}

.metric-val.accent {
	color: var(--accent-color);
}

.metric-desc {
	font-size: 12px;
	color: var(--text-muted);
	line-height: 1.4;
}

/* Table Style Section */
.section-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 16px;
}

.section-title {
	font-family: var(--font-serif);
	font-size: 20px;
	color: var(--text-dark);
}

.section-meta {
	font-size: 11px;
	color: var(--text-muted);
	text-transform: uppercase;
}

.table-container {
	overflow-x: auto;
	margin-bottom: 40px;
}

.editorial-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.editorial-table th {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--text-muted);
	padding: 12px 16px;
	border-bottom: 1px solid var(--border-dark);
}

.editorial-table th:first-child,
.editorial-table td:first-child {
	padding-left: 0;
}

.editorial-table th:last-child,
.editorial-table td:last-child {
	padding-right: 0;
	text-align: right;
}

.editorial-table td {
	padding: 18px 16px;
	border-bottom: 1px solid var(--border-color);
	vertical-align: middle;
}

.app-type-badge {
	font-size: 9px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--accent-color);
	background-color: rgba(184, 58, 38, 0.08);
	padding: 2px 6px;
	border-radius: 2px;
	display: inline-block;
	margin-bottom: 4px;
}

.app-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--text-dark);
	margin-bottom: 2px;
}

.app-desc,
.app-platform {
	font-size: 13px;
	color: var(--text-muted);
}

.app-status {
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	color: #3b7a57;
	/* soft green */
}

.app-action-btn {
	font-size: 12px;
	font-weight: 600;
	color: var(--accent-color);
	text-decoration: none;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: opacity 0.2s;
}

.app-action-btn:hover {
	text-decoration: underline;
	opacity: 0.8;
}

/* Active Workspace Modal Overlay */
.workspace-section {
	display: none;
	/* Controlled by JS */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(26, 26, 26, 0.3);
	backdrop-filter: blur(2px);
	z-index: 1000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.workspace-modal {
	background-color: var(--workspace-bg);
	border: 2px solid var(--border-dark);
	width: 100%;
	max-width: 900px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 30px;
	position: relative;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.workspace-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 15px;
	margin-bottom: 24px;
}

.workspace-title-group {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.workspace-title {
	font-family: var(--font-serif);
	font-size: 22px;
	font-weight: 700;
}

.workspace-badge {
	font-size: 9px;
	font-weight: 600;
	text-transform: uppercase;
	background-color: var(--text-dark);
	color: #ffffff;
	padding: 1px 5px;
	border-radius: 2px;
}

.workspace-close-btn {
	background: none;
	border: none;
	font-size: 18px;
	cursor: pointer;
	color: var(--text-muted);
}

.workspace-close-btn:hover {
	color: var(--text-dark);
}

/* Interactive App Layouts */
.tool-container {
	display: none;
}

.tool-container.active {
	display: block;
}

/* Grid within tool */
.tool-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

@media (max-width: 768px) {
	.tool-grid {
		grid-template-columns: 1fr;
	}
}

.form-group {
	margin-bottom: 16px;
}

.form-group label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 6px;
}

.textarea-input,
.text-input {
	width: 100%;
	font-size: 13px;
	padding: 10px;
	border: 1px solid var(--border-color);
	background-color: var(--bg-color);
	color: var(--text-dark);
	outline: none;
	resize: vertical;
	transition: border-color 0.2s;
}

.textarea-input:focus,
.text-input:focus {
	border-color: var(--border-dark);
}

.tool-actions {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.btn-primary,
.btn-secondary {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	padding: 16px;
	cursor: pointer;
}

.btn-primary {
	background-color: var(--accent-color);
	color: #ffffff;
	border: 1px solid var(--accent-color);
	transition: background-color 0.2s, color 0.2s;
}

.btn-primary:hover {
	background-color: transparent;
	color: var(--text-dark);
}

.btn-secondary {
	background-color: transparent;
	color: var(--text-dark);
	border: 1px solid var(--border-color);
	transition: border-color 0.2s;
}

.btn-secondary:hover {
	border-color: var(--border-dark);
}

.output-container {
	border: 1px dashed var(--border-color);
	background-color: var(--bg-color);
	padding: 16px;
	font-size: 13px;
	min-height: 180px;
	max-height: 300px;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-all;
}

/* Image compressor specific dropzone */
.dropzone {
	border: 2px dashed var(--border-color);
	padding: 30px;
	text-align: center;
	cursor: pointer;
	background-color: var(--bg-color);
	transition: border-color 0.2s;
}

.dropzone:hover {
	border-color: var(--border-dark);
}

.dropzone p {
	font-size: 13px;
	color: var(--text-muted);
}

.preview-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.preview-box {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	background-color: var(--bg-color);
	border: 1px solid var(--border-color);
}

.preview-img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border: 1px solid var(--border-color);
}

.preview-info {
	flex: 1;
	font-size: 12px;
	color: var(--text-muted);
}

.preview-name {
	font-weight: 600;
	color: var(--text-dark);
	margin-bottom: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 180px;
}

/* Contact Form Grid */
.contact-section {
	max-width: 700px;
}

@media (max-width: 768px) {}

.contact-info h2 {
	font-family: var(--font-serif);
	font-size: 28px;
	margin-bottom: 16px;
}

.contact-info p {
	font-size: 14px;
	color: var(--text-muted);
	margin-bottom: 24px;
}

.contact-details {
	list-style: none;
	font-size: 13px;
}

.contact-details li {
	margin-bottom: 10px;
}

.contact-details span {
	font-weight: 600;
	text-transform: uppercase;
	font-size: 10px;
	color: var(--text-muted);
	display: inline-block;
	width: 80px;
}

.contact-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 480px) {
	.contact-form {
		grid-template-columns: 1fr;
	}
}

.contact-form .form-group.full-width {
	grid-column: span 2;
}

@media (max-width: 480px) {
	.contact-form .form-group.full-width {
		grid-column: span 1;
	}
}

/* Alert notifications within editorial theme */
.alert-box {
	border: 1px solid var(--border-dark);
	padding: 16px;
	margin-bottom: 24px;
	font-size: 13px;
}

.alert-success {
	background-color: rgba(59, 122, 87, 0.08);
	border-color: #3b7a57;
	color: #234d35;
}

.alert-error {
	background-color: rgba(214, 40, 40, 0.08);
	border-color: #d62828;
	color: #7b1212;
}

.hp-field {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* Responsiveness overrides */
@media (max-width: 820px) {
	.metrics-grid {
		grid-template-columns: repeat(2, 1fr);
		row-gap: 24px;
	}

	.metric-col {
		padding: 0 15px;
	}

	.metric-col:nth-child(2) {
		border-right: none;
	}

	.metric-col:nth-child(3) {
		padding-left: 0;
	}

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

@media (max-width: 580px) {
	.metrics-grid {
		grid-template-columns: 1fr;
	}

	.metric-col {
		border-right: none;
		padding: 0;
		margin-bottom: 16px;
	}

	.metric-col:last-child {
		margin-bottom: 0;
	}

	header {
		flex-direction: column;
		gap: 15px;
		align-items: flex-start;
	}

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

/* Theme Toggle Button Style */
#theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.8;
	transition: opacity 0.2s ease;
}

#theme-toggle:hover {
	opacity: 1;
}

.theme-icon-container {
	width: 20px;
	height: 20px;
	overflow: hidden;
	position: relative;
}

.theme-icon {
	position: absolute;
	left: 0;
	top: 0;
	width: 20px;
	height: 20px;
	display: block;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* Light Mode state (default) */
.moon-icon {
	transform: translateY(0);
	opacity: 1;
}

.sun-icon {
	transform: translateY(20px);
	opacity: 0;
}

/* Dark Mode state */
.dark-theme .moon-icon {
	transform: translateY(20px);
	opacity: 0;
}

.dark-theme .sun-icon {
	transform: translateY(0);
	opacity: 1;
}

/* Hero Description Margin Utility */
.hero-desc {
	margin-bottom: 40px;
}

/* Info Notice Card (Billing Philosophy etc.) */
.info-notice {
	border: 1px solid var(--border-color);
	padding: 24px;
	margin-bottom: 40px;
	background-color: var(--workspace-bg);
}

.info-notice h4 {
	font-family: var(--font-serif);
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 8px;
}

.info-notice p {
	line-height: 1.5;
	font-size: 13px;
}

/* Rate Card Table Utilities */
.rate-cell {
	text-align: right;
}

.rate-value {
	font-size: 18px;
	font-weight: 700;
}

.rate-unit {
	font-size: 13px;
	font-weight: normal;
	color: var(--text-muted);
}

.rate-custom {
	font-size: 18px;
	font-weight: 600;
	color: var(--text-muted);
}

.highlight-text {
	color: var(--accent-color);
	font-weight: 500;
}

/* Philosophy / About Page Styles */

/* Select Form Dropdowns */
select.text-input {
	height: 40px;
	background-color: var(--bg-color);
}

/* Global Output Utility */
.output-container {
	user-select: all;
}

/* Form Quality Input Width */
#compression-quality {
	width: 100%;
}

/* Placeholders & Messages */
.preview-placeholder {
	font-size: 13px;
	color: var(--text-muted);
	font-style: italic;
}

.error-msg {
	font-size: 12px;
	color: var(--accent-color);
	align-self: center;
	font-weight: 500;
}

.tool-stats {
	font-size: 11px;
	color: var(--text-muted);
	align-self: center;
}

/* Card */
.card {
	padding: 24px;
	background-color: var(--workspace-bg);
	border: 1px solid var(--border-color);
}

.card img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	margin-bottom: 24px;
	background-color: var(--bg-color);
	background-image: url('assets/projects/loader.png');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 32px;
	border: 1px solid var(--border-color);
}

.card-desc {
	color: var(--text-muted);
	font-size: 13px;
	margin-bottom: 10px;
}

.card-action-btn {
	margin-top: 16px;
}

.card-action-btn a {
	text-decoration: none;
	font-size: 13px;
	font-weight: bold;
	color: var(--text-dark);
}

.card-action-btn a:hover {
	color: var(--accent-color);
}

/* Grid */
.grid {
	display: grid;

}

.grid-2 {
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
}

/* Badges */
.badge {
	display: inline-block;
	font-size: 0.8em;
	padding: 2px 8px;
	margin-right: 10px;
	border: 1px solid transparent;
}

.badge-released {
	background-color: var(--accent-color);
	color: var(--text-light);
}

.badge-beta {
	background-color: var(--badge-beta-bg);
	color: var(--badge-beta-color);
}

.badge-coming-soon {
	background-color: var(--badge-coming-soon-bg);
	color: var(--badge-coming-soon-color);
}

.badge-archived {
	background-color: var(--badge-archived-bg);
	color: var(--badge-archived-color);
}

.badge-type,
.badge-web-app,
.badge-hosted-available {
	border-color: var(--badge-type-border-color);
}

footer {
	border-top: 1px solid var(--border-color);
	padding: 2rem 0;
	text-align: center;
	font-size: 13px;
	color: var(--text-muted);
	flex-shrink: 0;
	max-width: 500px;
	margin: 24px auto 0;
}

footer small {
	display: block;
	margin-top: 6px;
	opacity: 0.8;
}

/* Individual Project Detail Layout */
.grid-project {
	display: grid;
	grid-template-columns: 2.2fr 1fr;
	gap: 40px;
}

@media (max-width: 768px) {
	.grid-project {
		grid-template-columns: 1fr;
		gap: 30px;
	}
}

.project-summary {
	font-family: var(--font-serif);
	font-size: 18px;
	line-height: 1.6;
	color: var(--text-dark);
	margin-bottom: 30px;
	white-space: pre-line;
}

/* Quick Facts List */
.facts-list {
	list-style: none;
	padding: 0;
	margin-bottom: 24px;
	border-top: 1px solid var(--border-color);
}

.facts-list li {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--border-color);
	font-size: 13px;
}

.fact-label {
	font-weight: 600;
	color: var(--text-muted);
	text-transform: uppercase;
	font-size: 10px;
}

.fact-val {
	color: var(--text-dark);
	font-weight: 500;
}

/* Features List */
.features-section {
	margin-top: 40px;
	border-top: 2px solid var(--border-dark);
	padding-top: 30px;
}

.features-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

@media (max-width: 580px) {
	.features-grid {
		grid-template-columns: 1fr;
	}
}

.feature-item {
	margin-bottom: 10px;
}

.feature-item h3 {
	font-family: var(--font-serif);
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 6px;
}

.feature-item p {
	color: var(--text-muted);
	font-size: 13px;
	line-height: 1.5;
}

/* Screenshots Gallery */
.screenshots-section {
	margin-top: 40px;
	border-top: 1px solid var(--border-color);
	padding-top: 30px;
}

.screenshots-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

@media (max-width: 580px) {
	.screenshots-grid {
		grid-template-columns: 1fr;
	}
}

.screenshot-card {
	border: 1px solid var(--border-color);
	background-color: var(--workspace-bg);
	padding: 8px;
}

.screenshot-card img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.screenshot-title {
	font-size: 10px;
	font-weight: 600;
	color: var(--text-muted);
	text-align: center;
	margin-top: 8px;
	text-transform: uppercase;
}

.project-links {
	margin-top: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.project-links .btn-primary,
.project-links .btn-secondary {
	text-align: center;
	text-decoration: none;
	display: block;
	width: 100%;
}

/* Project Image Carousel */
.project-carousel-container {
	margin-bottom: 30px;
}

.project-carousel {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background-color: var(--bg-color);
	border: 1px solid var(--border-color);
}

.carousel-track {
	width: 100%;
	height: 100%;
	position: relative;
}

.carousel-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.4s ease-in-out;
	z-index: 1;
}

.carousel-slide.active {
	opacity: 1;
	z-index: 2;
}

.carousel-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background-color: var(--bg-color);
	background-image: url('assets/projects/loader.png');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 32px;
}

.carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background-color: var(--bg-color);
	border: none;
	border-radius: 100%;
	color: var(--text-dark);
	font-size: 16px;
	padding: 8px 12px;
	cursor: pointer;
	z-index: 10;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	opacity: 0.7;
}

.carousel-nav:hover {
	opacity: 1;
	background-color: var(--accent-color);
	color: var(--text-light);
}

.carousel-nav.prev {
	left: 16px;
}

.carousel-nav.next {
	right: 16px;
}

.carousel-caption {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 10px;
	font-size: 12px;
	color: var(--text-muted);
}

.carousel-counter {
	font-family: monospace;
	font-weight: 600;
}

section h2 {
	margin-bottom: 10px;
}