:root {
    --primary-color: #0366d6;
    --secondary-color: #28a745;
    --dark-bg: #24292e;
    --light-bg: #f6f8fa;
    --border-color: #e1e4e8;
    --text-color: #24292e;
    --text-muted: #586069;
    --code-bg: #f6f8fa;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

nav a.github-link {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(to bottom, var(--light-bg), white);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0256c7;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Sections */
section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Features Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-muted);
}

/* Quick Start Steps */
.step {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #0256c7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.step-content ol {
    margin-left: 1.5rem;
}

.step-content ol li {
    margin: 0.5rem 0;
}

/* Code blocks */
pre {
    background: var(--dark-bg);
    color: #e1e4e8;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

p code, li code {
    background: var(--code-bg);
    color: #d73a49;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Workflow Section */
.workflow {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3rem;
}

.workflow-step {
    flex: 1;
    min-width: 250px;
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.workflow-step h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.workflow-step ul {
    list-style: none;
}

.workflow-step ul li {
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.workflow-step ul li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.workflow-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Technical Details */
.technical-details {
    margin-top: 3rem;
}

.technical-details h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.detail-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary-color);
}

.detail-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Workflow Grid */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.workflow-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.workflow-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.workflow-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.workflow-card p {
    margin-bottom: 1rem;
}

.workflow-card ul {
    list-style: none;
    margin-bottom: 1rem;
}

.workflow-card ul li {
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.workflow-card ul li:before {
    content: "✓";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.workflow-usage {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.workflow-usage ol {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Troubleshooting */
.trouble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.trouble-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.trouble-card h3 {
    color: #d73a49;
    margin-bottom: 1rem;
}

.trouble-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.trouble-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.trouble-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.trouble-item p {
    margin: 0.3rem 0;
    color: var(--text-muted);
}

.solution {
    color: var(--secondary-color) !important;
    font-weight: 500;
}

.trouble-card ul {
    list-style: none;
}

.trouble-card ul li {
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.trouble-card ul li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Requirements */
.req-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.req-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 8px;
}

.req-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.req-card ul {
    list-style: none;
}

.req-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.req-card ul li:before {
    content: "✓";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.req-card a {
    color: var(--primary-color);
    text-decoration: none;
}

.req-card a:hover {
    text-decoration: underline;
}

/* Serial Output */
.serial-output pre {
    background: #1e1e1e;
    color: #4ec9b0;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Project Structure */
.project-structure pre {
    background: var(--dark-bg);
    color: #e1e4e8;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* API Usage */
.api-usage {
    padding: 3rem 0;
}

.api-usage h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.api-usage h4 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    color: var(--primary-color);
}

.api-example {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.api-example pre {
    background: var(--dark-bg);
    color: #e1e4e8;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    overflow-x: auto;
    margin-top: 1rem;
}

.api-methods,
.api-features {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.api-methods ul,
.api-features ul {
    list-style: none;
    margin-top: 1rem;
}

.api-methods ul li,
.api-features ul li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.api-methods ul li:last-child,
.api-features ul li:last-child {
    border-bottom: none;
}

.api-methods ul li:before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
}

.api-features ul li:before {
    content: "✓";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.api-methods code,
.api-features code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #e83e8c;
}

/* Contributing */
.contributing ul {
    list-style: none;
    margin-top: 1rem;
}

.contributing ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.contributing ul li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

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

    .feature-grid,
    .workflow-grid,
    .trouble-grid,
    .req-grid {
        grid-template-columns: 1fr;
    }

    .workflow {
        flex-direction: column;
    }

    .workflow-arrow {
        transform: rotate(90deg);
    }

    .step {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        display: block;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    section {
        padding: 2rem 0;
    }

    .hero {
        padding: 2rem 0;
    }

    pre {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}

/* Print Styles */
@media print {
    header {
        background: white;
        color: black;
    }

    .hero-buttons,
    nav {
        display: none;
    }

    .feature-card,
    .workflow-card,
    .trouble-card {
        page-break-inside: avoid;
    }
}
