* {
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
}

body {
    background-color: #0a0a0a;
    color: #e0e0e0;
    font-family: verdana;
}

h1 {
    text-align: center;
    margin: 8px 0;
    border-bottom: 2px solid #1a0a2e;
    padding-bottom: 8px;
}

h2 {
    margin: 8px;
    font-weight: normal;
    background-color: #1a0a2e;
    color: #e0e0e0;
    padding: 4px;
}

nav {
    background-color: var(--surface-light);
    padding: var(--spacing-md);
    border-radius: 0.5rem;
    margin: var(--spacing-lg) 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

nav a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 1rem;
    border-radius: 0.35rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    flex: 1 1 auto; /* Allows buttons to grow/shrink */
    min-width: fit-content; /* Prevents squishing */
}

nav a:hover {
    background-color: var(--accent-hover);
    color: var(--accent-primary);
}

/* Demos */

.flex-parent {
    border: 4px solid #b412ff;
    min-height: 100px;
    display: flex;
    margin: 8px 8px 40px 8px;
}

.flex-child {
    border: 4px solid #d18bff;
    min-height: 80px;
    margin: 8px;
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
}

/* Demo 2 */

.demo2 .flex-parent {
    justify-content: space-around;
}

.demo2 .flex-child {
    flex-grow: 0;
    min-width: 16px;
}

/* Demo 3 */

.demo3 .flex-parent {
    justify-content: space-between;
}

.demo3 .flex-child {
    flex-grow: 0;
    min-width: 16px;
}

/* Demo 4 */

.demo4 .flex-parent {
    justify-content: space-evenly;
}

.demo4 .flex-child {
    flex-grow: 0;
    min-width: 16px;
}

/* Demo 5 */

.demo5 .flex-parent {
    flex-direction: row-reverse;
}

.demo5 .flex-child:last-child {
    background-color: rgba(153, 0, 255, 0.3);
}

/* Demo 6 */

.demo6 .flex-parent {
    flex-flow: row wrap; /* flex-direction, flex-wrap */
    justify-content: space-evenly;
}

.demo6 .flex-child {
    background-color: rgba(153, 0, 255, 0.3);
    min-width: 200px;
    flex-grow: 1;
}

/* Demo 7 */

.demo7 .flex-parent {
    min-height: 200px;
    justify-content: center; /* horizontal center */
}

.demo7 .flex-child {
    flex-grow: 0;
}

.demo7 .flex-child:last-child {
    background-color: rgba(153, 0, 255, 0.3);
    min-width: 100px;
    aspect-ratio: 1;
    max-height: 100px;
    align-self: center; /* vertical center */
}

/* Demo 8 */

.demo8 .flex-parent {
    flex-flow: row wrap;
    justify-content: center;
    gap: 10px;
}

.demo8 .flex-child {
    flex-basis: 25%;
    margin: 0;
    flex-grow: 1;
}