:root {
    --bg: #1a1a2e;
    --bg-secondary: #16213e;
    --text: #eee;
    --text-muted: #aaa;
    --accent: #0f3460;
    --highlight: #e94560;
    --border: #333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
}

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

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

.download-btn {
    display: inline-block;
    background: var(--highlight);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.download-btn:hover {
    opacity: 0.9;
}

/* Sections */
section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-muted);
}

h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--accent);
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* Layout tabs */
.layout-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab:hover {
    border-color: var(--text-muted);
}

.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
}

/* Layout container */
.layout-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.layout-svg {
    display: none;
    max-width: 100%;
    height: auto;
}

.layout-svg.active {
    display: block;
}

.layout-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Row-stagger grid */
.rowstagger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.rowstagger-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
}

.rowstagger-item img {
    width: 100%;
    height: auto;
}

/* Magic training section */
#magic-training p {
    max-width: 700px;
    margin-bottom: 1rem;
}

ul.magic-examples {
    list-style: none;
    margin: 1rem 0 0 1rem;
}

ul.magic-examples li {
    margin-bottom: 0.25rem;
    font-family: 'SF Mono', Consolas, monospace;
}

/* Combos */
#combos ul {
    list-style: none;
    margin-left: 1rem;
}

#combos li {
    margin-bottom: 0.5rem;
}

code {
    background: var(--accent);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.9em;
}

/* About */
#about p {
    color: var(--text-muted);
    max-width: 700px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.github-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.github-link:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 600px) {
    main {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 0;
    }

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

    .layout-tabs {
        flex-wrap: wrap;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}
