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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --bg-color: #ffffff;
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Main Content Section */
section {
    padding: 3rem 2rem;
}

section:nth-child(even) {
    background-color: var(--light-bg);
}

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

h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h4 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
}

ul, ol {
    margin-bottom: 1rem;
    margin-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

strong {
    color: var(--primary-color);
}

/* DIE Pillars */
.die-pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.pillar-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.pillar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.pillar-card h3 {
    margin-top: 0;
    color: var(--accent-color);
}

.pillar-card.distributed {
    border-left-color: var(--accent-color);
}

.pillar-card.distributed h3 {
    color: var(--accent-color);
}

.pillar-card.immutable {
    border-left-color: var(--warning-color);
}

.pillar-card.immutable h3 {
    color: var(--warning-color);
}

.pillar-card.ephemeral {
    border-left-color: var(--success-color);
}

.pillar-card.ephemeral h3 {
    color: var(--success-color);
}

/* Operationalization Section */
.operationalize {
    background-color: var(--light-bg);
}

.playbook-intro {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.test-categories {
    margin-top: 2rem;
}

.category-section {
    margin-bottom: 3rem;
}

.category-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.category-header.distributed {
    background: var(--accent-color);
}

.category-header.immutable {
    background: var(--warning-color);
}

.category-header.ephemeral {
    background: var(--success-color);
}

.test-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.test-code {
    background: var(--light-bg);
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    overflow-y: hidden;
    border-left: 3px solid var(--accent-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin: 2rem 0 0 0;
    border-bottom: 2px solid var(--border-color);
    width: 100%;
}

.tab-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 1rem 2rem;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    color: var(--text-color);
    text-align: center;
}

.tab-button:hover {
    background: var(--light-bg);
}

.tab-button.active {
    color: white;
}

.tab-button.active.distributed {
    background: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-button.active.immutable {
    background: var(--warning-color);
    border-bottom-color: var(--warning-color);
}

.tab-button.active.ephemeral {
    background: var(--success-color);
    border-bottom-color: var(--success-color);
}

.tab-content {
    display: none;
    padding: 2rem 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.tab-content.active {
    display: block;
}

/* Collapsible Test Cards */
.test-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid var(--accent-color);
    transition: box-shadow 0.3s;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.test-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.test-card-header {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

.test-card-header:hover {
    background: var(--light-bg);
}

.test-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.expand-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
    color: var(--primary-color);
}

.test-card.expanded .expand-icon {
    transform: rotate(90deg);
}

.test-number {
    background: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.test-card.distributed {
    border-left-color: var(--accent-color);
}

.test-card.distributed .test-number {
    background: var(--accent-color);
}

.test-card.immutable {
    border-left-color: var(--warning-color);
}

.test-card.immutable .test-number {
    background: var(--warning-color);
}

.test-card.ephemeral {
    border-left-color: var(--success-color);
}

.test-card.ephemeral .test-number {
    background: var(--success-color);
}

.test-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.test-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 1.5rem;
    display: grid;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.test-card.expanded .test-details {
    max-height: 1000px;
    padding: 0 1.5rem 1.5rem 1.5rem;
    transition: max-height 0.5s ease-in;
}

.test-detail {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.test-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 0;
}

.test-value {
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    overflow: hidden;
}

.category-stats {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    word-wrap: break-word;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

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

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

    .test-detail {
        grid-template-columns: 1fr;
    }

    .die-pillars {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-top: 3rem;
}

.comparison-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.pets-card {
    border-left: 5px solid var(--red);
}

.cattle-card {
    border-left: 5px solid var(--green);
}

.comparison-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.emoji {
    font-size: 3rem;
}

.comparison-list {
    list-style: none;
}

.comparison-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #eee;
}

.comparison-list li::before {
    content: "• ";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.paradigm-badge {
    display: inline-block;
    margin-top: 1rem;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    color: white;
}

.paradigm-badge.fragile {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.paradigm-badge.resilient {
    background: linear-gradient(135deg, #51cf66, #37b24d);
}