:root {
    --bg-color: #E0E5EC;
    --text-primary: #3D4852;
    --text-secondary: #6B7280;
    --accent: #6C63FF;
    --shadow-light: rgba(255 255 255 / 80%);
    --shadow-dark: rgba(163 177 198 / 70%);
    --border-color: #d1d9e6;
    --border-color-light: rgba(255 255 255 / 30%);
    --border-color-dark: rgba(163 177 198 / 40%);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-primary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

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

/* Neumorphic Design System */

/* Flat Neumorphic Elements */
.nm-flat {
    background: var(--bg-color);
    box-shadow: 12px 12px 24px var(--shadow-dark),
                -12px -12px 24px var(--shadow-light);
    border-radius: 32px;
}

.nm-flat-sm {
    background: var(--bg-color);
    box-shadow: 6px 6px 12px var(--shadow-dark),
                -6px -6px 12px var(--shadow-light);
    border-radius: 16px;
}

/* Inset Neumorphic Elements */
.nm-inset {
    background: var(--bg-color);
    box-shadow: inset 8px 8px 16px var(--shadow-dark),
                inset -8px -8px 16px var(--shadow-light);
    border-radius: 16px;
}

/* Neumorphic Buttons */
.nm-button {
    background: var(--bg-color);
    box-shadow: 8px 8px 16px var(--shadow-dark),
                -8px -8px 16px var(--shadow-light);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
}

.nm-button:hover {
    box-shadow: 10px 10px 20px var(--shadow-dark),
                -10px -10px 20px var(--shadow-light);
    transform: translateY(-2px);
}

.nm-button:active,
.nm-button.active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark),
                inset -4px -4px 8px var(--shadow-light);
    transform: scale(0.98);
}

/* Button Variants */
.nm-button.primary {
    background: var(--accent);
    color: white;
    box-shadow: 8px 8px 16px rgba(108 99 255 / 40%),
                -8px -8px 16px rgba(255 255 255 / 80%);
}

.nm-button.primary:hover {
    box-shadow: 10px 10px 20px rgba(108 99 255 / 50%),
                -10px -10px 20px rgba(255 255 255 / 90%);
    background: var(--accent);
    color: white;
}

/* Input Fields */
.nm-input {
    background: var(--bg-color);
    box-shadow: inset 6px 6px 12px var(--shadow-dark),
                inset -6px -6px 12px var(--shadow-light);
    border-radius: 16px;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.nm-input:focus {
    box-shadow: inset 8px 8px 16px var(--shadow-dark),
                inset -8px -8px 16px var(--shadow-light);
}

.nm-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Mobile Menu */
.mobile-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    space-y: 2rem;
}

.mobile-menu a {
    transition: all 0.2s ease;
}

.mobile-menu a:hover,
.mobile-menu a:focus {
    color: var(--accent);
}

/* Curve Utilities */
.section-curve {
    border-radius: 32px;
}

.item-curve {
    border-radius: 16px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    transition: background 0.2s ease;
}

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

/* Hide Scrollbar (Chrome, Safari, Opera) */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
}

/* Hide Scrollbar (IE, Edge, Firefox) */
html, body, * {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

.fade-out {
    animation: fade-out 0.25s ease-out forwards;
}

/* Hover Effects */
.accent-glow:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgb(108 99 255 / 20%);
}

/* Transition Utilities */
.transition-sm {
    transition: all 0.2s ease;
}

.transition-md {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.transition-lg {
    transition: all 0.4s ease;
}

/* Focus Styles for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    :root {
        --font-size-base: 16px;
        --font-size-lg: 1.125rem;
        --font-size-xl: 1.25rem;
    }

    .nm-flat {
        border-radius: 24px;
        box-shadow: 8px 8px 16px var(--shadow-dark),
                    -8px -8px 16px var(--shadow-light);
    }
    
    .nm-flat-sm {
        border-radius: 12px;
    }
    
    .section-curve {
        border-radius: 24px;
    }
    
    .item-curve {
        border-radius: 12px;
    }

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

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    p {
        font-size: 1rem;
    }

    /* Navigation adjustments */
    header {
        padding: 1rem 0;
    }

    /* Hero section adjustments */
    .hero-section {
        padding: 4rem 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    /* Product grid adjustments */
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* Blog grid adjustments */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* Newsletter adjustments */
    .newsletter-section {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .newsletter-form {
        flex-direction: column;
        width: 100%;
    }

    .nm-input {
        width: 100%;
    }

    .nm-button {
        width: 100%;
    }

    /* Footer adjustments */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    /* Mobile menu adjustments */
    .mobile-menu {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
    }

    .mobile-menu a {
        font-size: 1.5rem;
    }

/* Scrollbar hiding for mobile */
html,
body,
* {
    -ms-overflow-style: auto;
    scrollbar-width: auto;
}

/* Touch-friendly adjustments for mobile */
@media (hover: none) and (pointer: coarse) {
    .nm-button {
        min-height: 48px;
        min-width: 48px;
    }

    .nm-input {
        min-height: 48px;
    }

    .nm-flat,
    .nm-inset {
        padding: 1.5rem;
    }

    /* Reduce touch target sizes on larger screens for accessibility */
    .mobile-menu a {
        padding: 1rem 0;
        min-height: 48px;
    }
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    :root {
        --font-size-base: 16px;
    }

    img {
        image-rendering: optimizeQuality;
    }

    /* Reduce motion for users who prefer it */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-float {
        animation: none;
    }

    .nm-button:hover {
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }

    /* Improve focus visibility for keyboard users */
    *:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 3px;
    }
}

/* Skip Link for Accessibility - WCAG 2.1 Compliance */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.3s ease;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.skip-link:focus {
    top: 0;
}

/* Skip link focus indicator for better visibility */
.skip-link:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.5);
}

/* Focus styles for all interactive elements - WCAG 2.1 Compliance */
*:focus-visible:not(a):not(button):not(input):not(select):not(textarea) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Focus rings for better keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

/* High contrast focus styles for low vision users */
@media (prefers-contrast: high) {
    *:focus-visible,
    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible {
        outline: 3px solid white;
        outline-offset: 3px;
    }
}

/* Reduced motion focus styles */
@media (prefers-reduced-motion: reduce) {
    *:focus-visible,
    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
        box-shadow: none;
    }
}

/* Focus trap for mobile menu */
.mobile-menu:focus-trap {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 50;
}

/* Live regions for screen readers */
[aria-live="polite"],
[aria-live="assertive"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Hidden content for screen readers only */
.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;
}

/* Hidden content for screen readers with fallback */
.sr-only-fallback {
    display: none;
}

/* Focus visible indication for keyboard users */
.keyboard-navigation *:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nm-button:hover {
        border: 2px solid var(--text-primary);
    }

    .nm-button.primary:hover {
        border: 2px solid white;
    }
}

/* Light mode focus indicator for low vision */
@media (prefers-color-scheme: light) {
    *:focus-visible,
    button:focus-visible,
    a:focus-visible {
        box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.3);
    }
}

/* Dark mode focus indicator for low vision */
@media (prefers-color-scheme: dark) {
    *:focus-visible,
    button:focus-visible,
    a:focus-visible {
        box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.4);
    }
}

/* Enhanced focus for mobile devices */
@media (hover: none) and (pointer: coarse) {
    *:focus-visible {
        outline: 3px solid var(--accent);
        outline-offset: 2px;
    }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible {
        box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.3);
    }
}

/* Reduced transparency in dark mode */
@media (prefers-color-scheme: dark) and (prefers-reduced-opacity: more) {
    :root {
        --shadow-light: rgba(255 255 255 / 0.15);
        --shadow-dark: rgba(0 0 0 / 0.35);
    }
}

/* Color contrast ratio adjustments for accessibility */
@media (prefers-reduced-contrast: more) {
    :root {
        --border-color: #ffffff;
        --border-color-light: rgba(255, 255, 255, 0.5);
        --border-color-dark: rgba(0, 0, 0, 0.5);
    }
}

/* Print optimization */
@media print {
    .nm-button,
    .nm-flat,
    .nm-inset,
    .mobile-menu,
    .mobile-menu-btn {
        display: none;
    }

    body {
        background-color: white;
        color: black;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a2e;
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
        --shadow-light: rgba(255 255 255 / 0.1);
        --shadow-dark: rgba(0 0 0 / 0.3);
        --border-color: rgba(255 255 255 / 0.1);
        --border-color-light: rgba(255 255 255 / 0.2);
        --border-color-dark: rgba(0 0 0 / 0.2);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --border-color-dark: #000000;
    }

    .nm-flat,
    .nm-inset,
    .nm-button {
        border: 1px solid var(--border-color);
    }
}

/* Reduce transparency in low-light conditions */
@media (prefers-low-contrast: high) {
    :root {
        --shadow-light: rgba(255, 255, 255, 0.4);
        --shadow-dark: rgba(0, 0, 0, 0.4);
    }
}
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .nm-flat {
        border-radius: 28px;
    }

    .nm-flat-sm {
        border-radius: 14px;
    }

    .section-curve {
        border-radius: 28px;
    }

    .item-curve {
        border-radius: 14px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screen adjustments */
@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 1400px;
    }

    :root {
        --font-size-base: 18px;
        --font-size-lg: 1.25rem;
        --font-size-xl: 1.5rem;
    }

    .nm-flat {
        box-shadow: 16px 16px 32px var(--shadow-dark),
                    -16px -16px 32px var(--shadow-light);
    }
}

/* Dark Mode Support (Optional - can be enabled later) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a2e;
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
        --shadow-light: rgb(255 255 255 / 10%);
        --shadow-dark: rgb(0 0 0 / 30%);
        --border-color: rgb(255 255 255 / 10%);
    }
}

/* Print Styles */
@media print {
    .nm-button,
    .nm-flat,
    .nm-inset {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
}