:root {
    --text-main: #333333;
    --text-light: #666666;
    --bg-color: #fdfdfd;
    --link-color: #0056b3;
    --border-color: #eaeaea;
    --btn-bg: #f4f4f4;
    --btn-hover: #e0e0e0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-width: 320px;
    overflow-x: hidden;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, .sans-serif {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: min(calc(100% - 32px), 960px);
    margin: 0 auto;
    padding: 40px 0;
}

/* Nav Buttons */
.nav-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.btn {
    font-family: sans-serif;
    background-color: var(--btn-bg);
    color: #333;
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 0.95em;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background-color: var(--btn-hover);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

.btn-primary:hover {
    background-color: #333;
    color: #fff;
}

.btn-disabled {
    opacity: 0.65;
    cursor: default;
}

.btn-disabled:hover {
    background-color: var(--btn-bg);
    color: #333;
    transform: none;
    text-decoration: none;
}

/* Header & Logos */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 28px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto 30px;
}

/* Separate classes avoid relying on the files' very large intrinsic sizes. */
.logos img {
    display: block;
    flex: 0 1 auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.logo-mit {
    width: 145px !important;
    max-height: 64px;
}

.logo-motional {
    width: 225px !important;
    max-height: 64px;
}

.logos img:hover { opacity: 1; }

.title {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 15px;
    color: #111;
}
.publication-badge { display: inline-block; background-color: #111; color: #fff; padding: 5px 12px; font-size: 0.9em; border-radius: 4px; margin-bottom: 20px; font-family: sans-serif; letter-spacing: 0.5px; }

.authors { font-size: 1.15em; margin-bottom: 10px; }
.authors a { color: var(--text-main); text-decoration: underline; text-decoration-color: #aaa; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 0.2s; }
.authors a:hover { color: var(--link-color); text-decoration-color: var(--link-color); }
.affiliations { font-size: 0.95em; color: var(--text-light); margin-bottom: 8px; }
.author-notes { font-size: 0.9em; color: var(--text-light); margin-bottom: 20px; font-family: sans-serif; }

/* Content Sections */
.content-section { margin-bottom: 60px; }
.section-title {
    font-size: clamp(1.45rem, 3vw, 1.8rem);
    line-height: 1.25;
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 10px;
    margin-bottom: 25px;
}
.abstract-text { text-align: justify; font-size: 1.05em; }

/* Figures */
.figure-img {
    display: block;
    width: 100%;
    max-width: 850px;
    height: auto;
    margin: 30px auto 15px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}
.figure-caption { text-align: center; font-family: sans-serif; font-size: 0.9em; color: var(--text-light); margin-bottom: 30px; }

/* Side-by-Side Layout */
.figure-row {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    align-items: flex-start;
}

.figure-col { flex: 1; }
.figure-col .figure-img { margin-top: 0; margin-bottom: 10px; }

/* Video Grids */
.video-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Strict 2-Column Grid for comparisons */
.video-grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 40px;
}
.grid-header { font-family: sans-serif; font-size: 1.1em; font-weight: 600; text-align: center; margin-bottom: -10px; color: #444; }

@media (max-width: 768px) {
    .container {
        width: min(calc(100% - 24px), 960px);
        padding-top: 24px;
    }

    .logos {
        gap: 18px;
        margin-bottom: 24px;
    }

    .logo-mit { width: 120px !important; }
    .logo-motional { width: 185px !important; }

    .figure-row { flex-direction: column; }
    .video-grid-2-col { grid-template-columns: 1fr; }
    .grid-header { display: none; } /* Hide column headers on mobile stack */
    .abstract-text { text-align: left; }
}

@media (max-width: 420px) {
    .logos {
        flex-direction: column;
        gap: 12px;
    }

    .logo-mit { width: 110px !important; }
    .logo-motional { width: 170px !important; }

    .btn {
        width: 100%;
        text-align: center;
    }
}

.video-wrapper {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 4px; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-caption { text-align: center; font-family: sans-serif; font-size: 0.9em; color: var(--text-light); margin-top: 10px; font-weight: 500; }

/* Citation Block */
.citation-block { background: #f8f9fa; padding: 20px; border-left: 4px solid #111; border-radius: 4px; font-family: monospace; font-size: 0.9em; overflow-x: auto; color: #444; }

/* SAGAT Concept Blocks */
.concept-block { margin-bottom: 50px; padding-bottom: 40px; border-bottom: 1px solid var(--border-color); }
.concept-block:last-of-type { border-bottom: none; padding-bottom: 0; }
.concept-header { font-size: 1.3em; font-weight: 600; color: #222; margin: 0 0 15px 0; }

.footer { text-align: center; margin-top: 80px; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 0.9em; color: var(--text-light); font-family: sans-serif; }
