:root { color-scheme: dark; }
html { overscroll-behavior: none; }
* { margin: 0; box-sizing: border-box; }
body {
  background: #050505;
  color: #e8e8e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 100vh; min-height: 100svh;
}

#sitehead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: baseline; gap: 24px;
  padding: 18px 28px;
  font-size: 12px; letter-spacing: 0.1em;
  background: linear-gradient(to bottom, rgba(5,5,5,0.9), rgba(5,5,5,0.5) 60%, rgba(5,5,5,0));
}
#sitehead .brand { color: #e8e8e8; text-decoration: none; }
#sitehead .mode {
  display: inline-flex; align-items: baseline; gap: 6px;
  color: #7a7a7a; text-decoration: none;
  padding-left: 16px; border-left: 1px solid #2a2a2a;
  transition: color 0.2s;
}
#sitehead .mode:hover { color: #fff; }
#sitehead .mode svg { display: block; transform: translateY(2px); }
#sitehead nav { display: flex; gap: 22px; margin-left: auto; }
#sitehead nav a { color: #9a9a9a; text-decoration: none; transition: color 0.2s; }
#sitehead nav a:hover, #sitehead nav a.active { color: #fff; }

main { max-width: 760px; margin: 0 auto; padding: 60px 28px 100px; }
main.page h1 {
  font-size: 1.9rem; font-weight: 500; letter-spacing: 0.06em; margin-bottom: 1.2rem;
}
main.page h2 {
  font-size: 11px; font-weight: 500; color: #6a6a6a;
  letter-spacing: 0.22em; text-transform: uppercase;
  margin: 2.6rem 0 0.9rem;
}
main.page p { color: #9a9a9a; line-height: 1.7; font-size: 13px; margin: 0.5rem 0; }
main.page a { color: #cfcfcf; }

/* cv entries */
.entry { display: grid; grid-template-columns: 110px 1fr; gap: 16px; margin: 14px 0; }
.entry .when { color: #5e5e5e; font-size: 11px; letter-spacing: 0.05em; padding-top: 2px; }
.entry h3 { font-size: 13px; font-weight: 500; color: #e0e0e0; }
.entry p { font-size: 12px; color: #8a8a8a; margin-top: 4px; line-height: 1.65; }

/* publications */
.pub { margin: 18px 0; }
.pub h3 { font-size: 13px; font-weight: 500; color: #e0e0e0; line-height: 1.45; }
.pub h3 a { color: #e0e0e0; text-decoration: none; border-bottom: 1px solid #3a3a3a; }
.pub h3 a:hover { color: #fff; border-bottom-color: #fff; }
.pub .meta { font-size: 11.5px; color: #7a7a7a; margin-top: 4px; line-height: 1.55; }
.pub .meta .me { color: #c9c9c9; }
.pub .meta .venue { color: #8f8f8f; }

/* repos */
.repo { margin: 22px 0; }
.repo h3 { font-size: 14px; font-weight: 500; }
.repo h3 a { color: #e0e0e0; text-decoration: none; }
.repo h3 a:hover { color: #fff; text-decoration: underline; }
.repo .path { color: #5e5e5e; font-size: 11px; letter-spacing: 0.05em; margin-top: 2px; }
.repo p { font-size: 12px; color: #8a8a8a; margin-top: 6px; line-height: 1.65; }

/* desktop: a dimmed still of the motion page's terrain behind a soft-edged
   text column; phones stay plain (the image is never fetched there). The
   column is fixed and spans the viewport whatever the page's length; text
   starts ~100 px inside its edge, 2.7 sigma, so nothing shows through. */
@media (min-width: 721px) {
  body.bg::before {
    content: ''; position: fixed; inset: 0; z-index: -1;
    background: #050505 center / cover no-repeat;
    opacity: 0.4;
  }
  body.bg-index::before { background-image: url(bg/index.webp); }
  body.bg-cv::before { background-image: url(bg/cv.webp); }
  body.bg-publications::before { background-image: url(bg/publications.webp); }
  body.bg-repositories::before { background-image: url(bg/repositories.webp); }
  body.bg::after {                      /* fixed full-height black column behind the text, gaussian edge (sigma 36 px) */
    content: ''; position: fixed; top: -160px; bottom: -160px; left: 50%; width: 900px;
    transform: translateX(-50%); z-index: -1;
    background: #050505; filter: blur(36px);
  }
}

/* home */
body.home main { max-width: 760px; margin: 0 auto; padding: 40px 28px 100px; }
body.home .hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 500; letter-spacing: 0.06em; }
body.home .hero .tag { color: #9a9a9a; margin-top: 0.6rem; font-size: 13px; }
body.home #links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 1.6rem; font-size: 12px; }
body.home #links a { color: #9a9a9a; text-decoration: none; border-bottom: 1px solid #2e2e2e; padding-bottom: 1px; }
body.home #links a:hover { color: #fff; border-bottom-color: #fff; }
body.home .fly { margin-top: 3rem; }
body.home .fly h2 {
  font-size: 11px; font-weight: 500; color: #6a6a6a;
  letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 8px;
}
body.home .fly .item { margin: 12px 0; max-width: 34rem; }
body.home .fly .item h3 { font-size: 14px; font-weight: 500; color: #e0e0e0; line-height: 1.45; }
body.home .fly .item h3 a { color: #e0e0e0; text-decoration: none; border-bottom: 1px solid #3a3a3a; }
body.home .fly .item h3 a:hover { color: #fff; border-bottom-color: #fff; }
body.home .fly .item p { font-size: 12px; color: #8a8a8a; margin-top: 4px; line-height: 1.65; }
body.home .fly .item p .when { color: #6e6e6e; }
body.home .fly .item .me { color: #c9c9c9; }
body.home .fly .more {
  display: inline-block; margin-top: 14px;
  font-size: 11px; letter-spacing: 0.08em; color: #8a8a8a; text-decoration: none;
  border-bottom: 1px solid #333;
}
body.home .fly .more:hover { color: #fff; border-bottom-color: #fff; }

#sitefoot {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto; padding: 0 28px 28px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px;
  color: #4e4e4e; font-size: 10px; letter-spacing: 0.08em; line-height: 1.6;
}
#sitefoot a { color: #7a7a7a; text-decoration: none; transition: color 0.2s; }
#sitefoot a:hover { color: #fff; }

@media (max-width: 720px) {
  #sitehead { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 12px; font-size: 11px; letter-spacing: 0.06em; }
  #sitehead .mode { padding-left: 10px; }
  #sitehead .mode span { display: none; }
  #sitehead nav { gap: 14px; }
  main.page, body.home main { padding-left: 22px; padding-right: 22px; }
  .entry { grid-template-columns: 88px 1fr; gap: 12px; }
  #sitefoot { padding: 0 22px calc(20px + env(safe-area-inset-bottom)); }
}
