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

:root {
    --bg-main: #F7F7F7;
    --bg-panel: #FAFAFA;
    --bg-code: #F5F5F5;
    --text-heading: #C65A5A;
    --text-body: #222222;
    --text-muted: #666666;
    --text-subtle: #999999;
    --border: #E0E0E0;
    --divider: #BBBBBB;
    --accent-blue: #5A7AC6;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-main);
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.6;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
    color: var(--text-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

h1 { font-size: 1.4rem; margin-bottom: 8px; }
h2 { font-size: 1.1rem; margin: 32px 0 12px; }
h3 { font-size: 0.95rem; margin-bottom: 8px; }

p { margin-bottom: 16px; }

a {
    color: var(--text-heading);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Header */
.site-header {
    text-align: center;
    margin-bottom: 20px;
}

.site-header h1 {
    margin-bottom: 4px;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Navigation */
.nav {
    text-align: center;
    margin-bottom: 30px;
}

.nav a {
    margin: 0 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nav a:hover {
    color: var(--text-heading);
}

.nav a.active {
    color: var(--text-heading);
}

/* Battle Header */
.battle-header {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 40px;
    text-align: center;
}

.battle-label {
    font-size: 0.7rem;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

#battleCanvas {
    background: var(--bg-code);
    border-radius: 4px;
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.scores {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
    font-size: 0.7rem;
}

.score-red { color: var(--text-heading); }
.score-blue { color: var(--accent-blue); }

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* Intro */
.intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 40px;
}

.intro p {
    margin-bottom: 8px;
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.project-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 4px;
}

.project-card h3 {
    margin-bottom: 8px;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.project-card .tags {
    margin-bottom: 12px;
}

.tags span {
    font-size: 0.7rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 6px;
    display: inline-block;
    margin-bottom: 4px;
}

.project-card .link {
    font-size: 0.8rem;
}

/* Code Block */
.code-block {
    background: var(--bg-code);
    padding: 16px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* Footer */
.site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.site-footer a {
    margin: 0 8px;
}

/* Section headers */
.section-header {
    margin-bottom: 20px;
}

/* Lists */
ul, ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 8px;
}

/* Back link */
.back-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: inline-block;
}

.back-link:hover {
    color: var(--text-heading);
}

/* CTA Box */
.cta-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 4px;
    text-align: center;
    margin: 32px 0;
}

.cta-box h3 {
    margin-bottom: 8px;
}

.cta-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.cta-box a {
    font-size: 0.9rem;
}

/* Service cards */
.service-item {
    margin-bottom: 24px;
}

.service-item h3 {
    margin-bottom: 4px;
}

.service-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Steps */
.steps {
    counter-reset: step;
    list-style: none;
    margin-left: 0;
}

.steps li {
    counter-increment: step;
    padding-left: 28px;
    position: relative;
}

.steps li::before {
    content: counter(step) ".";
    position: absolute;
    left: 0;
    color: var(--text-heading);
    font-weight: 600;
}

/* Contact Form */
.contact-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-body);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group .optional {
    color: var(--text-subtle);
    text-transform: none;
    font-size: 0.75rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-body);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-heading);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-subtle);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 12px 24px;
    background: var(--text-heading);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #b54a4a;
}

.form-note {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.form-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: none;
}

.form-result.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.form-result.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 20px 16px;
    }

    h1 { font-size: 1.2rem; }

    .nav a {
        margin: 0 8px;
        font-size: 0.8rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    #battleCanvas {
        width: 100%;
        height: auto;
    }
}
