:root {
	--background-color: #f9f9f9;
	--card-background: #ffffff;
	--text-color-primary: #1d1d1f;
	--text-color-secondary: #515154;
	--accent-blue: #007aff;
	--accent-blue-darker: #0060c6;
	--border-color: #e0e0e0;
	--header-background: rgba(255, 255, 255, 0.8);
}

@media (prefers-color-scheme: dark) {
	:root {
		--background-color: #1c1c1e;
		--card-background: #2c2c2e;
		--text-color-primary: #ffffff;
		--text-color-secondary: #aeaeb2;
		--accent-blue: #0a84ff;
		--accent-blue-darker: #359dff;
		--border-color: #38383a;
		--header-background: rgba(28, 28, 30, 0.7);
	}
}

/* General Body Styles */
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	background-color: var(--background-color);
	color: var(--text-color-primary);
	line-height: 1.6;
	margin: 0;
	padding: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.container {
	width: 90%;
	margin: 0 auto;
	max-width: 1100px;
}

/* Typography */
h1,
h2,
h3,
h4 {
	font-weight: 600;
	color: var(--text-color-primary);
	line-height: 1.3;
}

h1 {
	font-size: 2.5rem;
}

h2 {
	font-size: 2rem;
}

h3 {
	font-size: 1.5rem;
}

p {
	color: var(--text-color-secondary);
	font-size: 1.1rem;
}

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

a:hover {
	text-decoration: underline;
}

/* Header */
header {
	background: var(--header-background);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: 1rem 0;
	border-bottom: 1px solid var(--border-color);
	position: sticky;
	top: 0;
	z-index: 100;
}

header .container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

header .logo {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text-color-primary);
	text-decoration: none;
}

header nav,
header .lang-switcher {
	display: flex;
	align-items: center;
}

header nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
}

header nav ul li {
	margin-left: 25px;
}

header nav ul li a {
	color: var(--text-color-primary);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s ease;
}

header nav ul li a:hover {
	color: var(--accent-blue);
	text-decoration: none;
}

/* CTO link with small-caps */
header nav ul li a[href*="/cto"] {
	font-variant: small-caps;
	letter-spacing: 0.1em;
	font-size: 0.9rem;
}

.lang-switcher {
	margin-left: 20px;
}

.lang-switcher a,
.lang-switcher span {
	color: var(--text-color-secondary);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.9rem;
	transition: color 0.3s;
}

.lang-switcher a:hover {
	color: var(--accent-blue);
	text-decoration: none;
}

.lang-switcher span {
	color: var(--text-color-primary);
	font-weight: 700;
}

/* Main Content */
main {
	padding: 60px 0;
	flex-grow: 1;
}

/* Sections & Cards */
section {
	margin-bottom: 60px;
}

#hero {
	text-align: center;
	padding: 40px 0;
}

#hero h1 {
	margin-bottom: 20px;
}

#hero p {
	max-width: 600px;
	margin: 0 auto 30px auto;
}

.feature,
.service-item,
.workshop-item,
.case-item,
.member,
.contact-item {
	background-color: var(--card-background);
	padding: 30px;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	margin-bottom: 25px;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

.feature:hover,
.service-item:hover,
.workshop-item:hover,
.case-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
	.feature,
	.service-item,
	.workshop-item,
	.case-item,
	.member,
	.contact-item {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}

	.feature:hover,
	.service-item:hover,
	.workshop-item:hover,
	.case-item:hover {
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	}
}

#features,
#service-list,
#workshop-list,
#contact-details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 30px;
}

/* Case studies layout */
#case-list {
	display: block;
}

.case-featured {
	width: 100%;
	margin-bottom: 40px;
	box-sizing: border-box;
	display: flex;
	gap: 2rem;
	align-items: center;
	background: var(--card-background);
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.case-featured-content {
	flex: 1;
}

.case-featured-image {
	flex: 0 0 400px;
	max-width: 400px;
}

.case-featured-image img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

@media (max-width: 768px) {
	.case-featured {
		flex-direction: column;
	}

	.case-featured-image {
		flex: none;
		width: 100%;
		max-width: none;
	}
}

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

/* Case items with background images */
.case-grid .case-item {
	position: relative;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	min-height: 300px;
	cursor: pointer;
	transition: transform 0.3s ease;
}

.case-grid .case-item:hover {
	transform: translateY(-5px);
}

.case-grid .case-item::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.6) 0%,
		rgba(0, 0, 0, 0.9) 100%
	);
	z-index: 1;
}

@media (prefers-color-scheme: dark) {
	.case-grid .case-item::before {
		background: linear-gradient(
			to bottom,
			rgba(0, 0, 0, 0.6) 0%,
			rgba(0, 0, 0, 0.9) 100%
		);
	}
}

.case-grid .case-item > * {
	position: relative;
	z-index: 2;
}

.case-grid .case-item h2,
.case-grid .case-item p {
	color: #ffffff;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.case-grid .case-item .btn {
	color: white;
    border-color: white;
}

.case-grid .case-item .btn:hover {
	background-color: #ffffff;
	color: #1d1d1f;
}

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

.service-item ul {
	list-style: none;
	padding-left: 0;
}

.service-item ul li::before {
	content: "✓";
	color: var(--accent-blue);
	margin-right: 10px;
}

/* Buttons */
.btn {
	display: inline-block;
	background-color: transparent;
	color: var(--accent-blue);
	padding: 10px 20px;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 500;
	transition: all 0.2s ease;
	border: 1px solid var(--accent-blue);
	font-size: 0.9rem;
}

.btn:hover {
	background-color: var(--accent-blue);
	color: #fff;
	transform: translateY(-1px);
	text-decoration: none;
}

.buttons .btn {
	margin: 0 10px;
}

/* Button in forms */
form button[type="submit"],
form .btn {
	width: auto;
	cursor: pointer;
	border: none;
}

/* Forms */
form {
	background: var(--card-background);
	padding: 40px;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: var(--text-color-primary);
}
form input[type="text"],
form input[type="email"],
form select,
form textarea {
	width: 100%;
	padding: 12px;
	margin-bottom: 20px;
	border-radius: 8px;
	border: 1px solid var(--border-color);
	font-size: 1rem;
	box-sizing: border-box;
	background-color: var(--card-background);
	color: var(--text-color-primary);
	font-family: inherit;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

form select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23515154' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	padding-right: 36px;
	cursor: pointer;
}

form textarea {
	resize: vertical;
	min-height: 100px;
	font-family: inherit;
}

@media (prefers-color-scheme: dark) {
	form {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}

	form input[type="text"],
	form input[type="email"],
	form select,
	form textarea {
		background-color: var(--background-color);
		border-color: var(--border-color);
	}

	form select {
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23aeaeb2' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	}

	form input[type="text"]:focus,
	form input[type="email"]:focus,
	form select:focus,
	form textarea:focus {
		outline: 2px solid var(--accent-blue);
		outline-offset: -2px;
		border-color: var(--accent-blue);
	}
}

/* Footer */
footer {
	background: var(--card-background);
	color: var(--text-color-secondary);
	padding: 3rem 0;
	margin-top: 60px;
	border-top: 1px solid var(--border-color);
	text-align: center;
}

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

footer .footer-row-top {
	display: flex;
	justify-content: space-around;
	align-items: flex-start;
	width: 100%;
}

footer .footer-col {
	flex: 1;
	margin: 0 20px;
}

footer .footer-legal {
	margin-top: 2rem;
}

footer h4 {
	color: var(--text-color-primary);
	border: none;
	margin-bottom: 15px;
	font-size: 1rem;
	font-weight: 600;
}

footer ul {
	list-style: none;
	padding: 0;
}

footer ul li {
	margin-bottom: 8px;
}

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

footer ul li a:hover {
	color: var(--accent-blue);
	text-decoration: underline;
}

footer p {
	font-size: 0.9rem;
}

/* Team Section */
#team {
	margin-top: 60px;
}

.team-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 30px;
	margin-top: 30px;
}

.member {
	background: var(--card-background);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 20px;
	text-align: center;
	transition: box-shadow 0.3s ease;
}

.member:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.member h3 {
	margin-bottom: 0.5rem;
	color: var(--text-color-primary);
}

.member .position {
	color: var(--text-color-secondary);
	font-size: 0.9rem;
	margin: 0;
}

@media (prefers-color-scheme: dark) {
	.member {
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	}

	.member:hover {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}
}

/* Blog Styles */
.blog-list {
	margin-top: 2rem;
}

.blog-item {
	background: var(--card-background);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
	transition: box-shadow 0.3s ease;
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
}

.blog-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-item-image {
	flex: 0 0 200px;
}

.blog-item-image img {
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: 8px;
}

.blog-item-content {
	flex: 1;
	min-width: 0;
}

.blog-item h2 {
	margin-top: 0;
	margin-bottom: 0.5rem;
	color: var(--text-color-primary);
}

.blog-item .date {
	color: var(--text-color-secondary);
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

.blog-item .read-more {
	color: var(--accent-blue);
	font-weight: 500;
	text-decoration: none;
}

.blog-item .read-more:hover {
	text-decoration: underline;
}

.blog-footer {
	margin-top: 3rem;
	padding-top: 2rem;
}

.blog-footer hr {
	border: none;
	border-top: 1px solid var(--border-color);
	margin-bottom: 1.5rem;
}

.blog-footer p {
	color: var(--text-color-secondary);
}

.blog-footer a {
	color: var(--accent-blue);
	font-weight: 500;
}

article .date {
	color: var(--text-color-secondary);
	font-size: 0.9rem;
	margin-bottom: 1.5rem;
}

@media (prefers-color-scheme: dark) {
	.blog-item {
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	}

	.blog-item:hover {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}
}

/* CTO page styles */
.cto-hero {
	display: flex;
	align-items: center;
	gap: 2rem;
	margin-bottom: 2rem;
}

.cto-avatar {
	flex: 0 0 200px;
}

.cto-avatar img {
	width: 100%;
	border-radius: 50%;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cto-content {
	flex: 1;
}

.cto-content h1 {
	margin: 0 0 0.5rem 0;
}

.cto-content p {
	margin: 0;
}

/* Blog header image */
.blog-header-image {
	margin: 2rem auto;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	max-width: 800px;
}

.blog-header-image img {
	width: 100%;
	height: auto;
	display: block;
	max-height: 400px;
	object-fit: cover;
}

@media (max-width: 768px) {
	.blog-header-image {
		margin: 1.5rem auto;
		max-width: 100%;
	}

	.blog-header-image img {
		max-height: 250px;
	}
}

/* Blog navigation */
.blog-nav-top {
	margin-bottom: 2rem;
}

.back-to-blog {
	color: var(--accent-blue);
	text-decoration: none;
	font-size: 0.95em;
	font-weight: 500;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.back-to-blog .arrow {
	font-size: 1.2em;
	transition: transform 0.2s ease;
}

.back-to-blog:hover {
	color: var(--accent-blue-darker);
}

.back-to-blog:hover .arrow {
	transform: translateX(-3px);
}

.blog-nav-bottom {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border-color);
}

.nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

.nav-prev {
	text-align: left;
}

.nav-next {
	text-align: right;
}

.nav-label {
	display: block;
	font-size: 0.85em;
	color: var(--text-color-secondary);
	margin-bottom: 0.25rem;
}

.nav-prev a,
.nav-next a {
	color: var(--accent-blue);
	text-decoration: none;
	font-weight: 500;
}

.nav-prev a:hover,
.nav-next a:hover {
	text-decoration: underline;
}

@media (max-width: 768px) {
	/* General adjustments */
	body {
		font-size: 16px; /* Prevent zoom on iOS */
	}

	.container {
		max-width: 100%;
		width: 95%;
	}

	/* Header mobile optimization */
	header {
		padding: 0.75rem 0;
		position: static;
	}

	header .container {
		flex-wrap: wrap;
		gap: 0.75rem;
	}

	/* Logo optimization */
	header .logo {
		font-size: 1.2rem;
		padding-left: 0.5rem;
	}

	/* Navigation horizontal scroll */
	header nav {
		width: 100%;
		order: 3;
		display: flex;
		align-items: center;
		gap: 1rem;
		background: rgba(255, 255, 255, 0.7);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		margin: 0 -2.5%;
		padding: 0.5rem 2.5%;
		border-radius: 8px;
		perspective: 800px;
		perspective-origin: center center;
		height: 3rem;
		overflow: hidden;
	}

	@media (prefers-color-scheme: dark) {
		header nav {
			background: rgba(28, 28, 30, 0.7);
		}
	}

	/* Navigation list container with gradients */
	header nav ul {
		position: relative;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding: 0.25rem 0;
		margin: 0;
		gap: 0.4rem;
		flex: 1;
		touch-action: pan-x;
		will-change: scroll-position;
	}

	/* Gradient overlays for scroll fade effect */
	header nav ul::before,
	header nav ul::after {
		content: '';
		position: fixed;
		top: 0;
		bottom: 0;
		width: 20px;
		pointer-events: none;
		z-index: 1;
	}

	header nav ul::before {
		left: 0;
		background: linear-gradient(to right, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
	}

	header nav ul::after {
		right: 78px;
		background: linear-gradient(to left, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
	}

	@media (prefers-color-scheme: dark) {
		header nav ul::before {
			background: linear-gradient(to right, rgba(28, 28, 30, 0.7), rgba(28, 28, 30, 0));
		}
		header nav ul::after {
			background: linear-gradient(to left, rgba(28, 28, 30, 0.7), rgba(28, 28, 30, 0));
		}
	}

	header nav ul::-webkit-scrollbar {
		display: none;
	}

	header nav ul li {
		margin: 0;
		flex-shrink: 0;
		transform: perspective(200px) rotateY(-30deg) translateX(-5px);
		transform-origin: left center;
		transition: transform 0.2s ease;
	}

	header nav ul li a {
		white-space: nowrap;
		padding: 0.25rem 0.5rem;
		display: inline-block;
		transition: all 0.2s ease;
		position: relative;
		text-shadow: 1px 0 3px rgba(0, 0, 0, 0.2);
	}

	header nav ul li:hover {
		transform: perspective(200px) rotateY(-35deg) translateX(-10px);
	}

	header nav ul li + li {
		margin-left: -0.5rem; /* Overlap items slightly */
	}

	.lang-switcher {
		margin-left: 0;
		margin-right: 0;
		order: 2;
		flex-shrink: 0;
		white-space: nowrap;
	}

	/* Main content spacing */
	main {
		padding: 30px 0;
	}

	section {
		margin-bottom: 40px;
	}

	/* Typography optimization */
	h1 {
		font-size: 2rem;
	}

	h2 {
		font-size: 1.6rem;
	}

	h3 {
		font-size: 1.3rem;
	}

	p {
		font-size: 1rem;
	}

	/* Cards and items padding reduction */
	.feature,
	.service-item,
	.workshop-item,
	.case-item,
	.member,
	.contact-item {
		padding: 20px;
		margin-bottom: 20px;
	}

	/* Hero sections */
	#hero {
		padding: 20px 0;
	}

	#hero p {
		margin-bottom: 20px;
	}

	/* Footer mobile optimization */
	footer {
		padding: 2rem 0;
		margin-top: 40px;
	}

	footer .footer-row-top {
		margin-bottom: 1.5rem;
		gap: 2rem;
	}

	footer .footer-row-top .footer-col {
		text-align: center;
		margin: 0;
	}

	/* Legal info full width below */
	footer .footer-legal {
		text-align: center;
		border-top: 1px solid var(--border-color);
		padding-top: 1.5rem;
		margin: 0;
		width: 100%;
	}

	/* Forms optimization */
	form {
		padding: 25px;
	}

	form button[type="submit"],
	form .btn {
		width: 100%;
		padding: 14px 24px;
	}

	form input[type="text"],
	form input[type="email"],
	form select,
	form textarea {
		font-size: 16px; /* Prevent zoom on iOS */
		padding: 14px;
	}

	/* CTO page mobile */
	.cto-hero {
		flex-direction: column;
		text-align: center;
	}

	.cto-avatar {
		flex: none;
		width: 150px;
		margin: 0 auto 1.5rem;
	}

	.cto-content {
		flex: none;
	}

	/* Hide CTO page title on mobile */
	article > h1:first-child {
		display: none;
	}

	/* Blog navigation */
	.nav-links {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.nav-next {
		text-align: left;
	}

	.blog-item {
		flex-direction: column;
	}

	.blog-item-image {
		flex: none;
		width: 100%;
	}

	.blog-item-image img {
		height: 200px;
	}
}
