/* ============================================
   MODERN PORTFOLIO - AD AGENCY AESTHETIC
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
	--color-black: #000000;
	--color-white: #ffffff;
	--color-gray-50: #fafafa;
	--color-gray-100: #f5f5f5;
	--color-gray-200: #e5e5e5;
	--color-gray-300: #d4d4d4;
	--color-gray-400: #a3a3a3;
	--color-gray-500: #737373;
	--color-gray-600: #525252;
	--color-gray-700: #404040;
	--color-gray-800: #262626;
	--color-gray-900: #171717;
	
	--color-accent: #000000;
	--color-text: #171717;
	--color-text-light: #737373;
	--color-bg: #ffffff;
	--color-bg-secondary: #fafafa;
	--color-border: #e5e5e5;
	
	--font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
	--font-signature: 'Great Vibes', cursive;
	
	--spacing-xs: 0.5rem;
	--spacing-sm: 1rem;
	--spacing-md: 1.5rem;
	--spacing-lg: 2rem;
	--spacing-xl: 3rem;
	--spacing-2xl: 4rem;
	--spacing-3xl: 6rem;
	
	--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
	--transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
	--transition-smooth: 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
	
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
	--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
	--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
	--shadow-glow: 0 0 20px rgba(0, 0, 0, 0.1);
	
	--container-width: 1280px;
	--container-padding: 2rem;
}

/* Dark Mode Variables */
[data-theme="dark"] {
	--color-black: #ffffff;
	--color-white: #0a0a0a;
	--color-gray-50: #171717;
	--color-gray-100: #262626;
	--color-gray-200: #404040;
	--color-gray-300: #525252;
	--color-gray-400: #737373;
	--color-gray-500: #a3a3a3;
	--color-gray-600: #d4d4d4;
	--color-gray-700: #e5e5e5;
	--color-gray-800: #f5f5f5;
	--color-gray-900: #fafafa;
	
	--color-accent: #ffffff;
	--color-text: #f5f5f5;
	--color-text-light: #a3a3a3;
	--color-bg: #0a0a0a;
	--color-bg-secondary: #171717;
	--color-border: #262626;
}

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

html {
	font-size: 16px;
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	scroll-padding-top: 100px;
}

body {
	font-family: var(--font-primary);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--color-text);
	background-color: var(--color-bg);
	overflow-x: hidden;
	scrollbar-width: thin;
	scrollbar-color: var(--color-gray-300) transparent;
	transition: background-color var(--transition-base), color var(--transition-base);
}

body::-webkit-scrollbar {
	width: 8px;
}

body::-webkit-scrollbar-track {
	background: transparent;
}

body::-webkit-scrollbar-thumb {
	background-color: var(--color-gray-300);
	border-radius: 4px;
	transition: background-color var(--transition-base);
}

body::-webkit-scrollbar-thumb:hover {
	background-color: var(--color-gray-400);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--color-black);
}

h1 { font-size: clamp(2.5rem, 8vw, 6rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
	margin: 0;
	color: var(--color-text-light);
	font-size: 1rem;
	line-height: 1.7;
}

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

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Container */
.container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 var(--container-padding);
	position: relative;
}

.container::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 1px;
	background: linear-gradient(to bottom, transparent 0%, var(--color-gray-200) 20%, var(--color-gray-200) 80%, transparent 100%);
	opacity: 0;
	transition: opacity var(--transition-slow);
}

@media (min-width: 1024px) {
	.container::before {
		opacity: 0.3;
	}
}

/* Navigation */
.nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background-color: rgba(255, 255, 255, 0.4);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border-bottom: 1px solid rgba(229, 229, 229, 0.4);
	transition: all var(--transition-smooth);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset;
	overflow: visible;
}

[data-theme="dark"] .nav {
	background-color: rgba(0, 0, 0, 0.4);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav.scrolled {
	background-color: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid rgba(229, 229, 229, 0.5);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .nav.scrolled {
	background-color: rgba(0, 0, 0, 0.5);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 1.25rem var(--container-padding);
	padding-bottom: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	overflow: visible;
}

.nav-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.nav-logo {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--color-black);
	transition: transform var(--transition-fast);
	position: relative;
	flex-shrink: 0;
}

.nav-logo:hover {
	transform: scale(1.05);
}

.nav-logo-text {
	display: inline-block;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%);
	color: var(--color-white);
	border-radius: 6px;
	font-weight: 700;
	box-shadow: var(--shadow-md);
	transition: all var(--transition-smooth);
	position: relative;
	overflow: hidden;
}

.nav-logo-text::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s;
}

.nav-logo:hover .nav-logo-text {
	transform: scale(1.05) rotate(2deg);
	box-shadow: var(--shadow-lg);
}

.nav-logo:hover .nav-logo-text::before {
	left: 100%;
}


.nav-links {
	display: flex;
	align-items: center;
	gap: 2.5rem;
	flex-shrink: 0;
}

.nav-link {
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--color-text);
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
	position: relative;
	padding: 0.625rem 1.25rem;
	border-radius: 10px;
	transition: all var(--transition-smooth);
	display: inline-block;
	border: 2px solid transparent;
	background: transparent;
}

.nav.scrolled .nav-link {
	text-shadow: none;
}

.nav-link:hover {
	color: var(--color-text);
	background: rgba(0, 0, 0, 0.05);
	border-color: rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

[data-theme="dark"] .nav-link:hover {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
	color: var(--color-white);
	font-weight: 600;
	background: var(--color-black);
	border-color: var(--color-black);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

[data-theme="dark"] .nav-link.active {
	color: var(--color-black);
	background: var(--color-white);
	border-color: var(--color-white);
	box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2), 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Dark mode active menu item in mobile menu */
@media (max-width: 768px) {
	[data-theme="dark"] .nav-links .nav-link.active {
		color: #ffffff !important;
		background: rgba(255, 255, 255, 0.25);
		border-color: rgba(255, 255, 255, 0.4);
		box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
	}
	
	/* Also ensure desktop dark mode active is white */
	[data-theme="dark"] .nav-link.active {
		color: #ffffff !important;
		background: rgba(255, 255, 255, 0.25);
		border-color: rgba(255, 255, 255, 0.4);
	}
}


.theme-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: transparent;
	border: 1px solid var(--color-border);
	cursor: pointer;
	padding: 0;
	transition: all var(--transition-base);
	position: relative;
	overflow: hidden;
}

.theme-toggle:hover {
	background: var(--color-gray-100);
	border-color: var(--color-gray-300);
	transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle:hover {
	background: var(--color-gray-100);
	border-color: var(--color-gray-300);
}

.theme-icon {
	position: absolute;
	width: 20px;
	height: 20px;
	transition: opacity var(--transition-base), transform var(--transition-base);
	color: var(--color-text);
}

.theme-icon-light {
	opacity: 1;
	transform: rotate(0deg);
}

.theme-icon-dark {
	opacity: 0;
	transform: rotate(90deg);
}

[data-theme="dark"] .theme-icon-light {
	opacity: 0;
	transform: rotate(-90deg);
}

[data-theme="dark"] .theme-icon-dark {
	opacity: 1;
	transform: rotate(0deg);
}

.nav-toggle {
	display: none;
	flex-direction: column;
	gap: 4px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
	justify-content: center;
	align-items: center;
	width: 32px;
	height: 32px;
	position: relative;
}

.nav-toggle span {
	width: 24px;
	height: 2.5px;
	background-color: #000000;
	transition: all var(--transition-smooth);
	border-radius: 2px;
	display: block;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}

[data-theme="dark"] .nav-toggle span,
[data-theme="dark"] .nav-toggle span:nth-child(1),
[data-theme="dark"] .nav-toggle span:nth-child(2),
[data-theme="dark"] .nav-toggle span:nth-child(3) {
	background-color: #ffffff !important;
}

.nav-toggle span:nth-child(1) {
	top: 8px;
}

.nav-toggle span:nth-child(2) {
	top: 50%;
	transform: translate(-50%, -50%);
}

.nav-toggle span:nth-child(3) {
	bottom: 8px;
}

/* Hero Section */
.hero {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 8rem var(--container-padding) 4rem;
	position: relative;
	overflow: hidden;
	transition: opacity var(--transition-slow), background var(--transition-base);
	opacity: 1;
	background: 
		linear-gradient(135deg, rgba(250, 250, 250, 0.95) 0%, rgba(255, 255, 255, 1) 50%, rgba(248, 248, 248, 0.98) 100%),
		radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
		radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.02) 0%, transparent 50%);
}

[data-theme="dark"] .hero {
	background: 
		linear-gradient(135deg, rgba(17, 17, 17, 0.95) 0%, rgba(10, 10, 10, 1) 50%, rgba(23, 23, 23, 0.98) 100%),
		radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
		radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
}

.hero::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: 
		radial-gradient(circle at 20% 50%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
		radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.02) 0%, transparent 50%);
	pointer-events: none;
	z-index: 0;
	animation: subtlePulse 8s ease-in-out infinite;
	transition: background var(--transition-base);
}

[data-theme="dark"] .hero::before {
	background: 
		radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
		radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
}

.hero::after {
	content: '';
	position: absolute;
	top: -50%;
	right: -10%;
	width: 600px;
	height: 600px;
	background: radial-gradient(circle, rgba(0, 0, 0, 0.03) 0%, transparent 70%);
	border-radius: 50%;
	pointer-events: none;
	z-index: 0;
	animation: float 20s ease-in-out infinite;
	transition: background var(--transition-base);
}

[data-theme="dark"] .hero::after {
	background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
}

@keyframes subtlePulse {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.8;
		transform: scale(1.05);
	}
}

@keyframes float {
	0%, 100% {
		transform: translate(0, 0) scale(1);
	}
	33% {
		transform: translate(30px, -30px) scale(1.1);
	}
	66% {
		transform: translate(-20px, 20px) scale(0.9);
	}
}

.hero-compact {
	min-height: 70vh;
	padding: 6rem var(--container-padding) 3rem;
}

/* Scroll fade effect - handled by JavaScript */

.hero-content {
	max-width: var(--container-width);
	width: 100%;
	margin: 0 auto;
	position: relative;
	z-index: 1;
	padding-left: var(--container-padding);
}

.hero-text {
	max-width: 900px;
	margin-bottom: 4rem;
}

.hero-compact .hero-text {
	margin-bottom: 2rem;
}

.hero-text {
	position: relative;
}

.hero-text::after {
	content: '';
	position: absolute;
	bottom: -2rem;
	left: 0;
	width: 60px;
	height: 2px;
	background: linear-gradient(90deg, var(--color-black) 0%, transparent 100%);
	opacity: 0;
	animation: fadeIn 1s ease-out 1.2s forwards;
}

.hero-title {
	margin-bottom: 2rem;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.03em;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
	position: relative;
}

.hero-line {
	display: block;
	opacity: 0;
	transform: translateY(30px);
	animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	will-change: transform, opacity;
}

.hero-line:nth-child(1) { animation-delay: 0.1s; }
.hero-line:nth-child(2) { 
	animation-delay: 0.2s;
	font-size: clamp(calc(2.5rem - 5px), calc(8vw - 5px), calc(6rem - 5px));
}
.hero-line:nth-child(3) { 
	animation-delay: 0.3s;
	font-size: clamp(calc(2.5rem - 5px), calc(8vw - 5px), calc(6rem - 5px));
}
.hero-line:nth-child(4) { 
	animation-delay: 0.4s;
	font-size: clamp(calc(2.5rem - 5px), calc(8vw - 5px), calc(6rem - 5px));
}

/* Reduce font size of "Making useful, usable, and desirable products." on larger screens */
@media (min-width: 1024px) {
	.hero-line:nth-child(2),
	.hero-line:nth-child(3),
	.hero-line:nth-child(4) {
		font-size: clamp(calc(2.5rem - 5px), calc(8vw - 5px), calc(6rem - 13px));
	}
}

.hero-accent {
	color: var(--color-black);
	position: relative;
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* Word Rotation Animation */
.word-rotate {
	display: inline-block;
	position: relative;
	min-width: 140px;
	text-align: left;
}

.word-rotate-text {
	display: inline-block;
	opacity: 1;
	transform: translateY(0);
}

.hero-description {
	font-size: clamp(1rem, 2vw, 1.25rem);
	max-width: 650px;
	margin-top: 2.5rem;
	opacity: 0;
	animation: fadeIn 1s ease-out 0.6s forwards;
	color: var(--color-text-light);
	line-height: 1.9;
	font-weight: 400;
	letter-spacing: -0.01em;
}

.hero-availability {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	font-size: clamp(0.95rem, 1.8vw, 1.15rem);
	color: var(--color-text-light);
	text-decoration: none;
	opacity: 0;
	animation: fadeIn 1s ease-out 0.8s forwards;
	transition: color var(--transition-fast), transform var(--transition-fast);
	max-width: fit-content;
}

.hero-availability:hover {
	color: var(--color-text);
	transform: translateX(4px);
}

.availability-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #6ee7b7;
	box-shadow: 0 0 6px rgba(110, 231, 183, 0.35);
	flex-shrink: 0;
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
		box-shadow: 0 0 6px rgba(110, 231, 183, 0.35);
	}
	50% {
		opacity: 0.75;
		box-shadow: 0 0 10px rgba(110, 231, 183, 0.5);
	}
}

.availability-text {
	line-height: 1.6;
}

.hero-follow-x {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	font-size: clamp(0.95rem, 1.8vw, 1.15rem);
	color: var(--color-text-light);
	text-decoration: none;
	opacity: 0;
	animation: fadeIn 1s ease-out 1s forwards;
	transition: color var(--transition-fast), transform var(--transition-fast);
	max-width: fit-content;
}

.hero-follow-x:hover {
	color: var(--color-text);
	transform: translateX(4px);
}

.x-logo {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	transition: transform var(--transition-fast);
	color: currentColor;
}

.hero-follow-x:hover .x-logo {
	transform: scale(1.1);
}

.follow-x-text {
	line-height: 1.6;
}

.hero-scroll {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	color: var(--color-text-light);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	opacity: 0;
	animation: fadeIn 1s ease-out 1s forwards;
	transition: opacity var(--transition-base);
	z-index: 100;
	cursor: pointer;
}

.hero-scroll.hidden {
	opacity: 0 !important;
	pointer-events: none;
}

.hero-scroll svg {
	animation: bounce 2s infinite;
}

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

@keyframes fadeIn {
	to {
		opacity: 1;
	}
}

@keyframes bounce {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(8px);
	}
}

/* Work Section */
.work {
	padding: var(--spacing-3xl) 0;
	background-color: var(--color-bg);
	position: relative;
	transition: background-color var(--transition-base);
}

.work::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, var(--color-border) 50%, transparent 100%);
}

/* Ensure first work section shows above fold on compact hero pages */
.hero-compact + .work {
	padding-top: var(--spacing-2xl);
}

.section-header {
	margin-bottom: var(--spacing-3xl);
	text-align: center;
	position: relative;
	padding-bottom: 2.5rem;
}

.section-header::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 80px;
	height: 3px;
	background: linear-gradient(90deg, transparent 0%, var(--color-black) 50%, transparent 100%);
	border-radius: 2px;
	animation: expandLine 1s ease-out 0.5s forwards;
	opacity: 0;
}

@keyframes expandLine {
	to {
		opacity: 1;
		width: 120px;
	}
}

.section-label {
	display: inline-block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--color-text-light);
	font-weight: 600;
	margin-bottom: 1rem;
}

.section-title {
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 700;
	color: var(--color-black);
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
	letter-spacing: -0.02em;
	position: relative;
}

/* Work Grid */
.work-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 3rem;
	margin-top: 4rem;
}

.work-item {
	opacity: 0;
	transform: translateY(40px) scale(0.95);
	animation: fadeInUpScale 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUpScale {
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.work-item:nth-child(1) { animation-delay: 0.1s; }
.work-item:nth-child(2) { animation-delay: 0.2s; }
.work-item:nth-child(3) { animation-delay: 0.3s; }
.work-item:nth-child(4) { animation-delay: 0.4s; }
.work-item:nth-child(5) { animation-delay: 0.5s; }

.work-item-featured {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3rem;
	align-items: center;
}

.work-image {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background-color: var(--color-gray-100);
	aspect-ratio: 16 / 10;
	box-shadow: var(--shadow-md);
	transition: all var(--transition-smooth);
	cursor: pointer;
	will-change: transform;
}

.work-image img {
	cursor: pointer;
}

.work-image::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.05) 100%);
	opacity: 0;
	transition: opacity var(--transition-base);
	z-index: 1;
	pointer-events: none;
}

.work-item-featured .work-image {
	aspect-ratio: 4 / 3;
}

.work-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-smooth);
	filter: brightness(1) contrast(1);
}

.work-image:hover {
	transform: translateY(-8px);
	box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.work-image:hover::before {
	opacity: 1;
}

.work-image:hover img {
	transform: scale(1.08);
	filter: brightness(1.05) contrast(1.05);
}

.work-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 100%);
	display: flex;
	align-items: flex-end;
	padding: 1.5rem;
	opacity: 0;
	transition: opacity var(--transition-smooth);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 2;
	pointer-events: none;
}

.work-image:hover .work-overlay {
	opacity: 1;
}

.work-tag {
	display: inline-block;
	padding: 0.625rem 1.25rem;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	border-radius: 6px;
	box-shadow: var(--shadow-md);
	transform: translateY(10px);
	opacity: 0;
	transition: all var(--transition-smooth);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.work-image:hover .work-tag {
	transform: translateY(0);
	opacity: 1;
}

.work-content {
	margin-top: 1.5rem;
}

/* Design Process Display */
.work-process {
	margin-top: 1rem;
	margin-bottom: 1rem;
	padding: 0.625rem 0;
	opacity: 1;
	max-height: none;
	overflow: visible;
	transform: translateY(0);
	display: block;
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}

.work-process + .work-links {
	margin-top: 1rem;
}

.process-meta,
.process-tools,
.process-collab {
	margin-bottom: 0.375rem;
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.process-tools {
	align-items: baseline;
}

.process-meta:last-child,
.process-tools:last-child,
.process-collab:last-child {
	margin-bottom: 0;
}

.process-label {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text-light);
	margin-bottom: 0;
	min-width: 4rem;
	flex-shrink: 0;
}

.process-tools .process-tags {
	display: inline-flex;
	flex: 1;
	min-width: 0;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0;
}

.process-tag {
	display: inline;
	color: var(--color-text);
	font-size: 0.875rem;
	font-weight: 400;
	background: none;
	padding: 0;
	border-radius: 0;
	box-shadow: none;
	transition: none;
}

.process-tag:not(:last-child)::after {
	content: ', ';
}

[data-theme="dark"] .process-tag {
	color: var(--color-text);
	background: none;
}

.process-tag:hover {
	transform: none;
	box-shadow: none;
}

.process-text {
	font-size: 0.8125rem;
	color: var(--color-text);
	line-height: 1.4;
	display: inline-block;
}

.work-item-featured .work-content {
	margin-top: 0;
}

/* Products Section - Modern Card Design */
#products .work-grid {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	margin-top: 4rem;
}

.app-item {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	align-items: center;
	padding: 2rem;
	background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
	border-radius: 16px;
	border: 1px solid var(--color-border);
	transition: all var(--transition-smooth);
	box-shadow: var(--shadow-sm);
	width: 100%;
	cursor: pointer;
}

.app-item:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: var(--color-gray-300);
}

[data-theme="dark"] .app-item:hover {
	border-color: var(--color-gray-600);
}

.app-logo-wrapper {
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-bg);
	border-radius: 20px;
	padding: 0;
	border: 1px solid var(--color-border);
	box-shadow: var(--shadow-sm);
	transition: all var(--transition-smooth);
	margin: 0 auto;
	overflow: hidden;
}

.app-item:hover .app-logo-wrapper {
	transform: scale(1.05);
	box-shadow: var(--shadow-md);
	border-color: var(--color-gray-300);
}

[data-theme="dark"] .app-item:hover .app-logo-wrapper {
	border-color: var(--color-gray-600);
}

.app-logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	filter: grayscale(0.3);
	transition: filter var(--transition-smooth);
}

.app-item:hover .app-logo {
	filter: grayscale(0);
}

.app-content {
	width: 100%;
	text-align: left;
}

.app-title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	margin-bottom: 1rem;
	color: var(--color-black);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.app-description {
	font-size: 1rem;
	line-height: 1.8;
	color: var(--color-text-light);
	margin: 0;
}


.work-title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	margin-bottom: 1rem;
	color: var(--color-black);
	transition: color var(--transition-base);
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.work-year {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-text-light);
	opacity: 0.8;
	font-family: var(--font-primary);
}

.work-item:hover .work-title {
	color: var(--color-gray-800);
}

.work-description {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--color-text-light);
	margin-bottom: 1.5rem;
}

.work-meta {
	margin: 1.5rem 0;
	padding: 1.5rem;
	background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
	border-radius: 12px;
	border-left: 4px solid var(--color-black);
	box-shadow: var(--shadow-sm);
	transition: all var(--transition-smooth);
}

.work-item:hover .work-meta {
	box-shadow: var(--shadow-md);
	transform: translateX(2px);
}

.work-meta-item {
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--color-text-light);
	margin-bottom: 0.75rem;
}

.work-meta-item:last-child {
	margin-bottom: 0;
}

.work-meta-item strong {
	color: var(--color-black);
	font-weight: 600;
}

.work-links {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.work-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--color-black);
	padding: 0.875rem 1.75rem;
	border: 2px solid var(--color-black);
	border-radius: 8px;
	transition: all var(--transition-smooth);
	background-color: transparent;
	position: relative;
	overflow: hidden;
	text-decoration: none;
}

/* Light Mode Button Style */
.work-link {
	background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-50) 100%);
	border: 2px solid var(--color-black);
	color: var(--color-black);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.work-link::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%);
	opacity: 0.2;
	transition: left var(--transition-smooth);
	z-index: 0;
}

.work-link > * {
	position: relative;
	z-index: 1;
	transition: color var(--transition-smooth), transform var(--transition-smooth);
	color: var(--color-black);
}

.work-link:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
	border-color: var(--color-black);
}

.work-link:hover > * {
	color: var(--color-white);
}

.work-link:hover::before {
	left: 0;
}

.work-link svg {
	transition: transform var(--transition-smooth), color var(--transition-smooth);
	color: inherit;
}

.work-link:hover svg {
	transform: translate(4px, -4px) scale(1.1);
	color: inherit;
}

/* Dark Mode Button Style - Different Design */
[data-theme="dark"] .work-link {
	background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-gray-800) 100%);
	border: 2px solid var(--color-gray-600);
	color: var(--color-white);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .work-link::before {
	background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-300) 100%);
	opacity: 0.2;
}

[data-theme="dark"] .work-link > * {
	color: var(--color-white);
}

[data-theme="dark"] .work-link:hover {
	border-color: var(--color-white);
	box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .work-link:hover > * {
	color: var(--color-black);
}

[data-theme="dark"] .work-link:hover::before {
	left: 0;
}

/* Footer */
.footer {
	padding: var(--spacing-2xl) 0;
	border-top: 1px solid var(--color-border);
	background: linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
	position: relative;
}

.footer::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, var(--color-gray-300) 50%, transparent 100%);
}

.footer-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.footer-text {
	font-size: 0.875rem;
	color: var(--color-text-light);
}

.footer-links {
	display: flex;
	gap: 2rem;
}

.footer-link {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-text);
	transition: color var(--transition-fast);
}

.footer-link:hover {
	color: var(--color-black);
}

/* Books Grid */
.books-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 2rem;
	margin-top: 4rem;
}

.book-item {
	opacity: 0;
	transform: translateY(40px);
	animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.book-item:nth-child(1) { animation-delay: 0.1s; }
.book-item:nth-child(2) { animation-delay: 0.2s; }
.book-item:nth-child(3) { animation-delay: 0.3s; }
.book-item:nth-child(4) { animation-delay: 0.4s; }
.book-item:nth-child(5) { animation-delay: 0.5s; }
.book-item:nth-child(6) { animation-delay: 0.6s; }

.book-link {
	display: block;
	transition: all var(--transition-smooth);
}

.book-link:hover {
	transform: translateY(-12px);
}

.book-image {
	position: relative;
	overflow: visible;
	border-radius: 4px 8px 8px 4px;
	background-color: var(--color-gray-100);
	margin-bottom: 1.5rem;
	aspect-ratio: 2 / 3;
	width: 100%;
	max-width: 180px;
	margin-left: auto;
	margin-right: auto;
	box-shadow: 
		0 4px 8px rgba(0, 0, 0, 0.15),
		0 2px 4px rgba(0, 0, 0, 0.1),
		inset -2px 0 4px rgba(0, 0, 0, 0.1);
	transition: all var(--transition-smooth);
	transform-style: preserve-3d;
	perspective: 1000px;
}

.book-image::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 8px;
	background: linear-gradient(to right, 
		rgba(0, 0, 0, 0.3) 0%, 
		rgba(0, 0, 0, 0.15) 50%, 
		rgba(0, 0, 0, 0.05) 100%);
	border-radius: 4px 0 0 4px;
	z-index: 1;
	pointer-events: none;
}


.book-link:hover .book-image {
	box-shadow: 
		0 12px 24px rgba(0, 0, 0, 0.2),
		0 6px 12px rgba(0, 0, 0, 0.15),
		inset -2px 0 4px rgba(0, 0, 0, 0.1);
	transform: translateY(-8px) rotateY(-5deg) scale(1.05);
}

.book-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px 8px 8px 4px;
	transition: transform var(--transition-smooth);
	filter: brightness(1) contrast(1);
	position: relative;
	z-index: 0;
}

.book-link:hover .book-image img {
	filter: brightness(1.05) contrast(1.05);
}

.book-content {
	text-align: left;
}

.book-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--color-black);
	line-height: 1.3;
	transition: color var(--transition-base);
}

.book-link:hover .book-title {
	color: var(--color-gray-800);
}

.book-subtitle {
	font-size: 0.9375rem;
	color: var(--color-text-light);
	margin-bottom: 0.75rem;
	line-height: 1.5;
}

.book-author {
	font-size: 0.875rem;
	color: var(--color-text-light);
	font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
	:root {
		--container-padding: 1.5rem;
		--spacing-3xl: 4rem;
	}
	
	.nav::after {
		content: '';
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.3);
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
		opacity: 0;
		pointer-events: none;
		transition: opacity var(--transition-smooth);
		z-index: 998;
	}
	
	.nav.menu-open::after {
		opacity: 1;
		pointer-events: all;
	}
	
	/* Blur entire page when menu is open, but keep nav visible */
	body.menu-open {
		overflow: hidden;
	}
	
	body.menu-open main,
	body.menu-open section,
	body.menu-open footer,
	body.menu-open .hero {
		filter: blur(4px);
		transition: filter var(--transition-smooth);
		pointer-events: none;
	}
	
	/* Keep nav bar completely unblurred */
	body.menu-open .nav,
	body.menu-open .nav-container,
	body.menu-open .nav-logo,
	body.menu-open .nav-logo *,
	body.menu-open .nav-actions,
	body.menu-open .nav-toggle,
	body.menu-open .nav-toggle *,
	body.menu-open .theme-toggle,
	body.menu-open .theme-toggle * {
		filter: none !important;
		backdrop-filter: none !important;
		-webkit-backdrop-filter: none !important;
		pointer-events: all;
	}
	
	.nav-links {
		position: fixed;
		top: 70px;
		right: 1rem;
		left: auto;
		width: 220px;
		background-color: var(--color-bg);
		backdrop-filter: blur(20px) saturate(180%);
		-webkit-backdrop-filter: blur(20px) saturate(180%);
		flex-direction: column;
		padding: 0.75rem;
		gap: 0.25rem;
		border: 1px solid var(--color-border);
		border-radius: 12px;
		box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
		transform-origin: top right;
		transform: scale(0) translate(20px, -10px);
		opacity: 0;
		transition: all var(--transition-smooth);
		pointer-events: none;
		z-index: 999;
	}
	
	[data-theme="dark"] .nav-links {
		box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
		border-color: rgba(255, 255, 255, 0.1);
	}
	
	.nav-links.active {
		transform: scale(1) translate(0, 0);
		opacity: 1;
		pointer-events: all;
	}
	
	.nav-links .nav-link {
		padding: 0.75rem 1rem;
		border-radius: 8px;
		text-align: left;
		width: 100%;
		justify-content: flex-start;
		font-size: 0.9375rem;
	}
	
	.nav-toggle {
		display: flex;
	}
	
	.nav-toggle.active span:nth-child(1) {
		top: 50%;
		transform: translate(-50%, -50%) rotate(45deg);
	}
	
	.nav-toggle.active span:nth-child(2) {
		opacity: 0;
		width: 0;
	}
	
	.nav-toggle.active span:nth-child(3) {
		bottom: auto;
		top: 50%;
		transform: translate(-50%, -50%) rotate(-45deg);
	}
	
	[data-theme="dark"] .nav-toggle.active span:nth-child(1),
	[data-theme="dark"] .nav-toggle.active span:nth-child(3) {
		background-color: #ffffff !important;
	}
	
	.hero {
		min-height: 80vh;
		padding: 6rem var(--container-padding) 3rem;
		justify-content: flex-start;
	}
	
	.hero-compact {
		min-height: 60vh;
		padding: 5rem var(--container-padding) 2rem;
		justify-content: flex-start;
	}
	
	.work-grid {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}
	
	.work-item-featured {
		grid-template-columns: 1fr;
	}
	
	.work-item-featured .work-image {
		aspect-ratio: 16 / 10;
	}
	
	.books-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 1.5rem;
	}
	
	.book-image {
		max-width: 150px;
	}
	
	.hero-scroll {
		bottom: 1rem;
		right: 1rem;
		font-size: 0.625rem;
	}
	
	.hero-scroll svg {
		width: 20px;
		height: 20px;
	}
	
	.footer-content {
		flex-direction: column;
		text-align: center;
	}
}

@media (max-width: 480px) {
	:root {
		--container-padding: 1rem;
	}
	
	.hero {
		padding: 5rem 1rem 2rem;
		justify-content: flex-start;
	}
	
	.work {
		padding: var(--spacing-2xl) 0;
	}
	
	.work-link {
		width: 100%;
		justify-content: center;
	}
	
	.hero-scroll {
		bottom: 1rem;
		right: 1rem;
		font-size: 0.625rem;
	}
	
	.hero-scroll svg {
		width: 18px;
		height: 18px;
	}
}

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

/* Performance Optimizations */
.work-image img {
	will-change: transform;
}

.work-link {
	will-change: transform, background-color;
}

/* Image Modal */
.image-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
	pointer-events: none;
}

.image-modal.active {
	opacity: 1;
	visibility: visible;
	pointer-events: all;
}

.image-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: background-color var(--transition-base);
}

[data-theme="dark"] .image-modal-backdrop {
	background-color: rgba(0, 0, 0, 0.98);
}

.image-modal-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	z-index: 1;
	transform: scale(0.9);
	transition: transform var(--transition-smooth);
	padding: 2rem;
}

.image-modal.active .image-modal-content {
	transform: scale(1);
}

.image-modal-img {
	max-width: 100%;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: var(--shadow-xl);
		background-color: var(--color-bg);
		display: block;
	}

.image-modal-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: rgba(255, 255, 255, 0.95);
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all var(--transition-smooth);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 2;
	color: var(--color-text);
	box-shadow: var(--shadow-md);
}

[data-theme="dark"] .image-modal-close {
	background: rgba(26, 26, 26, 0.95);
	color: var(--color-text);
}

.image-modal-close:hover {
	background: var(--color-bg);
	transform: rotate(90deg) scale(1.1);
	box-shadow: var(--shadow-lg);
}

.image-modal-close svg {
	width: 20px;
	height: 20px;
}

@media (max-width: 768px) {
	.image-modal-content {
		padding: 1rem;
	}
	
	.image-modal-close {
		top: 0.5rem;
		right: 0.5rem;
		width: 40px;
		height: 40px;
	}
}

/* Chat Widget */
.chat-widget {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	font-family: var(--font-primary);
}

/* Backdrop for blur effect */
.chat-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
	z-index: 9998;
}

.chat-widget.active .chat-backdrop {
	opacity: 1;
	visibility: visible;
}

/* Blur page content when chat is open */
body.chat-open > *:not(.chat-widget):not(.nav) {
	filter: blur(4px);
	transition: filter var(--transition-smooth);
	pointer-events: none;
}

body.chat-open .nav {
	filter: blur(4px);
	transition: filter var(--transition-smooth);
}

/* Prevent body scroll on mobile when chat is open */
@media (max-width: 768px) {
	body.chat-open {
		overflow: hidden;
		position: fixed;
		width: 100%;
		height: 100%;
	}
}

/* Input container - always visible at bottom when chat is closed */
.chat-input-container {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	max-width: 420px;
	padding: 0 1rem;
	z-index: 10000;
	display: block;
	box-sizing: border-box;
	padding-bottom: env(safe-area-inset-bottom);
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: auto;
}

.chat-widget.active .chat-input-container {
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) scale(0.98);
	pointer-events: none;
}

/* Hide animated border during transition */
.chat-widget.active .chat-input-container .chat-form {
	animation: none;
	background: transparent;
}

.chat-container {
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid var(--color-border);
	border-radius: 24px 24px 0 0;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15), 0 -8px 16px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	overflow: hidden;
	height: 600px;
	max-height: 80vh;
	position: fixed;
	bottom: 0;
	left: 50%;
	right: auto;
	z-index: 9999;
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) scale(0.98);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

/* Max width for desktop and larger devices */
@media (min-width: 768px) {
	.chat-container {
		left: 50%;
		right: auto;
		max-width: 600px;
		width: 100%;
		border-radius: 24px;
		box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
		box-sizing: border-box;
		transform: translateX(-50%) scale(0.98);
	}
	
	[data-theme="dark"] .chat-container {
		box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
	}
	
	.chat-widget.active .chat-container {
		transform: translateX(-50%) scale(1);
	}
}

[data-theme="dark"] .chat-container {
	background: rgba(23, 23, 23, 0.7);
	border-color: #000000;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4), 0 -8px 16px rgba(0, 0, 0, 0.3);
}

.chat-widget.active .chat-container {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) scale(1);
	pointer-events: auto;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes slideUpDesktop {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0) scale(1);
	}
}

.chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	background: rgba(250, 250, 250, 0.7);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="dark"] .chat-header {
	background: rgba(23, 23, 23, 0.7);
}

.chat-header-content {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.chat-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%);
	color: var(--color-white);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1rem;
	flex-shrink: 0;
	box-shadow: var(--shadow-md);
}

[data-theme="dark"] .chat-avatar {
	background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-200) 100%);
	color: var(--color-black);
}

.chat-header-text {
	flex: 1;
}

.chat-title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
	color: var(--color-black);
	line-height: 1.3;
}

.chat-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: transparent;
	border: 1px solid var(--color-border);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-text);
	transition: all var(--transition-base);
	flex-shrink: 0;
}

.chat-close:hover {
	background: var(--color-gray-100);
	border-color: var(--color-gray-300);
	transform: rotate(90deg);
	color: var(--color-text);
}

[data-theme="dark"] .chat-close:hover {
	background: var(--color-gray-800);
	border-color: var(--color-gray-600);
	color: #000000 !important; /* Explicit black for visibility on light background */
}

[data-theme="dark"] .chat-close:hover svg {
	color: #000000 !important;
	stroke: #000000 !important;
	fill: none;
}

.chat-close svg {
	width: 20px;
	height: 20px;
}

.chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
	width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
	background-color: var(--color-gray-300);
	border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
	background-color: var(--color-gray-400);
}

.chat-message {
	display: flex;
	animation: fadeInMessage 0.3s ease-out;
}

@keyframes fadeInMessage {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.chat-message-user {
	justify-content: flex-end;
}

.chat-message-bot {
	justify-content: flex-start;
}

.chat-message-content {
	max-width: 75%;
	padding: 0.875rem 1.25rem;
	border-radius: 20px;
	line-height: 1.5;
	font-size: 0.9375rem;
	word-wrap: break-word;
	background: var(--color-gray-100) !important;
}

.chat-message-user .chat-message-content {
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%) !important;
}

[data-theme="dark"] .chat-message-bot .chat-message-content {
	background: var(--color-gray-800) !important;
}

[data-theme="dark"] .chat-message-user .chat-message-content {
	background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-200) 100%) !important;
}

.chat-message-user .chat-message-content {
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

[data-theme="dark"] .chat-message-user .chat-message-content {
	background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-200) 100%);
	color: #ffffff;
}

.chat-message-bot .chat-message-content {
	background: var(--color-gray-100);
	color: #000000;
	border-bottom-left-radius: 4px;
}

[data-theme="dark"] .chat-message-bot .chat-message-content {
	background: var(--color-gray-800);
	color: #000000;
}

.chat-message-content p {
	margin: 0;
	color: inherit;
}

.chat-message-content,
.chat-message-content * {
	color: inherit;
}

.chat-message-user .chat-message-content,
.chat-message-user .chat-message-content * {
	color: #ffffff !important;
}

[data-theme="dark"] .chat-message-user .chat-message-content,
[data-theme="dark"] .chat-message-user .chat-message-content * {
	color: #ffffff !important;
}

.chat-message-bot .chat-message-content,
.chat-message-bot .chat-message-content * {
	color: #000000 !important;
}

[data-theme="dark"] .chat-message-bot .chat-message-content,
[data-theme="dark"] .chat-message-bot .chat-message-content * {
	color: #000000 !important;
}

.chat-input-container-inner {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--color-border);
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	position: relative;
}

/* Remove multicolor animation from inner chat window form */
.chat-input-container-inner .chat-form {
	background: transparent;
	animation: none;
	padding: 0;
}

.chat-input-container-inner .chat-input {
	box-shadow: none;
	animation: none;
	border: 1px solid var(--color-border);
}

[data-theme="dark"] .chat-input-container-inner {
	background: rgba(23, 23, 23, 0.7);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="dark"] .chat-input-container-inner .chat-form {
	background: transparent;
	animation: none;
}

[data-theme="dark"] .chat-input-container-inner .chat-input {
	box-shadow: none;
	animation: none;
	border: none;
}

.chat-form {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	position: relative;
	padding: 3px;
	border-radius: 9999px;
	background: conic-gradient(
		from 0deg,
		#00d4ff 0%,
		#00d4ff 5%,
		#5b9fff 20%,
		#8b5cf6 35%,
		#a855f7 50%,
		#c084fc 65%,
		#ec4899 80%,
		#f97316 95%,
		#00d4ff 100%
	);
	background-size: 400% 400%;
	animation: siriBorderRotate 3s linear infinite;
	will-change: background-position, filter, transform;
}

.chat-input {
	flex: 1;
	padding: 0.875rem 1.25rem;
	border: none;
	border-radius: 9999px;
	background: var(--color-bg);
	color: var(--color-text);
	font-size: 16px; /* Prevent zoom on iOS */
	font-family: var(--font-primary);
	outline: none;
	transition: all var(--transition-base);
	position: relative;
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
	user-select: text;
	-webkit-user-select: text;
	z-index: 1;
	/* Multi-color glow with all colors visible simultaneously - reduced intensity */
	box-shadow: 
		0 0 10px rgba(0, 212, 255, 0.3),
		0 0 15px rgba(91, 159, 255, 0.25),
		0 0 20px rgba(139, 92, 246, 0.2),
		0 0 25px rgba(168, 85, 247, 0.15),
		0 0 30px rgba(192, 132, 252, 0.1);
	animation: siriBorderGlow 3s ease-in-out infinite;
	will-change: box-shadow, filter;
}

/* Remove pseudo-elements since we're using form as border */
.chat-input::before,
.chat-input::after {
	display: none;
}

/* Siri-like colorful animated border - smooth rotating gradient showing all colors simultaneously */
@keyframes siriBorderRotate {
	0% {
		background-position: 0% 50%;
		filter: hue-rotate(0deg) brightness(1) saturate(1.2);
	}
	25% {
		background-position: 25% 25%;
		filter: hue-rotate(15deg) brightness(1.05) saturate(1.25);
	}
	50% {
		background-position: 50% 0%;
		filter: hue-rotate(30deg) brightness(1.1) saturate(1.3);
	}
	75% {
		background-position: 75% 25%;
		filter: hue-rotate(15deg) brightness(1.05) saturate(1.25);
	}
	100% {
		background-position: 100% 50%;
		filter: hue-rotate(0deg) brightness(1) saturate(1.2);
	}
}

/* Multi-color glow animation - all colors pulsing simultaneously - reduced intensity */
@keyframes siriBorderGlow {
	0%, 100% {
		box-shadow: 
			0 0 10px rgba(0, 212, 255, 0.3),
			0 0 15px rgba(91, 159, 255, 0.25),
			0 0 20px rgba(139, 92, 246, 0.2),
			0 0 25px rgba(168, 85, 247, 0.15),
			0 0 30px rgba(192, 132, 252, 0.1);
		filter: brightness(1) hue-rotate(0deg);
	}
	25% {
		box-shadow: 
			0 0 12px rgba(0, 212, 255, 0.35),
			0 0 18px rgba(91, 159, 255, 0.3),
			0 0 24px rgba(139, 92, 246, 0.25),
			0 0 30px rgba(168, 85, 247, 0.2),
			0 0 36px rgba(192, 132, 252, 0.15);
		filter: brightness(1.05) hue-rotate(10deg);
	}
	50% {
		box-shadow: 
			0 0 14px rgba(0, 212, 255, 0.4),
			0 0 20px rgba(91, 159, 255, 0.35),
			0 0 26px rgba(139, 92, 246, 0.3),
			0 0 32px rgba(168, 85, 247, 0.25),
			0 0 38px rgba(192, 132, 252, 0.2);
		filter: brightness(1.1) hue-rotate(20deg);
	}
	75% {
		box-shadow: 
			0 0 12px rgba(0, 212, 255, 0.35),
			0 0 18px rgba(91, 159, 255, 0.3),
			0 0 24px rgba(139, 92, 246, 0.25),
			0 0 30px rgba(168, 85, 247, 0.2),
			0 0 36px rgba(192, 132, 252, 0.15);
		filter: brightness(1.05) hue-rotate(10deg);
	}
}

/* Dark mode Siri border - brighter colors for dark backgrounds */
[data-theme="dark"] .chat-form {
	background: conic-gradient(
		from 0deg,
		#00f5ff 0%,
		#00f5ff 5%,
		#60a5fa 20%,
		#818cf8 35%,
		#a78bfa 50%,
		#c084fc 65%,
		#f472b6 80%,
		#fb923c 95%,
		#00f5ff 100%
	);
	background-size: 400% 400%;
	animation: siriBorderRotateDark 3s linear infinite;
	will-change: background-position, filter, transform;
}

@keyframes siriBorderRotateDark {
	0% {
		background-position: 0% 50%;
		filter: hue-rotate(0deg) brightness(1) saturate(1.3);
	}
	25% {
		background-position: 25% 25%;
		filter: hue-rotate(15deg) brightness(1.08) saturate(1.35);
	}
	50% {
		background-position: 50% 0%;
		filter: hue-rotate(30deg) brightness(1.15) saturate(1.4);
	}
	75% {
		background-position: 75% 25%;
		filter: hue-rotate(15deg) brightness(1.08) saturate(1.35);
	}
	100% {
		background-position: 100% 50%;
		filter: hue-rotate(0deg) brightness(1) saturate(1.3);
	}
}

[data-theme="dark"] .chat-input {
	box-shadow: 
		0 0 12px rgba(0, 245, 255, 0.4),
		0 0 18px rgba(96, 165, 250, 0.35),
		0 0 24px rgba(129, 140, 248, 0.3),
		0 0 30px rgba(167, 139, 250, 0.25),
		0 0 36px rgba(192, 132, 252, 0.2);
	animation: siriBorderGlowDark 3s ease-in-out infinite;
	will-change: box-shadow, filter;
}

@keyframes siriBorderGlowDark {
	0%, 100% {
		box-shadow: 
			0 0 12px rgba(0, 245, 255, 0.4),
			0 0 18px rgba(96, 165, 250, 0.35),
			0 0 24px rgba(129, 140, 248, 0.3),
			0 0 30px rgba(167, 139, 250, 0.25),
			0 0 36px rgba(192, 132, 252, 0.2);
		filter: brightness(1) hue-rotate(0deg);
	}
	25% {
		box-shadow: 
			0 0 14px rgba(0, 245, 255, 0.45),
			0 0 20px rgba(96, 165, 250, 0.4),
			0 0 26px rgba(129, 140, 248, 0.35),
			0 0 32px rgba(167, 139, 250, 0.3),
			0 0 38px rgba(192, 132, 252, 0.25);
		filter: brightness(1.05) hue-rotate(10deg);
	}
	50% {
		box-shadow: 
			0 0 16px rgba(0, 245, 255, 0.5),
			0 0 22px rgba(96, 165, 250, 0.45),
			0 0 28px rgba(129, 140, 248, 0.4),
			0 0 34px rgba(167, 139, 250, 0.35),
			0 0 40px rgba(192, 132, 252, 0.3);
		filter: brightness(1.1) hue-rotate(20deg);
	}
	75% {
		box-shadow: 
			0 0 14px rgba(0, 245, 255, 0.45),
			0 0 20px rgba(96, 165, 250, 0.4),
			0 0 26px rgba(129, 140, 248, 0.35),
			0 0 32px rgba(167, 139, 250, 0.3),
			0 0 38px rgba(192, 132, 252, 0.25);
		filter: brightness(1.05) hue-rotate(10deg);
	}
}

@keyframes siriBorderGlowDark {
	0% {
		box-shadow: 
			inset 0 0 0 2px var(--color-bg),
			0 0 0 3px transparent,
			0 0 25px rgba(0, 245, 255, 0.6),
			0 0 35px rgba(96, 165, 250, 0.5),
			0 0 45px rgba(167, 139, 250, 0.4),
			0 0 55px rgba(244, 114, 182, 0.35),
			0 0 65px rgba(251, 146, 60, 0.3);
	}
	20% {
		box-shadow: 
			inset 0 0 0 2px var(--color-bg),
			0 0 0 3px transparent,
			0 0 25px rgba(96, 165, 250, 0.6),
			0 0 35px rgba(167, 139, 250, 0.5),
			0 0 45px rgba(244, 114, 182, 0.4),
			0 0 55px rgba(251, 146, 60, 0.35),
			0 0 65px rgba(0, 245, 255, 0.3);
	}
	40% {
		box-shadow: 
			inset 0 0 0 2px var(--color-bg),
			0 0 0 3px transparent,
			0 0 25px rgba(167, 139, 250, 0.6),
			0 0 35px rgba(244, 114, 182, 0.5),
			0 0 45px rgba(251, 146, 60, 0.4),
			0 0 55px rgba(0, 245, 255, 0.35),
			0 0 65px rgba(96, 165, 250, 0.3);
	}
	60% {
		box-shadow: 
			inset 0 0 0 2px var(--color-bg),
			0 0 0 3px transparent,
			0 0 25px rgba(244, 114, 182, 0.6),
			0 0 35px rgba(251, 146, 60, 0.5),
			0 0 45px rgba(0, 245, 255, 0.4),
			0 0 55px rgba(96, 165, 250, 0.35),
			0 0 65px rgba(167, 139, 250, 0.3);
	}
	80% {
		box-shadow: 
			inset 0 0 0 2px var(--color-bg),
			0 0 0 3px transparent,
			0 0 25px rgba(251, 146, 60, 0.6),
			0 0 35px rgba(0, 245, 255, 0.5),
			0 0 45px rgba(96, 165, 250, 0.4),
			0 0 55px rgba(167, 139, 250, 0.35),
			0 0 65px rgba(244, 114, 182, 0.3);
	}
	100% {
		box-shadow: 
			inset 0 0 0 2px var(--color-bg),
			0 0 0 3px transparent,
			0 0 25px rgba(0, 245, 255, 0.6),
			0 0 35px rgba(96, 165, 250, 0.5),
			0 0 45px rgba(167, 139, 250, 0.4),
			0 0 55px rgba(244, 114, 182, 0.35),
			0 0 65px rgba(251, 146, 60, 0.3);
	}
}

[data-theme="dark"] .chat-input {
	animation: siriBorderGlowDark 3s linear infinite;
}

.chat-input:focus {
	transform: scale(1);
	outline: none;
	/* Remove colorful glow on focus */
	box-shadow: none;
	animation: none;
}

.chat-input:focus ~ *,
.chat-form:has(.chat-input:focus) {
	/* Remove colorful border on focus */
}

.chat-form:has(.chat-input:focus) {
	background: transparent;
	animation: none;
	padding: 0;
}

/* Fallback for browsers without :has() support */
.chat-input:focus {
	border: 2px solid var(--color-border);
}

.chat-input-container-inner:has(.chat-input:focus) .chat-form,
.chat-form:has(.chat-input:focus) {
	background: transparent;
	animation: none;
	padding: 0;
}

/* Mobile-specific input improvements */
@media (max-width: 768px) {
	.chat-input {
		font-size: 16px; /* Critical: prevents iOS zoom on focus */
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}
	
	.chat-input:focus {
		transform: none; /* Prevent any scaling that might cause issues */
	}
}

.chat-input::placeholder {
	color: var(--color-text-light);
}

.chat-send {
	width: 44px;
	height: 44px;
	min-width: 44px; /* Ensure minimum touch target */
	min-height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-800) 100%);
	color: var(--color-white);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--transition-base);
	flex-shrink: 0;
	box-shadow: var(--shadow-sm);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

[data-theme="dark"] .chat-send {
	background: linear-gradient(135deg, var(--color-white) 0%, var(--color-gray-200) 100%);
	color: var(--color-black);
}

.chat-send:hover {
	transform: scale(1.05);
	box-shadow: var(--shadow-md);
}

.chat-send:active {
	transform: scale(0.95);
}

.chat-send svg {
	width: 18px;
	height: 18px;
}

.chat-typing {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 1.25rem;
	background: var(--color-gray-100);
	border-radius: 20px;
	border-bottom-left-radius: 4px;
	max-width: 75%;
}

[data-theme="dark"] .chat-typing {
	background: var(--color-gray-800);
}

.chat-typing-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--color-text-light);
	animation: typingDot 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typingDot {
	0%, 60%, 100% {
		opacity: 0.3;
		transform: scale(0.8);
	}
	30% {
		opacity: 1;
		transform: scale(1);
	}
}

/* Responsive Chat Widget */
@media (max-width: 768px) {
	.chat-input-container {
		bottom: 1rem;
		max-width: calc(100% - 2rem);
		padding: 0;
		left: 1rem !important;
		right: 1rem !important;
		transform: none !important;
		width: auto;
	}
	
	.chat-widget.active .chat-input-container {
		transform: none !important;
	}
	
	.chat-container {
		height: 100vh;
		height: 100dvh; /* Dynamic viewport height for mobile browsers */
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
		bottom: 0;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100vw !important;
		transform: none !important;
		padding-bottom: env(safe-area-inset-bottom);
		box-sizing: border-box;
		overflow: hidden;
		/* Smooth transitions for keyboard */
		transition: height var(--transition-base), max-height var(--transition-base);
		/* Prevent layout shifts */
		contain: layout style paint;
	}
	
	.chat-widget.active .chat-container {
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100vw !important;
		transform: none !important;
	}
	
	.chat-header {
		padding: 1.25rem 1.5rem;
		padding-top: calc(1.25rem + env(safe-area-inset-top));
		flex-shrink: 0;
		/* Prevent header from moving when keyboard appears */
		position: relative;
		z-index: 5;
	}
	
	.chat-messages {
		padding: 1.5rem;
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-behavior: smooth;
		overscroll-behavior: contain;
		/* Optimize scrolling performance */
		will-change: scroll-position;
		transform: translateZ(0);
		-webkit-transform: translateZ(0);
	}
	
	.chat-input-container-inner {
		padding: 1rem 1.5rem;
		padding-bottom: calc(1rem + env(safe-area-inset-bottom));
		flex-shrink: 0;
		background: var(--color-bg);
		position: sticky;
		bottom: 0;
		z-index: 10;
		/* Smooth keyboard transitions */
		transition: padding-bottom var(--transition-base);
	}
}

@media (max-width: 480px) {
	.chat-input-container {
		bottom: 0.75rem;
		max-width: calc(100% - 1.5rem);
		left: 0.75rem !important;
		right: 0.75rem !important;
		transform: none !important;
		width: auto;
	}
	
	.chat-widget.active .chat-input-container {
		transform: none !important;
	}
	
	.chat-container {
		height: 100vh;
		height: 100dvh; /* Dynamic viewport height for mobile browsers */
		max-height: 100vh;
		max-height: 100dvh;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100vw !important;
		transform: none !important;
		padding-bottom: env(safe-area-inset-bottom);
		box-sizing: border-box;
		overflow: hidden;
		/* Smooth transitions for keyboard */
		transition: height var(--transition-base), max-height var(--transition-base);
		/* Prevent layout shifts */
		contain: layout style paint;
	}
	
	.chat-widget.active .chat-container {
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100vw !important;
		transform: none !important;
	}
	
	.chat-header {
		padding: 1rem 1.25rem;
		padding-top: calc(1rem + env(safe-area-inset-top));
		flex-shrink: 0;
		/* Prevent header from moving when keyboard appears */
		position: relative;
		z-index: 5;
	}
	
	.chat-messages {
		padding: 1.25rem;
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-behavior: smooth;
		overscroll-behavior: contain;
		/* Optimize scrolling performance */
		will-change: scroll-position;
		transform: translateZ(0);
		-webkit-transform: translateZ(0);
	}
	
	.chat-input-container-inner {
		padding: 0.875rem 1.25rem;
		padding-bottom: calc(0.875rem + env(safe-area-inset-bottom));
		flex-shrink: 0;
		background: rgba(255, 255, 255, 0.7);
		backdrop-filter: blur(20px) saturate(180%);
		-webkit-backdrop-filter: blur(20px) saturate(180%);
		position: sticky;
		bottom: 0;
		z-index: 10;
		/* Smooth keyboard transitions */
		transition: padding-bottom var(--transition-base);
	}
	
	[data-theme="dark"] .chat-input-container-inner {
		background: rgba(23, 23, 23, 0.7);
	}
	
	.chat-message-content {
		max-width: 85%;
		font-size: 0.875rem;
		padding: 0.75rem 1rem;
	}
}

/* Contact Form Styles */
.contact-section {
	padding: var(--spacing-3xl) 0;
	min-height: 60vh;
}

.contact-form-wrapper {
	max-width: 600px;
	margin: 0 auto;
}

.contact-form {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.form-label {
	font-family: var(--font-display);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-text);
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.form-input,
.form-textarea {
	width: 100%;
	padding: 0.875rem 1rem;
	font-family: var(--font-primary);
	font-size: 1rem;
	line-height: 1.5;
	color: var(--color-text);
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	transition: all var(--transition-base);
	-webkit-appearance: none;
	appearance: none;
}

.form-input:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-input-error {
	border-color: #ef4444;
}

.form-input-error:focus {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-textarea {
	resize: vertical;
	min-height: 120px;
	font-family: var(--font-primary);
}

.form-error {
	display: none;
	font-size: 0.875rem;
	color: #ef4444;
	font-weight: 500;
	margin-top: 0.25rem;
}

.form-error[style*="display: block"] {
	display: block;
}

.form-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 2rem;
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-white);
	background-color: var(--color-accent);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all var(--transition-base);
	position: relative;
	min-height: 48px;
}

.form-submit:hover:not(:disabled) {
	background-color: var(--color-gray-900);
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.form-submit:active:not(:disabled) {
	transform: translateY(0);
}

.form-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.submit-loader {
	display: none;
	animation: spin 1s linear infinite;
}

.submit-loader[style*="display: inline-block"] {
	display: inline-block;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.form-message {
	display: none;
	padding: 1rem;
	border-radius: 4px;
	font-size: 0.875rem;
	font-weight: 500;
	text-align: center;
	margin-top: var(--spacing-sm);
}

.form-message[style*="display: block"] {
	display: block;
}

.form-message-success {
	background-color: #10b981;
	color: white;
}

.form-message-error {
	background-color: #ef4444;
	color: white;
}

/* Turnstile Widget Styling */
.cf-turnstile {
	margin: var(--spacing-sm) 0;
	min-height: 65px;
	display: block;
	width: 100%;
}

.cf-turnstile iframe {
	border: none;
	display: block;
}

/* Loading state for Turnstile */
.cf-turnstile:empty::before {
	content: 'Loading security verification...';
	display: block;
	color: var(--color-text-light);
	font-size: 0.875rem;
	padding: 1rem;
	text-align: center;
}

/* Responsive Contact Form */
@media (max-width: 768px) {
	.contact-form-wrapper {
		max-width: 100%;
	}
	
	.form-submit {
		width: 100%;
	}
}

/* Print Styles */
@media print {
	.nav,
	.hero-scroll,
	.footer,
	.image-modal,
	.chat-widget {
		display: none;
	}
	
	.work-item {
		page-break-inside: avoid;
	}
}
