body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #ffffff;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.logo h1 {
    margin: 0;
    font-size: 24px;
    color: #1d1d1f;
}

/* Navigation Menu */
nav {
    display: flex;
    align-items: center;
    margin-right: 2%;
}

nav a {
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s;
    padding: 10px 15px;
}

nav a:hover {
    color: #7051ef;
}

/* Hamburger Menu Icon */
.menu-icon {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-right: 5%;
}

.menu-icon span {
    height: 3px;
    width: 25px;
    background: #1d1d1f;
    margin: 4px 0;
    transition: 0.3s;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .menu-icon {
        display: flex;
    }

    nav {
        position: absolute;
        top: 80px;
        /* Adjusted for header */
        align-self: center;
        background: #ffffff;
        flex-direction: column;
        width: 90%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.231);
        border-radius: 10px;
    }

    nav.active {
        max-height: 300px;
        /* Adjust based on content */
    }

    nav a {
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid #f5f5f7;
    }
}

.main-content {
    margin-top: 80px;
    /* Adjusted for header */
    flex: 1;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

h2 {
    color: #1d1d1f;
    font-size: 22px;
    margin-bottom: 20px;
}

h3 {
    color: #1d1d1f;
    font-size: 18px;
    margin-top: 0;
}

pre {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
    color: #1d1d1f;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.visualization {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f7;
    border-radius: 8px;
    text-align: center;
}

.visualization img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

footer {
    background: #ffffff;
    color: #1d1d1f;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer a {
    color: #7051ef;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/*.pseudo-code {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: monospace;
    font-size: 14px;
    color: #1d1d1f;
}*/