html {
	color: #222;
	font-size: 1em;
	line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
	background: #3498db;
	text-shadow: none;
}

::selection {
	background: #3498db;
	text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
	display: block;
	height: 1px;
	border: 0;
	border-top: 1px solid #444;
	margin: 1em 0;
	padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
	vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
	resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

:root {
	--primary-color: #1a2530;
	--secondary-color: #3498db;
	--text-color: #e0e0e0;
	--light-bg: #2a2a2a;
	--dark-bg: #1a1a1a;
	--link-color: #4dabf7;
	--link-hover: #74c0fc;

	/* App-specific colors */
	--fasttrack-color: #7E14DC;
	--hammer-color: #FF4B05;
	--snapsafe-color: #3DDC84;
	--support-color: #8d271c;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	color: var(--text-color);
	line-height: 1.6;
	margin: 0;
	padding: 0;
	background-color: var(--dark-bg);
}

p {
	text-indent: 2em;
}

/* Indent text after line breaks */
.line-break-indent {
	display: inline-block;
	padding-left: 2em;
	text-indent: 0;
}

/* Don't indent tag lines */
p.tag-line {
	text-indent: 0;
}

/* Don't indent paragraphs in specific contexts */
.app-description p:nth-child(2) {
	text-indent: 0; /* This targets the website link paragraphs */
}

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

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

.container {
	width: 90%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 15px;
}

/* Header Styles */
header {
	background-color: var(--primary-color);
	color: white;
	padding: 2rem 0;
	text-align: center;
}

.header-logo {
	max-width: 200px;
	height: auto;
	margin-bottom: 1rem;
}

header h1 {
	margin: 0;
	font-size: 2.5rem;
}

header .tagline {
	font-size: 1.2rem;
	margin-top: 0.5rem;
}

@media (max-width: 768px) {
	.header-logo {
		max-width: 150px;
	}
}

/* Navigation Styles */
.main-nav {
	margin-top: 1.5rem;
}

.main-nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	justify-content: center;
	gap: 2rem;
}

.main-nav li {
	display: inline-block;
}

.main-nav a {
	color: white;
	text-decoration: none;
	font-size: 1.1rem;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	transition: all 0.3s ease;
	position: relative;
}

.main-nav a::after {
	content: '';
	position: absolute;
	width: 30%;
	height: 3px;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	transition: width 0.3s ease;
	border-radius: 2px;
}

/* App-specific underline colors */
.main-nav a[href="#appFastTrack"]::after {
	background-color: var(--fasttrack-color);
}

.main-nav a[href="#appHammer"]::after {
	background-color: var(--hammer-color);
}

.main-nav a[href="#appSnapSafe"]::after {
	background-color: var(--snapsafe-color);
}

.main-nav a[href="#supportDev"]::after {
	background-color: var(--support-color);
}

.main-nav a[href="#libraries"]::after {
	background-color: var(--secondary-color);
}

.main-nav a:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.main-nav a:hover::after {
	width: 80%; /* Width of the underline on hover */
}

@media (max-width: 768px) {
	.main-nav ul {
		flex-direction: column;
		gap: 0.5rem;
	}

	.main-nav a {
		display: block;
		text-align: center;
	}

	/* Adjust underline for mobile */
	.main-nav a::after {
		bottom: -2px;
		height: 2px;
	}

	.main-nav a:hover::after {
		width: 60%; /* Slightly smaller width on mobile */
	}
}

/* Intro Section */
.intro {
	background-color: #222222;
	padding: 2rem 0;
	text-align: center;
	font-size: 1.1rem;
}

/* App Sections */
.app {
	padding: 3rem 0;
	border-bottom: 1px solid #333;
	position: relative;
}

.app:nth-child(even) {
	background-color: #252525;
}

/* App divider lines */
.app::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background-color: #333; /* Default color */
}

#appFastTrack::before {
	background-color: var(--fasttrack-color);
}

#appHammer::before {
	background-color: var(--hammer-color);
}

#appSnapSafe::before {
	background-color: var(--snapsafe-color);
}

#supportDev::before {
	background-color: var(--support-color);
}

.app h2 {
	color: var(--text-color);
	margin: 0 0 1.5rem 0;
	font-size: 2rem;
}

/* App Grid Layout */
.app-grid {
	display: grid;
	grid-template-columns: 1fr 2fr 2fr;
	gap: 2rem;
	align-items: start;
	position: relative;
}

/* Left Column - Logo with Blurred Background */
.app-logo-column {
	position: relative;
	height: 100%;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	width: 100%;
}

.app-logo {
	position: relative;
	z-index: 2;
	margin: 20px;
}

.app-logo-image {
	width: 100%;
	height: auto;
	max-height: 256px;
	object-fit: contain;
	display: block;
}

.app-logo-column::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-size: cover;
	background-position: center;
	filter: blur(20px);
	opacity: 0.7;
	z-index: 1;
	transform: scale(1.1);
}

#appFastTrack .app-logo-column::before {
	background-image: url('../img/fasttrack/app_logo.png');
}

#appHammer .app-logo-column::before {
	background-image: url('../img/hammer/app_logo.png');
}

#appSnapSafe .app-logo-column::before {
	background-image: url('../img/snapsafe/app_logo.png');
}

/* Support Dev section gradient background */
#supportDev .app-logo-column::before {
	background-image: none;
	background: linear-gradient(135deg, var(--support-color), #914f00); /* Gradient from Patreon color to orange */
	opacity: 0.9;
}

/* Middle Column - Info */
.app-info-column {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
}

.support-info-column {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	grid-column: 2 / span 2;
}

.app-description {
	margin-bottom: 2rem;
	font-size: 1.1rem;
}

.tag-line {
	font-size: 1.2rem;
	font-weight: bold;
}

.app-links {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-top: auto;
}

/* Right Column - Screenshot Carousel */
.app-screenshots-column {
	position: relative;
	height: 100%;
}

.screenshot-carousel {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	background: linear-gradient(to bottom, rgba(60, 60, 60, 0.2), rgba(20, 20, 20, 0.6));
	height: 100%;
	min-height: 256px;
}

.carousel-slides {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.screenshot {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 0;
	box-shadow: none;
	display: none; /* Initially hidden, JS will show the active one */
}

.carousel-controls {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	transform: translateY(-50%);
	padding: 0 10px;
}

.carousel-prev,
.carousel-next {
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.3s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
	background-color: rgba(0, 0, 0, 0.8);
}

.github-link, .store-link, .fdroid-link, .patreon-link {
	display: inline-block;
	padding: 10px 20px;
	background-color: var(--link-color);
	color: white;
	text-decoration: none;
	border-radius: 4px;
	font-weight: bold;
	transition: background-color 0.3s ease;
	position: relative;
	padding-left: 40px;
}

.github-link:hover, .store-link:hover, .fdroid-link:hover, .patreon-link:hover {
	background-color: var(--link-hover);
	color: #000000;
}

.github-link::before, .store-link::before, .fdroid-link::before, .patreon-link::before {
	content: '';
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.github-link::before {
	background-image: url('../img/icons/logo-github.svg');
}

.store-link::before {
	background-image: url('../img/icons/logo-googleplay.svg');
	width: 48px;
	height: 48px;
	left: 0;
}

.fdroid-link::before {
	background-image: url('../img/icons/logo-fdroid.svg');
}

.patreon-link::before {
	background-image: url('../img/icons/logo-patreon.png');
}

.support-emoji {
	font-size: 5rem;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100%;
}

/* Libraries Section */
.libraries {
	padding: 3rem 0 5rem 0;
	background-color: #252525;
	border-bottom: 1px solid #333;
	position: relative;
}

.libraries::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background-color: var(--secondary-color);
}

.libraries h2 {
	color: var(--text-color);
	margin: 0 0 2rem 0;
	font-size: 2rem;
	text-align: center;
}

.libraries-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
	row-gap: 4rem; /* Increased vertical gap to prevent overlap when wrapping */
}

.library-entry {
	background-color: var(--light-bg);
	border-radius: 8px;
	padding: 1.5rem;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.library-entry:hover {
	transform: translateY(-5px);
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.library-github-link {
	display: flex;
	align-items: center;
	color: var(--text-color);
	text-decoration: none;
	margin-bottom: 1rem;
	position: relative;
	padding-left: 35px;
}

.library-github-link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	background-image: url('../img/icons/logo-github.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.library-title {
	font-size: 1.3rem;
	font-weight: bold;
	margin: 0;
}

.library-description {
	margin: 0.5rem 0 1rem 0;
	flex-grow: 1;
}

.license-chip {
	display: inline-block;
	background-color: #2a9d8f;
	color: white;
	padding: 0.3rem 0.8rem;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: bold;
	align-self: flex-start;
}

/* Library Support Card */
.library-support {
	background-color: var(--light-bg);
	border-radius: 8px;
	padding: 1.5rem;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	height: 100%;
	color: var(--text-color);
	text-decoration: none;
	cursor: pointer;
}

.library-support:hover {
	transform: translateY(-5px);
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
	color: var(--text-color);
	text-decoration: none;
}

.library-support h3 {
	margin-top: 0;
	margin-bottom: 1rem;
	font-size: 1.3rem;
	color: var(--text-color);
}

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

	.library-entry {
		text-align: left;
	}

	.library-github-link {
		justify-content: center;
		padding-left: 0;
		padding-top: 30px;
	}

	.library-github-link::before {
		left: 50%;
		top: 0;
		transform: translateX(-50%);
	}

	.license-chip {
		align-self: flex-start;
	}

	.library-support {
		/* Keep centered alignment on mobile */
		text-align: center;
	}

	.library-support iframe {
		margin: 0 auto;
	}
}

/* Footer Styles */
footer {
	background-color: var(--dark-bg);
	color: white;
	padding: 2rem 0;
	text-align: center;
}

footer a {
	color: var(--secondary-color);
	text-decoration: none;
}

footer a:hover {
	text-decoration: underline;
}

/* Responsive Styles */
@media (min-width: 1200px) {
	.app-logo-column {
		width: 100%;
		margin-left: 0;
	}
}

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

	.app-logo-column {
		grid-column: 1;
		grid-row: 1;
		margin-left: 0;
		width: 100%;
	}

	.app-info-column {
		grid-column: 2;
		grid-row: 1;
	}

	.app-screenshots-column {
		grid-column: 1 / span 2;
		grid-row: 2;
		margin-top: 2rem;
	}
}

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

	.app-logo-column {
		grid-column: 1;
		grid-row: 1;
		width: 100%;
		margin-left: 0;
		border-radius: 8px;
	}

	.app-info-column {
		grid-column: 1;
		grid-row: 2;
		text-align: center;
	}

	.app-description {
		text-align: left;
	}

	.app-screenshots-column {
		grid-column: 1;
		grid-row: 3;
		margin-top: 1.5rem;
	}

	.app h2 {
		text-align: center;
	}

	.app-links {
		justify-content: center;
	}

	.github-link, .store-link, .fdroid-link, .patreon-link {
		width: 80%;
		text-align: center;
		margin-bottom: 10px;
	}
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
	display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
	border: 0;
	clip: rect(0, 0, 0, 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
	/* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
	clip: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	position: static;
	white-space: inherit;
	width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
	visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
	content: "";
	display: table;
}

.clearfix::after {
	clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
	/* Style adjustments for viewports that meet the condition */
}

@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
	/* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
	*,
	*::before,
	*::after {
		background: #fff !important;
		color: #000 !important;
		/* Black prints faster */
		box-shadow: none !important;
		text-shadow: none !important;
	}

	a,
	a:visited {
		text-decoration: underline;
	}

	a[href]::after {
		content: " (" attr(href) ")";
	}

	abbr[title]::after {
		content: " (" attr(title) ")";
	}

	/*
	 * Don't show links that are fragment identifiers,
	 * or use the `javascript:` pseudo protocol
	 */
	a[href^="#"]::after,
	a[href^="javascript:"]::after {
		content: "";
	}

	pre {
		white-space: pre-wrap !important;
	}

	pre,
	blockquote {
		border: 1px solid #999;
		page-break-inside: avoid;
	}

	tr,
	img {
		page-break-inside: avoid;
	}

	p,
	h2,
	h3 {
		orphans: 3;
		widows: 3;
	}

	h2,
	h3 {
		page-break-after: avoid;
	}
}
