:root {
    /* Core colors */
    --theme-color: #960018;
    --color-bg: #f0eee9;
    --color-text: #2b2c30;

    /* Extended palette */
    --theme-color-light: #b91e32;
    --theme-color-dark: #7a0013;
    --theme-color-subtle: rgba(150, 0, 24, 0.08);

    /* Neutral scale */
    --color-text-primary: #1a1b1e;
    --color-text-secondary: #5a5b5e;
    --color-text-tertiary: #8a8b8e;
    --color-border: #e5e3e0;
    --color-border-subtle: #efeceb;

    /* Shadows - layered, refined */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 12px 28px rgba(150, 0, 24, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);

    /* Spacing & radius */
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GitHub Corner Ribbon */
.github-corner {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    border: 0;
}

.github-corner:hover .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-25deg); }
    40%, 80% { transform: rotate(10deg); }
}

@media (max-width: 500px) {
    .github-corner:hover .octo-arm {
        animation: none;
    }
    .github-corner .octo-arm {
        animation: octocat-wave 560ms ease-in-out;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

header {
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 4rem;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--theme-color) 50%, transparent 100%);
    opacity: 0.3;
}

.header-logo {
    width: 128px;
    height: 128px;
    margin-bottom: 1.5rem;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--theme-color);
}

header h1 {
    color: var(--theme-color);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 0.75rem 0;
}

header p {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
    margin: 0;
}

/* Cards Grid */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.cards.cards-centered {
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .cards {
        gap: 2rem;
    }
}

@media (min-width: 768px) {
    .cards.cards-centered {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--theme-color) 0%, var(--theme-color-light) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--theme-color-subtle);
    color: var(--theme-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    transition: background var(--transition-base), color var(--transition-base);
}

.card:hover .card-icon {
    background: var(--theme-color);
    color: white;
}

.card:hover .card-icon .badge {
    background: white;
}

.card:hover .card-icon .badge.nightly {
    color: #92400e;
}

.card:hover .card-icon .badge.stable {
    color: #065f46;
}

.card h2 {
    color: var(--theme-color);
    margin: 0 0 0.5rem 0;
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card .tagline {
    color: var(--theme-color);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.card .description {
    margin-bottom: 1rem;
    flex-grow: 1;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.card .note {
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
}

.card ul {
    margin: 0 0 1.75rem 0;
    padding-left: 0;
    list-style: none;
}

.card li {
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    padding-left: 1.25rem;
    position: relative;
}

.card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--theme-color);
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
}

.card:hover li::before {
    opacity: 1;
}

.card a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-color);
    color: white;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    text-align: center;
}

.card a.btn:hover {
    background: var(--theme-color-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(150, 0, 24, 0.25);
}

.card a.btn::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform var(--transition-base);
}

.card a.btn:hover::after {
    transform: translateX(3px);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-left: 0.5rem;
}

.badge.nightly {
    background: #fef3c7;
    color: #92400e;
}

.badge.stable {
    background: #d1fae5;
    color: #065f46;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-tertiary);
    font-size: 0.875rem;
}

footer p {
    margin: 0.25rem 0;
}

footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color var(--transition-base);
}

footer a:hover {
    color: var(--theme-color);
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--theme-color);
    transition: width var(--transition-base);
}

footer a:hover::after {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem 3rem;
    }

    header {
        padding: 2rem 0 2rem;
        margin-bottom: 2.5rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    header p {
        font-size: 1rem;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.875rem;
    }
}
