/* Layout follows the DiGS project page (chumbyte.github.io/DiGS-Site). */

:root {
    --text: #414141;
    --muted: rgba(52, 27, 43, 0.76);
    --accent: dodgerblue;
    --code-bg: #f4f4f4;
    --placeholder: #e9eef3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #ffffff;
    color: var(--text);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.default-container {
    max-width: 960px;
    margin: auto;
    padding: 2.5em 16px 0;
    text-align: center;
    font-size: large;
}

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

/* ##### Hero ##### */

.title {
    font-size: 2.2em;
    font-weight: 600;
    line-height: 1.25;
    margin: 0.4em 0 0.2em;
}

.venue {
    font-size: x-large;
    font-weight: 400;
    margin: 0 0 0.5em;
}

.author-section { padding: 0.5em 0 1em; }

.author {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    padding: 1em;
    vertical-align: top;
}

.author .image {
    width: 110px;
    height: 122px;
    border-radius: 10px;
    object-fit: cover;
    transition: opacity .2s;
}
.author .image:hover { opacity: 0.6; }
.author > a { display: block; line-height: 0; }

.placeholder-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--placeholder);
    color: #8a97a6;
    font-size: 1.8em;
    font-weight: 600;
}

.affiliation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2em 1.4em;
    color: var(--muted);
}

.contact {
    margin-top: 0.4em;
    color: var(--muted);
}

.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6em;
    padding: 1.2em 0 0.5em;
}

/* Button 80 from https://getcssscan.com/css-buttons-examples, as on DiGS */
.button-80 {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: #fff;
    border: .125rem solid currentColor;
    border-radius: 10rem;
    color: var(--accent);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 0.3rem 0.9rem;
    transition: transform .2s;
}
.button-80:hover { transform: scale(1.05); text-decoration: none; }
.button-80:active { transform: scale(1.05) translateY(.125rem); }

.link-icon { width: 1em; height: 1em; }

/* ##### Sections ##### */

.section-title {
    font-size: 1.8em;
    font-weight: 600;
    margin: 0.6em 0 0.6em;
}

.subsection-title {
    font-size: 1.3em;
    font-weight: 600;
    margin: 1.6em 0 0.4em;
}

.abstract-text,
.explanation-text,
.thanks-text,
.steps {
    text-align: justify;
}

.steps { padding-left: 1.4em; }

.takeaways {
    max-width: 760px;
    margin: 0 auto;
    padding-left: 1.2em;
    text-align: left;
}
.takeaways li { margin-bottom: 0.3em; }
.steps li { margin-bottom: 0.3em; }

.wide-img {
    display: block;
    width: 100%;
    height: auto;
    margin: 1em auto;
}

.caption {
    text-align: justify;
    font-size: 0.95em;
    color: #555;
}

/* ##### Videos ##### */

.main-video-div {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
}
.main-video-div iframe,
.main-video-div video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
    margin: 1.2em auto;
    width: 80%;
}
.video-row.three {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
}

.video-slot {
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
}
.video-slot video { width: 100%; height: 100%; object-fit: cover; display: block; }

.result-video {
    display: block;
    width: 100%;
    height: auto;
    margin: 1em auto;
}

.square-video { max-width: 720px; }

.note { margin: 0 0 0.4em; text-align: justify; }

.video-wrap { margin: 1em auto; }
.video-wrap .result-video { margin: 0; cursor: pointer; }

.video-bar {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.3em 0;
}
.video-bar button {
    flex: none;
    width: 1.6em;
    height: 1.6em;
    padding: 0.3em;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--accent);
    cursor: pointer;
}
.video-bar button:hover { background: var(--placeholder); }
.video-bar svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.video-bar input[type=range] {
    flex: 1;
    height: 3px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ##### Method: video + problem statement ##### */

.method-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1em;
    align-items: center;
}
.method-row .video-wrap { margin: 0; }
.problem {
    text-align: left;
    background: var(--code-bg);
    border-radius: 10px;
    padding: 0.4em 0.9em;
}
.problem .step { padding: 0.7em 0; }
.problem .step + .step { border-top: 1px solid #e2e2e2; }
.problem h4 {
    margin: 0 0 0.2em;
    color: var(--accent);
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.problem p { margin: 0.1em 0; }
.problem .where { color: #666; text-align: center; }
.problem .katex-display { margin: 0.3em 0; }
.problem .math { overflow-x: auto; overflow-y: hidden; font-size: 0.9em; }

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--placeholder);
    color: #8a97a6;
    font-size: 0.95em;
    border: 2px dashed #c8d2dc;
    border-radius: 10px;
}

/* ##### In-page paper viewer (sandboxed previews) ##### */

.pdf-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow-y: auto;
    background: rgba(30, 30, 30, 0.85);
}
.pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 16px 32px;
}
.pdf-pages canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
.pdf-status { color: #eee; }
.pdf-close {
    position: fixed;
    top: 8px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

/* ##### BibTeX & footer ##### */

.ref .default-container { text-align: left; }
.ref .section-title { text-align: center; }

.bibtex {
    background: var(--code-bg);
    color: #555;
    padding: 1em 1.2em;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85em;
}

.footer {
    color: #888;
    font-size: 0.85em;
    padding-bottom: 2.5em;
}
.footer .default-container { font-size: inherit; }

/* ##### Phone ##### */

@media (max-width: 640px) {
    .default-container { font-size: medium; }
    .title { font-size: 1.6em; }
    .title br { display: none; }
    .author .image { width: 80px; height: 89px; }
    .video-row { width: 100%; }
    .video-row.three { grid-template-columns: 1fr; }
    .method-row { grid-template-columns: 1fr; }
}
