:root {
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --monospace: "SF Mono", "Monaco", "Inconsolata", "Fira Mono",
        "Droid Sans Mono", "Source Code Pro", "Hack", "Fira Code", monospace;
    --heading-font: "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
    --off-white: #f5f5f5;
    --off-black: #1a1a1a;
    --color-one: #ff4000;
    --color-two: #008cc0;
    --color-three: #cad700;
    --color-four: #009800;
    --color-five: #8000ff;
}

html,
body,
ul,
ol {
    margin: 0;
    padding: 0;
    font-family: var(--sans);
    color: var(--off-white);
}

html {
    width: 100%;
    height: 100%;
}

p {
    margin: 1rem 1rem 1rem 0;
    padding: 0;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 1rem 1rem 1rem 0;
    padding: 0;
    font-family: var(--heading-font);
    letter-spacing: -0.02em;
}

h1 {
    background: linear-gradient(90deg, 
        var(--color-one) 0%, 
        var(--color-one) 16%, 
        var(--color-two) 17%, 
        var(--color-two) 33%, 
        var(--color-three) 34%, 
        var(--color-three) 50%, 
        var(--color-four) 51%, 
        var(--color-four) 67%, 
        var(--color-five) 68%, 
        var(--color-five) 84%, 
        var(--color-one) 85%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    position: relative;
    display: inline-block;
    font-family: var(--heading-font);
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Colored text spans for Nemelex style */
.color-1 { color: var(--color-one); }
.color-2 { color: var(--color-two); }
.color-3 { color: var(--color-three); }
.color-4 { color: var(--color-four); }
.color-5 { color: var(--color-five); }

/* Subtle color rotation animation */
@keyframes color-rotate {
    0% { filter: hue-rotate(0deg) brightness(1); }
    20% { filter: hue-rotate(10deg) brightness(1.05); }
    40% { filter: hue-rotate(-10deg) brightness(1); }
    60% { filter: hue-rotate(5deg) brightness(1.05); }
    80% { filter: hue-rotate(-5deg) brightness(1); }
    100% { filter: hue-rotate(0deg) brightness(1); }
}

/* Wave animation */
@keyframes gentle-wave {
    0%, 100% { transform: translateY(0px); }
    25% { transform: translateY(-2px); }
    75% { transform: translateY(2px); }
}

h1 span {
    display: inline-block;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    animation: gentle-wave 6s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Sequential animation delay for wave effect */
h1 span:nth-child(1) { animation-delay: 0s; }
h1 span:nth-child(2) { animation-delay: 0.1s; }
h1 span:nth-child(3) { animation-delay: 0.2s; }
h1 span:nth-child(4) { animation-delay: 0.3s; }
h1 span:nth-child(5) { animation-delay: 0.4s; }
h1 span:nth-child(6) { animation-delay: 0.5s; }
h1 span:nth-child(7) { animation-delay: 0.6s; }
h1 span:nth-child(8) { animation-delay: 0.7s; }

/* Subtle glow effect on each color */
h1 span.color-1 { text-shadow: 0 0 10px rgba(255, 64, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); }
h1 span.color-2 { text-shadow: 0 0 10px rgba(0, 140, 192, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); }
h1 span.color-3 { text-shadow: 0 0 10px rgba(202, 215, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); }
h1 span.color-4 { text-shadow: 0 0 10px rgba(0, 152, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); }
h1 span.color-5 { text-shadow: 0 0 10px rgba(128, 0, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3); }

/* Interactive hover effect */
h1 span:hover {
    transform: translateY(-4px) scale(1.05);
    filter: brightness(1.2);
    animation-play-state: paused;
}

/* Color transition on hover */
h1:hover span {
    animation: color-rotate 8s linear infinite;
}

h1:hover span:nth-child(1) { animation-delay: 0s; }
h1:hover span:nth-child(2) { animation-delay: 0.2s; }
h1:hover span:nth-child(3) { animation-delay: 0.4s; }
h1:hover span:nth-child(4) { animation-delay: 0.6s; }
h1:hover span:nth-child(5) { animation-delay: 0.8s; }
h1:hover span:nth-child(6) { animation-delay: 1s; }
h1:hover span:nth-child(7) { animation-delay: 1.2s; }
h1:hover span:nth-child(8) { animation-delay: 1.4s; }

h1::after {
    display: none;
}

h2 {
    color: var(--color-two);
    border-left: 4px solid var(--color-two);
    padding-left: 1rem;
}

h3 {
    color: var(--color-three);
}

a {
    color: var(--color-two);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--color-three);
    text-shadow: 0 0 5px currentColor;
}

.hidden {
    display: none !important;
}

body {
    background-color: #0f0f0f;
    font-family: var(--sans);
    overflow-x: hidden;
}

li {
    padding: 0.25rem 0 0.25rem 0;
}

ul ul,
ul ol,
ol ul,
ol ol {
    padding-left: 2rem;
}

figcaption {
    font-weight: bold;
    text-decoration: underline;
}

.inset-list {
    margin-left: 2rem;
}

blockquote {
    margin: 0.5rem;
}

table {
    border-collapse: collapse;
    margin: 1rem 0 1rem 0;
}

th, td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #444;
}

th {
    background-color: #2a2a2a;
    color: var(--color-three);
    font-weight: bold;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

button {
    background-color: #2a2a2a;
    color: var(--off-white);
    border: 2px solid var(--color-two);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--color-two);
    box-shadow: 0 0 15px var(--color-two);
    transform: translateY(-2px);
}

aside {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    float: right;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-left: 4px solid var(--color-one);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cite {
    font-size: small;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.centering {
    display: flex;
    justify-content: center;
}

.serif {
    font-family: serif;
}

.anchor {
    text-decoration: none;
    color: inherit;
}

.bold {
    font-weight: bold;
}

.underline {
    text-decoration: underline;
}

.div-label {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

#main-header {
    display: flex;
    flex-flow: row nowrap;
}

#header-div {
    flex: 4 2 auto;
}

#main-logo-container {
    display: flex;
    flex: 1 1 auto;
    padding-bottom: 0.25rem;
}

#main-logo {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 6.5rem;
    object-fit: contain;
    float: right;
    margin: auto;
}

@media (max-width: 640px) {
    #blurb {
        display: none;
    }
}

#toc {
    display: inline-block;
    margin: 0 1rem 1rem 1.5rem;
    padding: 1rem 2rem 1rem 2.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    max-width: 55%;

    max-height: 3.25rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: inset 0 -1rem 1.5rem -1rem rgba(0, 0, 0, 0.5);
}

#toc:hover {
    max-height: none;
    box-shadow: none;
}

#toc-label {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.subheader {
    margin-top: -0.5rem;
    padding: 0 1.5rem 0 1.5rem;
    font-weight: lighter;
}

footer {
    padding: 1rem 33.3% 1rem 33.3%;
    font-size: small;
    text-align: center;
}

@media (max-width: 640px) {
    footer {
        padding: 1rem 15% 1rem 15%;
    }
}

nav {
    display: flex;
    align-items: stretch;
    justify-content: center;
    background-color: #0f0f0f;
    min-height: 2rem;
    max-height: 4rem;
    border-top: 2px solid #888;
    border-bottom: 2px solid #888;
    position: relative;
}

nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(202, 215, 0, 0.1) 100px,
            rgba(202, 215, 0, 0.1) 101px
        );
    pointer-events: none;
}

nav::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        #666 10%,
        #666 90%,
        transparent 100%
    );
}

.navlist {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-direction: row;

    width: 100%;
}

.navlist li {
    flex: 1 1 auto;
    list-style-type: none;
    text-align: center;

    width: 100%;
    height: 100%;
    padding: 0 5% 0 5%;
}

.navlist a {
    font-weight: bolder;
    color: var(--off-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.navlist li:nth-child(1) a:hover {
    color: var(--color-one);
    border-bottom-color: var(--color-one);
    text-shadow: 0 0 10px var(--color-one);
    animation: pulse 1s ease infinite;
}

.navlist li:nth-child(2) a:hover {
    color: var(--color-two);
    border-bottom-color: var(--color-two);
    text-shadow: 0 0 10px var(--color-two);
    animation: pulse 1s ease infinite;
}

.navlist li:nth-child(3) a:hover {
    color: var(--color-three);
    border-bottom-color: var(--color-three);
    text-shadow: 0 0 10px var(--color-three);
    animation: pulse 1s ease infinite;
}

.section {
    display: block;
    width: 100%;
    overflow: hidden;
}

#section-0,
#section-5,
#section-10,
#section-15,
#section-20,
#section-25,
#section-30 {
    background: linear-gradient(135deg, #2a2020 0%, #4a1a0a 100%);
    border-left: 4px solid var(--color-one);
    position: relative;
}

#section-0::before,
#section-5::before,
#section-10::before,
#section-15::before,
#section-20::before,
#section-25::before,
#section-30::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(255, 64, 0, 0.05), transparent 70%);
    pointer-events: none;
}

#section-1,
#section-6,
#section-11,
#section-16,
#section-21,
#section-26,
#section-31 {
    background: linear-gradient(135deg, #1a2025 0%, #003040 100%);
    border-left: 4px solid var(--color-two);
    position: relative;
}

#section-1::before,
#section-6::before,
#section-11::before,
#section-16::before,
#section-21::before,
#section-26::before,
#section-31::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(0, 140, 192, 0.05), transparent 70%);
    pointer-events: none;
}

#section-2,
#section-7,
#section-12,
#section-17,
#section-22,
#section-27 {
    background: linear-gradient(135deg, #252520 0%, #3d4000 100%);
    border-left: 4px solid var(--color-three);
    position: relative;
}

#section-2::before,
#section-7::before,
#section-12::before,
#section-17::before,
#section-22::before,
#section-27::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(202, 215, 0, 0.05), transparent 70%);
    pointer-events: none;
}

#section-3,
#section-8,
#section-13,
#section-18,
#section-23,
#section-28 {
    background: linear-gradient(135deg, #1a201a 0%, #003300 100%);
    border-left: 4px solid var(--color-four);
    position: relative;
}

#section-3::before,
#section-8::before,
#section-13::before,
#section-18::before,
#section-23::before,
#section-28::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(0, 152, 0, 0.05), transparent 70%);
    pointer-events: none;
}

#section-4,
#section-9,
#section-14,
#section-19,
#section-24,
#section-29 {
    background: linear-gradient(135deg, #201a25 0%, #2d0050 100%);
    border-left: 4px solid var(--color-five);
    position: relative;
}

#section-4::before,
#section-9::before,
#section-14::before,
#section-19::before,
#section-24::before,
#section-29::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(128, 0, 255, 0.05), transparent 70%);
    pointer-events: none;
}

.inner-section {
    padding: 2rem 20% 2rem 20%;
    position: relative;
    z-index: 1;
}

@media (max-width: 1200px) {
    .inner-section {
        padding: 1.5rem 15% 1.5rem 15%;
    }
}

@media (max-width: 768px) {
    .inner-section {
        padding: 1rem 10% 1rem 10%;
    }
}

@media (max-width: 480px) {
    .inner-section {
        padding: 1rem 5% 1rem 5%;
    }
}

.inner-section::after {
    content: "";
    clear: both;
    display: table;
}

.form {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

