body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
    line-height: 1.6;
    color: #000;
}

/* Top navigation bar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 32px;
    margin-bottom: 32px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.top-nav-left, .top-nav-right {
    flex: 1;
}

.top-nav-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 2;
}

.top-nav-right {
    display: flex;
    justify-content: flex-end;
}

.top-nav a {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    margin: 0 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 16px;
    white-space: nowrap;
}

.top-nav-left a, .top-nav-right a {
    border: 1px solid #d0d0d0;
}

.top-nav a:hover {
    color: #4285f4;
    background: #f8f9fa;
}

.top-nav-left a:hover, .top-nav-right a:hover {
    border-color: #4285f4;
}

.top-nav a.active {
    color: #4285f4;
    background: #f0f4ff;
    font-weight: 500;
}

.top-nav .separator {
    color: #ccc;
    margin: 0 4px;
    user-select: none;
}

h1 {
    font-size: 42px;
    text-align: center;
    margin-bottom: 16px;
    font-weight: normal;
    line-height: 1.4;
}

.nav {
    text-align: center;
    margin-bottom: 48px;
    font-size: 18px;
}

.nav a {
    color: #4285f4;
    text-decoration: none;
}

.nav a:hover {
    color: #76a7f6;
}

.links {
    text-align: center;
    margin-top: 24px;
    margin-bottom: 48px;
    font-size: 20px;
}

.links a {
    margin: 0 16px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: #f5f5f5;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s;
    color: #000;
}

.links a:hover {
    background: #e0e0e0;
}

.links i {
    font-size: 1.2em;
    margin-right: 8px;
}

a:not(.links a) {
    color: #4285f4;
    text-decoration: none;
}

a:not(.links a):hover {
    color: #76a7f6;
}

.gif-container {
    width: 100%;
}

.gif-container img {
    width: 100%;
    height: auto;
    display: block;
}

.figure {
    width: 80%;
    margin: 32px auto;
    text-align: center;
}

.figure img {
    width: 100%;
    height: auto;
    display: block;
}

.figure video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.caption {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-top: 4px;
    line-height: 1.5;
}

.caption {
    display: inline-block;
    text-align: left;
    color: #666;
    font-size: 16px;
    margin-top: 4px;
    line-height: 1.5;
}

.body-text {
    text-align: left;
    font-size: 18px;
    margin-top: 32px;
    line-height: 1.6;
}

.body-text ol {
    font-size: inherit;
    margin-left: 24px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.body-text ol li {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 12px;
    font-family: inherit;
    color: inherit;
}

.body-text ul {
    font-size: inherit;
    margin-left: 24px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.body-text ul li {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 12px;
    font-family: inherit;
    color: inherit;
}

.highlights {
    list-style-type: disc;
    margin-left: 24px;
    margin-top: 16px;
    margin-bottom: 32px;
    font-size: 18px;
    line-height: 1.6;
}

.highlights li {
    margin-bottom: 12px;
}

/* Ensure ordered lists use same font size as body text */
ol {
    font-size: 18px;
    margin-left: 24px;
    line-height: 1.6;
}

ol li {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 12px;
}

/* Ensure unordered lists use same font size as body text */
ul {
    font-size: 18px;
    margin-left: 24px;
    line-height: 1.6;
}

ul li {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 12px;
}

.boxed-text {
    border: 2px solid black;
    padding: 12px;
    margin: 20px auto;
    background: white;
    display: block;
    text-align: center;
    max-width: fit-content;
    font-size: 18px;
    line-height: 1.6;
}

.companion-text {
    border: 2px solid black;
    padding: 12px;
    margin: 20px auto;
    background: #f8f8f8;
    display: block;
    text-align: center;
    max-width: fit-content;
    font-size: 18px;
    line-height: 1.6;
}

/* Video overlay styles */
.video-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(128, 128, 128, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.video-overlay.hidden {
    opacity: 0;
}

@media (max-width: 600px) {
    body {
        margin: 40px auto;
    }
    
    h1 {
        font-size: 36px;
    }
    /* Hide Paper and Code links on small screens to save space */
    .top-nav-left,
    .top-nav-right {
        display: none;
    }
}

@media (max-width: 900px) {
    /* Hide Paper and Code links on narrow screens */
    .top-nav-left,
    .top-nav-right {
        display: none !important;
    }

    /* Center navigation also occupies full width and can wrap */
    .top-nav-center {
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 4px;
    }

    /* Reduce font size + padding so more items fit */
    .top-nav a {
        font-size: 14px;
        padding: 6px 10px;
        margin: 4px;
    }

    /* Hide the visual separators to save horizontal space */
    .top-nav .separator {
        display: none;
    }

    /* Allow nav bar itself to wrap to new line(s) if needed */
    .top-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    /* Ensure Paper and Code stay hidden after earlier 900px block overrides */
    /* (Already covered by 900px block, so this block is no longer needed) */
} 
