:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-bg: #34495e;
    --text-color: #333;
    --light-text: #f8f9fa;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.legend-swatch {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: .25rem;
    margin-right: .5rem;
    vertical-align: middle;
}

.swatch-vh { background:#800080; }
.swatch-h { background:#ff0000; }
.swatch-m { background:#ff7f00; }
.swatch-l { background:#0000ff; }
.swatch-vl { background:#ffffff; border:1px solid #cbd5e1; }

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fafafa;
    margin: 0;
    padding: 0;
    opacity: 0;
    animation: fadeIn 1s ease-in-out forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    background-color: var(--dark-bg);
    color: var(--light-text);
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideDown 0.8s ease-out forwards;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
}

.content-section:nth-child(1) { animation-delay: 0.2s; }
.content-section:nth-child(2) { animation-delay: 0.4s; }
.content-section:nth-child(3) { animation-delay: 0.6s; }
.content-section:nth-child(4) { animation-delay: 0.8s; }
.content-section:nth-child(5) { animation-delay: 1.0s; }
.content-section:nth-child(6) { animation-delay: 1.2s; }
.content-section:nth-child(7) { animation-delay: 1.4s; }
.content-section:nth-child(8) { animation-delay: 1.6s; }
.content-section:nth-child(9) { animation-delay: 1.8s; }

header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem;
}

p {
    margin-bottom: 1.2rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.content-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.image-container {
    margin: 1.5rem 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    align-items: end
}

.image-caption {
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background-color: var(--primary-color);
    color: #fff;
}

tr:nth-child(even) {
    background-color: var(--light-bg);
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.color-box {
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
}

.color-purple { background-color: purple; }
.color-red { background-color: red; }
.color-orange { background-color: orange; color: black; }
.color-blue { background-color: blue; }
.color-white { background-color: white; color: black; border: 1px solid #ddd; }

.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .content-section {
        padding: 1.5rem;
    }
}
