/* ================= tokens ================= */

:root {
    --bg: #ffffff;
    --ink: #000000;
    --ink-2: #656565;
    --ink-3: #8c8c8c;
    --rule: #ebebeb;
    --rule-2: #d4d4d4;
    --link: #1772d0;
    --hover: #f09228;
    --card: #ffffff;
    --ph: max(100vh, 560px);
    --gap: clamp(46px, 6vh, 96px);      /* between the parts of the front page */
    --top: clamp(76px, 13.5vh, 190px);  /* above the name */
}
@supports (height: 100svh) {
    :root { --ph: max(100svh, 560px); }
}

body.dark {
    --bg: #050a0e;
    --ink: #f3f5f6;
    --ink-2: #98a1a6;
    --ink-3: #5c676d;
    --rule: #12202a;
    --rule-2: #1e3542;
    --acc: #fcee09;
    --link: #00f0ff;
    --hover: #00ff9f;
    --card: #060d12;
}

/* ================= base ================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 15px/1.55 'Lato', 'Hind Madurai', Verdana, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .3s ease, color .3s ease;
}
body.dark { font-family: 'Play', 'Hind Madurai', Verdana, Helvetica, sans-serif; }

::selection { background: color-mix(in srgb, var(--link) 18%, transparent); }
body.dark ::selection { background: color-mix(in srgb, var(--acc) 24%, transparent); }

a { color: inherit; text-decoration: none; }

/* running-text links */
.intro-text p a,
.news a {
    color: var(--link);
    transition: color .2s;
}
.intro-text p a:hover,
.news a:hover { color: var(--hover); }
.news a.highlight-link { color: #9500ff; }
.news a.highlight-link:hover { color: #ffcc00; }
.news a.highlight-link2 { color: #ffaa00; }
.news a.highlight-link2:hover { color: #8fd600; }
body.dark .news a.highlight-link { color: #f22a6d; }
body.dark .news a.highlight-link:hover { color: #ff1111; }
body.dark .news a.highlight-link2 { color: #1efb4d; }
body.dark .news a.highlight-link2:hover { color: #fb0cfc; }

/* ================= frame ================= */

.site {
    --pad: clamp(32px, 4vw, 64px);
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 var(--pad) 32px;
}

.theme-toggle-wrapper {
    position: absolute;
    top: 20px;
    right: 22px;
    z-index: 20;
    padding: 0;
    display: block;
}
.theme-toggle { color: var(--ink); width: 26px; padding: 0; }

/* ================= front page: who I am, what is new, a first look at the papers ================= */

.cover {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}
@supports (height: 100svh) {
    .cover { min-height: 100svh; }
}
/* one centred column with room above the name; the space between its parts grows with the screen */
.cover .site {
    max-width: calc(980px + 2 * var(--pad));
    padding-top: var(--top);
    padding-bottom: var(--top);
}

/* the name on its own line; under it the words, with the photo starting level with their first line */
.intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    column-gap: 48px;
    align-items: start;
}

.name {
    grid-column: 1 / -1;
    margin: 0 0 22px;
    font: 700 64px/.95 'Candara', 'Hind Madurai', 'Lato', Verdana, Helvetica, sans-serif;
    letter-spacing: -.02em;
    color: var(--ink);
}
body.dark .name {
    font-family: 'Inlanders', 'BlenderPro', 'Hind Madurai', sans-serif;
    font-size: 72px;
    letter-spacing: .01em;
    color: var(--acc);
}

.intro-text { grid-column: 1; grid-row: 2; }
.intro-text p {
    margin: 0 0 10px;
    font-size: 15.5px;
    line-height: 1.62;
}
/* no word left on a line of its own, where the browser can arrange it */
.intro-text p, .news li { text-wrap: pretty; }
/* a mascot or a mark stays on the line of the word it belongs to; the last two names of a list stay together */
.keep, .last { white-space: nowrap; }
/* a university's name is one link in two pieces, so its last word can hold the mascot; both light up together */
.intro-text .uni:hover a { color: var(--hover); }
.intro-text .logo { width: auto; margin-left: 1px; }

.contact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 18px;
    margin-top: 16px;
    font-family: 'Hind Madurai', 'EB Garamond', 'Lato', sans-serif;
    font-size: 14.5px;
}
.contact-links {
    color: var(--link);
    font-weight: 700;
    font-family: inherit;
    transition: color .2s;
}
.contact-links:hover { color: var(--hover); }
.contact-mail { color: var(--ink-2); }
.contact-mail:first-of-type { margin-left: 10px; }
body.dark .contact { font-family: 'Play', sans-serif; }
body.dark .contact-links { color: var(--link); font-weight: 400; }
body.dark .contact-links:hover { color: #00ff9f; }

.intro-photo { grid-column: 2; grid-row: 2; margin: 7px 0 0; justify-self: end; text-align: center; }
.profile-photo {
    display: block;
    width: 120px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 30%;
    background: var(--rule);
}
body.dark .profile-photo { box-shadow: 0 0 0 1px #05d9e8; }
.intro-photo figcaption {
    margin-top: 6px;
    font: 400 12px/1 'Candara', 'Hind Madurai', sans-serif;
    color: var(--ink-3);
}
body.dark .intro-photo figcaption { font-family: 'Play', sans-serif; }

.news-block,
.picks { margin-top: var(--gap); }

/* ================= sections ================= */

.block { margin-bottom: 34px; }

.section-title {
    margin: 0 0 10px;
    font: 400 22px/1.2 'Lato', 'Hind Madurai', Verdana, Helvetica, sans-serif;
    color: var(--ink);
}
body.dark .section-title {
    font: 700 23px/1.2 'Play', 'Hind Madurai', sans-serif;
    color: var(--acc);
}

.news {
    margin: 0;
    padding: 0 0 0 20px;
    line-height: 1.5;
}
.news li { padding-left: 2px; margin-bottom: 4px; }
.news-cols { columns: 2; column-gap: 56px; }
.news-cols li { break-inside: avoid; }

/* ================= Scientist World: a section of its own ================= */

/* the section exists only with the script. The page darkens into it and lightens out of it over a band
   above and below; inside, the stage holds still while the planet assembles, once */
.feature { display: none; }
.deck { overflow-anchor: none; }
.deck .feature {
    --dusk: clamp(220px, 46vh, 520px);
    display: block;
    position: relative;
    height: var(--track, var(--ph));
    margin: var(--dusk) 0;
    background: #000;
    color: #fff;
}
.deck .feature::before,
.deck .feature::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: calc(var(--dusk) + 1px);
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.002) 6.25%,
        rgba(0, 0, 0, 0.016) 12.50%,
        rgba(0, 0, 0, 0.049) 18.75%,
        rgba(0, 0, 0, 0.104) 25%,
        rgba(0, 0, 0, 0.180) 31.25%,
        rgba(0, 0, 0, 0.275) 37.50%,
        rgba(0, 0, 0, 0.384) 43.75%,
        rgba(0, 0, 0, 0.500) 50%,
        rgba(0, 0, 0, 0.616) 56.25%,
        rgba(0, 0, 0, 0.725) 62.50%,
        rgba(0, 0, 0, 0.820) 68.75%,
        rgba(0, 0, 0, 0.896) 75%,
        rgba(0, 0, 0, 0.951) 81.25%,
        rgba(0, 0, 0, 0.984) 87.50%,
        rgba(0, 0, 0, 0.998) 93.75%,
        rgba(0, 0, 0, 1) 100%);
}
.deck .feature::before { bottom: calc(100% - 1px); }
.deck .feature::after { top: calc(100% - 1px); transform: scaleY(-1); }
.feature-pin {
    position: sticky;
    top: 0;
    height: var(--ph);
    overflow: hidden;
}
.feature-inner { position: absolute; inset: 0; will-change: opacity; }
.feature-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

.feature-copy {
    position: absolute;
    left: calc(max(0px, (100% - 1520px) / 2) + clamp(32px, 4vw, 64px));
    top: 50%;
    width: min(380px, 33%);
    transform: translateY(-50%);
}
.feature-title {
    display: block;
    font: 700 clamp(40px, 4.4vw, 60px)/1.02 'Candara', 'Hind Madurai', 'Lato', sans-serif;
    letter-spacing: -.015em;
    color: #fff;
    transition: color .2s;
}
.feature-title:hover { color: #d7c6ff; }
.feature-sub {
    margin: 12px 0 0;
    font: 400 clamp(17px, 1.5vw, 20px)/1.4 'Lato', 'Hind Madurai', sans-serif;
    color: rgba(255, 255, 255, .7);
}
.feature-authors {
    margin: 24px 0 0;
    font: 400 17px/1.4 'EB Garamond', 'Hind Madurai', serif;
}
.feature .author { color: #8c8c8c; }
.feature a.author:hover { color: #fff; }
.feature .author_myself { color: #fff; font-weight: 700; }
.feature-links { margin: 8px 0 0; font: 400 15px/1.4 'Candara', 'Hind Madurai', 'Lato', sans-serif; }
.feature .paper_links { color: #6db3ff; transition: color .2s; }
.feature .paper_links:hover { color: #f09228; }
.feature .sep { margin: 0 7px; color: #4a4a4a; }

.feature-line {
    position: absolute;
    left: var(--lx, 66%);
    top: var(--ly, 84%);
    margin: 0;
    transform: translateX(-50%);
    font: 400 16px/1 'Hind Madurai', 'Lato', sans-serif;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
}
.feature-line .rest { opacity: 0; }

body.dark .feature-title { font-family: 'BlenderPro', 'Hind Madurai', sans-serif; font-size: clamp(44px, 4.8vw, 66px); }
body.dark .feature-sub,
body.dark .feature-authors,
body.dark .feature-links,
body.dark .feature-line { font-family: 'Play', 'Hind Madurai', sans-serif; }
body.dark .feature-authors { font-size: 15px; }
body.dark .feature .paper_links { color: #00b8ff; }
body.dark .feature .paper_links:hover { color: #00ff9f; }

/* ================= the papers, back on the page ================= */

.sheet { position: relative; padding-top: 4px; }

/* Once the section has been scrolled past it is gone for the visit, and the list takes the place of the
   small row: at the top of the page its first row is that small row, and it grows into the full list as
   the page scrolls down (the script moves --grow and the widths with the scroll). */
.deck-done .feature { display: none; }
.deck-done .picks { display: none; }
.deck-done .sheet { padding-top: 0; }
@media (min-width: 1101px) {
    .deck-done .picks { display: block; visibility: hidden; }
    .deck-done .sheet { margin-top: calc(-1 * var(--pull, 0px)); }
    .sheet.small .paper:nth-child(-n+3) .plinks { display: none; }
    .sheet.small .paper:nth-child(-n+3) .tldr-btn { visibility: hidden; }
    .sheet.small .paper:nth-child(-n+3) .tldr { display: none; }
    .deck-done .sheet .paper:nth-child(-n+3) .plinks { opacity: var(--links, 1); }
}

/* ================= publications ================= */

.pubs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(44px, 4vw, 60px) clamp(32px, 3vw, 44px);
    margin: 14px 0 48px;
}

.paper { min-width: 0; }
.paper[id], .section-title[id] { scroll-margin-top: 28px; }

/* the first row, small, on the front page. --grow runs from 0 (that small row) to 1 (the full list) */
.pubs.pubs-mini {
    --grow: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 64px;
    margin-bottom: 0;
}

.teaser {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--card);
    box-shadow: 0 0 0 1px var(--rule);
    transition: box-shadow .3s ease;
}
.paper:hover .teaser { box-shadow: 0 0 0 1px var(--rule-2); }
/* a scene shows once the script has sized it to its frame */
.teaser .sc:not([style*="--s"]) { visibility: hidden; }

/* the teaser frame holds the scene, the paper's TL;DR over it, and the button that switches between them */
.frame { position: relative; }

.tldr {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--card);
    box-shadow: 0 0 0 1px var(--rule-2);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.tldr p {
    margin: 0;
    font: 400 14px/1.55 'Lato', 'Hind Madurai', Verdana, sans-serif;
    color: var(--ink);
}
.tldr .w {
    display: inline-block;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity .35s ease, transform .35s ease;
}
.paper.tldr-on .tldr { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.paper.tldr-on .tldr .w {
    opacity: 1;
    transform: none;
    transition-delay: calc(var(--i, 0) * 11ms);
}
body.dark .tldr p { font: 400 13.5px/1.55 'Play', 'Hind Madurai', sans-serif; color: #dce5e9; }

.tldr-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    margin: 0;
    padding: 5px 7px 4px;
    border: 1px solid var(--rule-2);
    background: rgba(255, 255, 255, .9);
    color: var(--ink);
    font: 700 10.5px/1 'Lato', 'Hind Madurai', Verdana, sans-serif;
    letter-spacing: .06em;
    cursor: pointer;
    opacity: 0;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.paper:hover .tldr-btn,
.paper.tldr-on .tldr-btn,
.tldr-btn:focus-visible { opacity: 1; }
.tldr-btn:hover { border-color: var(--ink); }
.tldr-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.paper.tldr-on .tldr-btn { background: var(--ink); border-color: var(--ink); color: var(--bg); }
body.dark .tldr-btn { background: rgba(5, 10, 14, .85); border-color: #1e3542; color: var(--link); font-family: 'Play', sans-serif; }
body.dark .tldr-btn:hover { border-color: var(--link); }
body.dark .paper.tldr-on .tldr-btn { background: var(--link); border-color: var(--link); color: #050a0e; }
@media (hover: none) {
    .tldr-btn { opacity: 1; }
}

/* scrubbing a finished teaser: a hairline shows where in its story the pointer is */
.teaser.scrubbable { touch-action: pan-y pinch-zoom; }
.scrub-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--link);
    transform-origin: 0 50%;
    transform: scaleX(var(--f, 1));
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}
.teaser.scrubbing .scrub-bar { opacity: 1; transition-duration: .15s; }

@media (prefers-reduced-motion: reduce) {
    .tldr, .tldr .w, .paper.tldr-on .tldr, .paper.tldr-on .tldr .w { transition: none; }
}

.paper-body { padding-top: 10px; }

.papertitle {
    display: block;
    font: 700 16px/1.3 'Candara', 'Hind Madurai', 'Lato', Verdana, Helvetica, sans-serif;
    color: var(--ink);
    transition: color .2s;
}
.papertitle:hover { color: #007acc; }
.papertitle { font-size: calc(14.5px + 1.5px * var(--grow, 1)); }
body.dark .papertitle { font-family: 'BlenderPro', 'Hind Madurai', sans-serif; font-size: calc(16px + 2px * var(--grow, 1)); color: #fff; }
body.dark .papertitle-highlight { color: #ff9900; }
body.dark .papertitle:hover { color: #ff3d00; }

.authors {
    margin: 4px 0 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font: 400 14.5px/1.4 'EB Garamond', 'Hind Madurai', 'Lato', serif;
    color: var(--ink-2);
}
.author { color: var(--ink-2); transition: color .2s; }
a.author:hover { color: #000; }
.author_myself { color: var(--ink); font-weight: 700; }
.authors { font-size: calc(13.5px + 1px * var(--grow, 1)); }
body.dark .authors { font-family: 'Play', sans-serif; font-size: calc(13px + 1px * var(--grow, 1)); color: #929292; }
body.dark .author { color: #929292; }
body.dark a.author:hover { color: #fff; }
body.dark .author_myself { color: #fff; }

.meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 5px 0 0;
    white-space: nowrap;
}
.conference {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font: italic 400 15px/1.4 'EB Garamond', 'Hind Madurai', serif;
    color: var(--ink);
}
.conference { font-size: calc(14px + 1px * var(--grow, 1)); }
body.dark .conference { font: 400 14px/1.4 'Play', sans-serif; font-size: calc(13px + 1px * var(--grow, 1)); color: #47f3ff; }

.plinks {
    flex: none;
    display: inline-flex;
    align-items: baseline;
    font: 400 13.5px/1.4 'Candara', 'Hind Madurai', 'Lato', sans-serif;
}
.plinks .sep { margin: 0 5px; color: var(--ink-3); }
.paper_links {
    color: var(--link);
    transition: color .2s;
}
.paper_links:hover { color: var(--hover); }
body.dark .plinks { font-family: 'Play', sans-serif; font-size: 13px; }
body.dark .paper_links { color: #00b8ff; }
body.dark .paper_links:hover { color: #00ff9f; }

/* ================= footer ================= */

.foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
}
.globe { width: 180px; height: 180px; }
.footer-text {
    margin: 0;
    font: 400 14px/1 'EB Garamond', 'Hind Madurai', serif;
    color: #555;
}
body.dark .footer-text { font-family: 'Play', sans-serif; color: #a2a2a2; }

/* ================= smaller screens ================= */

@media (min-width: 1400px) {
    .tldr { padding: 18px 24px; }
    .tldr p { font-size: 15px; }
    body.dark .tldr p { font-size: 14.5px; }
}

@media (max-width: 1100px) {
    .pubs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .site { --pad: 32px; }
    .intro { grid-template-columns: minmax(0, 1fr) 108px; column-gap: 36px; }
    .profile-photo { width: 108px; }
    .pubs.pubs-mini { column-gap: 30px; }
    .name { font-size: 54px; }
    body.dark .name { font-size: 62px; }
    .pubs { gap: 44px 30px; }
    .feature-copy { left: 32px; }
}

@media (max-width: 720px) {
    :root { --gap: 36px; --top: 52px; }
    body { font-size: 14.5px; }
    .site { --pad: 18px; padding-bottom: 28px; }
    .picks { display: none; }
    .theme-toggle-wrapper { top: 14px; right: 14px; }
    /* the name first; the photo beside the first lines, which then run on under it */
    .intro { display: flow-root; }
    .intro-photo { float: right; margin: 5px 0 6px 16px; }
    .profile-photo { width: 84px; }
    .intro-photo figcaption { margin-top: 5px; font-size: 11px; }
    .name { font-size: 42px; margin-bottom: 14px; }
    body.dark .name { font-size: 46px; }
    .intro-text p { font-size: 14.5px; }
    .contact-mail:first-of-type { margin-left: 0; }
    .section-title { font-size: 20px; }
    .news-cols { columns: 1; }

    .feature-copy { left: 18px; right: 18px; top: 52px; width: auto; transform: none; }
    .feature-title { font-size: 40px; }
    body.dark .feature-title { font-size: 44px; }
    .feature-sub { margin-top: 8px; font-size: 16px; }
    .feature-authors { margin-top: 14px; font-size: 15.5px; }
    .feature-links { font-size: 14px; }
    .feature-line { font-size: 14px; }

    .pubs { grid-template-columns: 1fr; gap: 40px; }
    .block { margin-bottom: 30px; }
    .papertitle { font-size: 16.5px; }
}

@media (max-width: 360px) {
    .meta { gap: 8px; }
    .conference { font-size: 14px; }
    body.dark .conference { font-size: 13px; }
    .plinks, body.dark .plinks { font-size: 12px; }
    .plinks .sep { margin: 0 3.5px; }
    .tldr { padding: 12px 14px; }
    .tldr p { font-size: 13px; line-height: 1.5; }
    body.dark .tldr p { font-size: 12.5px; line-height: 1.5; }
}
