:root {
    --bs-font-sans-serif: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --bs-font-serif: "Source Serif 4", serif;
    --bs-font-monospace: "Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --bs-font-cursive: "Handlee", cursive;
    --bs-body-font-family: var(--bs-font-serif);
    --bs-heading-font-family: var(--bs-font-sans-serif);
}

h1, h2, h3, h4, h5, h6 { font-family: var(--bs-heading-font-family); }

.font-sans { font-family: var(--bs-font-sans-serif); }
.font-cursive { font-family: var(--bs-font-cursive); }

.max-w-sm { max-width: 576px; }
.max-w-md { max-width: 768px; }
.max-w-lg { max-width: 992px; }

/* Section palette: subtle alternating tints for visual separation */
.section-overview   { background: #ffffff; }
.section-abstract   { background: #f6f3ee; }  /* warm cream */
.section-method     { background: #ffffff; }
.section-study      { background: #eef2f7; }  /* cool blue-gray */
.section-brickmatic { background: #ffffff; }
.section-citation   { background: #f6f3ee; }  /* warm cream */
.section-ack        { background: #ffffff; }
.section-related    { background: #eef2f7; }  /* cool blue-gray */

.section-overview,
.section-abstract,
.section-method,
.section-study,
.section-brickmatic,
.section-citation,
.section-ack,
.section-related {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Related Work cards: image/gif on left, text on right, stacked on mobile */
.rw-list {
    max-width: 960px;
    display: grid;
    gap: 1.5rem;
}

.rw-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    align-items: start;
}

.rw-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rw-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rw-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.rw-title a {
    color: #212529;
    text-decoration: none;
}
.rw-title a:hover { color: #0d6efd; text-decoration: underline; }

.rw-authors {
    font-size: 0.92rem;
    color: #495057;
    margin: 0 0 0.2rem;
}

.rw-venue {
    font-size: 0.85rem;
    font-style: italic;
    color: #6c757d;
    margin: 0 0 0.6rem;
}

.rw-desc {
    font-size: 0.95rem;
    color: #495057;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .rw-card { grid-template-columns: 1fr; }
    .rw-media { max-width: 420px; margin: 0 auto; }
}

/* Horizontal-scroll gallery, shared by BrickMatic videos and BrickGPT GLBs */
.scroll-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0 1.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.scroll-row::-webkit-scrollbar { height: 10px; }
.scroll-row::-webkit-scrollbar-thumb { background: #adb5bd; border-radius: 5px; }
.scroll-row::-webkit-scrollbar-track { background: #e9ecef; border-radius: 5px; }

.scroll-card {
    flex: 0 0 auto;
    width: 340px;
    scroll-snap-align: start;
    margin: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 0.75rem;
}

.scroll-card video {
    width: 100%;
    max-height: 260px;
    border-radius: 6px;
    display: block;
    background: #000;
}

.scroll-card model-viewer {
    width: 100%;
    height: 280px;
    border-radius: 6px;
    display: block;
    background: #f8f9fa;
}

.scroll-card figcaption {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    text-align: center;
}

/* BibTeX block */
pre.bibtex {
    max-width: 820px;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-family: var(--bs-font-monospace);
    font-size: 0.9rem;
    line-height: 1.45;
    overflow-x: auto;
    color: #212529;
    white-space: pre;
}
