/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html.scroll-smooth {
    scroll-behavior: smooth;
}

/* Dark Mode Root */
:root {
    --primary: #5a9d5a;
    --secondary: #4a90a4;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Layout */
.fixed {
    position: fixed;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* Positioning */
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }

/* Z-index */
.z-50 {
    z-index: 50;
}

/* Display */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

/* Flex Direction */
.flex-col {
    flex-direction: column;
}

/* Flex Wrap */
.flex-wrap {
    flex-wrap: wrap;
}

/* Align Items */
.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-baseline {
    align-items: baseline;
}

/* Justify Content */
.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* Gap */
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Padding */
.p-2 { padding: 0.5rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-24 { padding-top: 6rem; }
.pb-16 { padding-bottom: 4rem; }
.pl-4 { padding-left: 1rem; }

/* Margin */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-top: 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-16 { margin-bottom: 4rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }

/* Height */
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }

/* Max Width */
.max-w-3xl {
    max-width: 48rem;
}

.max-w-none {
    max-width: none;
}

/* Flex */
.flex-1 {
    flex: 1 1 0%;
}

/* Font Size */
.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 Weight */
.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

/* Letter Spacing */
.tracking-tight {
    letter-spacing: -0.025em;
}

/* Line Height */
.leading-relaxed {
    line-height: 1.625;
}

/* Colors - Light Mode */
.bg-white {
    background-color: #ffffff;
}

.bg-neutral-50 {
    background-color: #fafafa;
}

.bg-neutral-100 {
    background-color: #f5f5f5;
}

.text-neutral-600 {
    color: #525252;
}

.text-neutral-700 {
    color: #404040;
}

.text-neutral-900 {
    color: #171717;
}

.text-primary {
    color: var(--primary);
}

.text-white {
    color: #ffffff;
}

.border-neutral-200 {
    border-color: #e5e5e5;
}

.border-transparent {
    border-color: transparent;
}

/* Background Opacity */
.bg-white\/80 {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Border */
.border {
    border-width: 1px;
    border-style: solid;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.border-l-2 {
    border-left-width: 2px;
    border-left-style: solid;
}

.border-primary {
    border-color: var(--primary);
}

/* Border Radius */
.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* Spacing */
.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

/* Transitions */
.transition-colors {
    -webkit-transition-property: color, background-color, border-color;
    transition-property: color, background-color, border-color;
    -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transition-duration: 150ms;
    transition-duration: 150ms;
}

.transition-all {
    -webkit-transition-property: all;
    transition-property: all;
    -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transition-duration: 150ms;
    transition-duration: 150ms;
}

/* Hover States */
.hover\:text-primary:hover {
    color: var(--primary);
}

.hover\:bg-neutral-100:hover {
    background-color: #f5f5f5;
}

.hover\:border-neutral-200:hover {
    border-color: #e5e5e5;
}

.hover\:border-primary:hover {
    border-color: var(--primary);
}

.hover\:-translate-y-1:hover {
    -webkit-transform: translateY(-0.25rem);
    transform: translateY(-0.25rem);
}

.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Group Hover */
.group:hover .group-hover\:scale-110 {
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

/* Cursor */
.cursor-default {
    cursor: default;
}

.cursor-pointer {
    cursor: pointer;
}

/* Pointer Events */
.pointer-events-none {
    pointer-events: none;
}

/* Prose */
.prose {
    color: #374151;
    max-width: 65ch;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose-neutral {
    --tw-prose-body: #404040;
}

/* Dark Mode Styles */
.dark {
    color-scheme: dark;
}

.dark .dark\:bg-\[\#090c0f\] {
    background-color: #090c0f;
}

.dark .dark\:bg-\[\#090c0f\]\/80 {
    background-color: rgba(9, 12, 15, 0.8);
}

.dark .dark\:bg-neutral-800 {
    background-color: #262626;
}

.dark .dark\:bg-neutral-800\/50 {
    background-color: rgba(38, 38, 38, 0.5);
}

.dark .dark\:text-neutral-100 {
    color: #f5f5f5;
}

.dark .dark\:text-neutral-400 {
    color: #a3a3a3;
}

.dark .dark\:border-neutral-800 {
    border-color: #262626;
}

.dark .dark\:hover\:text-primary:hover {
    color: var(--primary);
}

.dark .dark\:hover\:bg-neutral-800:hover {
    background-color: #262626;
}

.dark .dark\:hover\:border-neutral-800:hover {
    border-color: #262626;
}

.dark .dark\:hover\:border-primary:hover {
    border-color: var(--primary);
}

.dark .dark\:prose-invert {
    --tw-prose-body: #d4d4d4;
}

/* Backdrop Blur - Safari Compatible */
@supports (-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px)) {
    .backdrop-blur-md {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

/* Grid Columns */
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive Flex */
@media (min-width: 640px) {
    .sm\:flex-row {
        flex-direction: row;
    }
}

/* Fill */
svg {
    fill: currentColor;
}

/* Clip Rule & Fill Rule */
[fill-rule] {
    fill-rule: evenodd;
}

[clip-rule] {
    clip-rule: evenodd;
}

/* Additional Utility Classes */
.overflow-hidden {
    overflow: hidden;
}

/* Box Shadow */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Transform */
.-translate-y-1 {
    -webkit-transform: translateY(-0.25rem);
    transform: translateY(-0.25rem);
}

/* Mobile Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .hover\:bg-neutral-100:hover,
    .hover\:bg-neutral-100:active {
        background-color: #f5f5f5;
    }
    
    .dark .dark\:hover\:bg-neutral-800:hover,
    .dark .dark\:hover\:bg-neutral-800:active {
        background-color: #262626;
    }
    
    .hover\:-translate-y-1:active {
        -webkit-transform: translateY(-0.25rem);
        transform: translateY(-0.25rem);
    }
    
    /* Improve tap target sizes */
    button, a {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: rgba(90, 157, 90, 0.2);
    }
}
