/* Base Reset & Variables */
:root {
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-primary-light: #10b981;
  --color-bg: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-text: #111827;
  --color-text-secondary: #6b7280;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: 200ms ease;
}

.dark {
  --color-bg: #111827;
  --color-bg-secondary: #1f2937;
  --color-text: #f9fafb;
  --color-text-secondary: #9ca3af;
  --color-border: #374151;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition), color var(--transition);
}

/* Utility Classes */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding-left: 2rem; padding-right: 2rem; }
}

.max-w-6xl { max-width: 72rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.min-h-screen { min-height: 100vh; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:w-48 { width: 12rem; }
  .md\:h-80 { height: 20rem; }
  .md\:h-full { height: 100%; }
  .md\:gap-12 { gap: 3rem; }
  .md\:p-12 { padding: 3rem; }
  .md\:p-8 { padding: 2rem; }
  .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
  .md\:text-left { text-align: left; }
  .md\:space-y-0 > * + * { margin-top: 0; }
  .md\:order-1 { order: 1; }
  .md\:order-2 { order: 2; }
  .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .md\:text-5xl { font-size: 3rem; line-height: 1; }
  .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .md\:h-16 { height: 4rem; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Spacing */
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-16 { margin-bottom: 4rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

.text-center { text-align: center; }

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Colors */
.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-900 { color: #111827; }
.text-emerald-100 { color: #d1fae5; }
.text-emerald-400 { color: #34d399; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }

.bg-white { background-color: #ffffff; }
.bg-black\/20 { background-color: rgb(0 0 0 / 0.2); }
.bg-black\/70 { background-color: rgb(0 0 0 / 0.7); }
.bg-white\/10 { background-color: rgb(255 255 255 / 0.1); }
.bg-white\/80 { background-color: rgb(255 255 255 / 0.8); }
.bg-white\/95 { background-color: rgb(255 255 255 / 0.95); }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-900 { background-color: #111827; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-transparent { background-color: transparent; }

/* Dark mode colors */
.dark .dark\:text-white { color: #ffffff; }
.dark .dark\:text-gray-100 { color: #f3f4f6; }
.dark .dark\:text-gray-300 { color: #d1d5db; }
.dark .dark\:text-gray-400 { color: #9ca3af; }
.dark .dark\:text-emerald-300 { color: #6ee7b7; }
.dark .dark\:text-emerald-400 { color: #34d399; }

.dark .dark\:bg-gray-700 { background-color: #374151; }
.dark .dark\:bg-gray-800 { background-color: #1f2937; }
.dark .dark\:bg-gray-800\/80 { background-color: rgb(31 41 55 / 0.8); }
.dark .dark\:bg-gray-900 { background-color: #111827; }
.dark .dark\:bg-gray-900\/95 { background-color: rgb(17 24 39 / 0.95); }
.dark .dark\:bg-gray-950 { background-color: #030712; }
.dark .dark\:bg-emerald-900\/30 { background-color: rgb(6 78 59 / 0.3); }
.dark .dark\:bg-emerald-900\/50 { background-color: rgb(6 78 59 / 0.5); }

.dark .dark\:border-gray-700 { border-color: #374151; }
.dark .dark\:border-emerald-800 { border-color: #065f46; }

/* Gradients */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-emerald-600 { --tw-gradient-from: #059669; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(5 150 105 / 0)); }
.via-emerald-700 { --tw-gradient-stops: var(--tw-gradient-from), #047857, var(--tw-gradient-to, rgb(4 120 87 / 0)); }
.to-teal-800 { --tw-gradient-to: #115e59; }

.from-amber-50 { --tw-gradient-from: #fffbeb; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(255 251 235 / 0)); }
.to-orange-50 { --tw-gradient-to: #fff7ed; }

.dark .dark\:from-amber-900\/20 { --tw-gradient-from: rgb(120 53 15 / 0.2); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(120 53 15 / 0)); }
.dark .dark\:to-orange-900\/20 { --tw-gradient-to: rgb(124 45 18 / 0.2); }

/* Borders */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }
.border-b { border-bottom-width: 1px; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-amber-200 { border-color: #fde68a; }
.border-white { border-color: #ffffff; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-2xl { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }

/* Sizing */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-12 { width: 3rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.w-full { width: 100%; }
.w-auto { width: auto; }

.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-32 { height: 8rem; }
.h-48 { height: 12rem; }
.h-64 { height: 16rem; }
.h-full { height: 100%; }

.max-w-none { max-width: none; }
.max-w-3xl { max-width: 48rem; }
.max-h-\[90vh\] { max-height: 90vh; }

/* Aspect Ratio */
.aspect-video { aspect-ratio: 16 / 9; }

/* Object Fit */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.-bottom-4 { bottom: -1rem; }
.-right-4 { right: -1rem; }

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:block { display: block; }
}

.dark .dark\:block { display: block; }
.dark .dark\:hidden { display: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Transitions */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Transforms */
.scale-105 { transform: scale(1.05); }

/* Filters */
.grayscale { filter: grayscale(100%); }
.blur-2xl { filter: blur(40px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* Opacity */
.opacity-20 { opacity: 0.2; }
.opacity-70 { opacity: 0.7; }

/* Hover States */
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-emerald-50:hover { background-color: #ecfdf5; }
.hover\:bg-emerald-100:hover { background-color: #d1fae5; }
.hover\:bg-emerald-700:hover { background-color: #047857; }
.hover\:bg-white\/10:hover { background-color: rgb(255 255 255 / 0.1); }

.dark .dark\:hover\:bg-gray-700:hover { background-color: #374151; }
.dark .dark\:hover\:bg-gray-800:hover { background-color: #1f2937; }
.dark .dark\:hover\:bg-emerald-900\/50:hover { background-color: rgb(6 78 59 / 0.5); }

.hover\:text-emerald-600:hover { color: #059669; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:underline:hover { text-decoration: underline; }

.dark .dark\:hover\:text-emerald-400:hover { color: #34d399; }

.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.hover\:shadow-lg:hover { box-shadow: var(--shadow-lg); }

.hover\:grayscale-0:hover { filter: grayscale(0); }
.hover\:opacity-100:hover { opacity: 1; }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:border-emerald-500:hover { border-color: #10b981; }

.group:hover .group-hover\:scale-105 { transform: scale(1.05); }
.group:hover .group-hover\:text-emerald-600 { color: #059669; }
.group:hover .group-hover\:border-emerald-500 { border-color: #10b981; }

.dark .group:hover .dark\:group-hover\:text-emerald-400 { color: #34d399; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Prose (for markdown content) */
.prose {
  color: var(--color-text);
  max-width: 65ch;
}

.prose p {
  margin-bottom: 1.25em;
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--color-primary-dark);
}

.prose strong {
  font-weight: 600;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose-lg {
  font-size: 1.125rem;
  line-height: 1.75;
}

.dark .dark\:prose-invert {
  color: #e5e7eb;
}

.dark .dark\:prose-invert a {
  color: #34d399;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text);
}

/* Selection */
::selection {
  background-color: #059669;
  color: white;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Smooth image loading */
img {
  max-width: 100%;
  height: auto;
}

/* Link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Button reset */
button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Order */
.order-1 { order: 1; }
.order-2 { order: 2; }
