:root {
    --color-primary: #5B2C6F;
    --color-secondary: #7D3C98;
    --color-accent: #D4AC0D;
    --color-bg: #F9F5FC;
    --color-surface: #FFFFFF;
    --color-text: #2C1A3E;
    --color-text-light: #6B5F7A;
    --font-heading: 'Trebuchet MS', 'Lucida Grande', sans-serif;
    --font-body: Palatino, 'Book Antiqua', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-width: 320px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.25rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.875rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.3;
}

h4 {
    font-size: 1.25rem;
    line-height: 1.4;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header and Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--color-surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar {
    padding: 0.75rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-brand h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    gap: 2rem;
}

.nav-menu a {
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Main Content */
main {
    margin-top: 80px;
}

.welcome-section {
    background-color: var(--color-primary);
    color: white;
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 48px 0;
}

.welcome-section h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.welcome-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.content-with-sidebar {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    padding: 48px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.toc {
    background-color: var(--color-surface);
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.toc h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: 1.125rem;
}

.toc ul {
    list-style: none;
    margin: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    display: block;
    padding: 0.5rem 0;
    color: var(--color-text-light);
    border-left: 3px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
    transition: all 0.3s ease;
}

.toc a:hover {
    color: var(--color-primary);
    border-left-color: var(--color-accent);
    text-decoration: none;
}

.main-content {
    padding: 0 1rem;
}

.main-content section {
    margin-bottom: 3rem;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    padding: 1.5rem;
    background-color: var(--color-surface);
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    border-left: 6px solid var(--color-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.feature-item h3 {
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.service-card, .project-card {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 2rem 0;
}

.team-member {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-member h3 {
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.team-member h4 {
    color: var(--color-accent);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 2rem 0;
}

.result-item {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    border-left: 6px solid var(--color-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.result-item h3 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.result-item p {
    margin: 0;
    color: var(--color-text-light);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px;
    min-width: 44px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--color-primary);
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px;
    min-width: 44px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
}

.contact-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Contact Form */
.contact-form {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: white;
    transition: border-color 0.3s ease;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.contact-info, .hours-info, .consultation-info {
    background-color: var(--color-surface);
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.cta-section, .contact-cta {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    border-top: 6px solid var(--color-primary);
    border-left: 6px solid var(--color-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    margin: 2rem 0;
}

/* Footer */
footer {
    background-color: var(--color-surface);
    border-top: 3px solid var(--color-primary);
    padding: 3rem 0 1rem;
    margin-top: 48px;
}

.footer-brand h3 {
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.footer-nav {
    text-align: center;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    margin: 0 1rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.footer-nav a:hover {
    color: var(--color-primary);
}

.footer-contact {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.footer-social {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.footer-copyright {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.8rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-surface);
    border-top: 3px solid var(--color-primary);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
}

.cookie-buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 44px;
    min-width: 80px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--color-surface);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 0;
        transition: left 0.3s ease;
        gap: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-menu a {
        font-size: 1.125rem;
        padding: 1rem 2rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-6px, 6px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-6px, -6px);
    }

    .content-with-sidebar {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar {
        position: static;
        order: -1;
    }

    .welcome-section h1 {
        font-size: 2rem;
    }

    .welcome-section p {
        font-size: 1.125rem;
    }

    h1 {
        font-size: 1.875rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .contact-buttons {
        justify-content: center;
    }

    .footer-nav a {
        display: block;
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .welcome-section {
        padding: 24px 0;
        min-height: 70vh;
    }

    .welcome-section h1 {
        font-size: 1.75rem;
    }

    .welcome-section p {
        font-size: 1rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }

    .cookie-buttons button {
        flex: 1;
        max-width: 120px;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }

    .contact-buttons .btn-primary,
    .contact-buttons .btn-secondary {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #4A1A5A;
        --color-accent: #B8860B;
        --color-text: #000000;
        --color-text-light: #333333;
    }

    .btn-primary, .btn-secondary {
        border-width: 3px;
    }

    .toc a:hover,
    .nav-menu a:hover {
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
}