/* Palette "slate": grey-blue accent, orange only for the highlight badge */
:root{
  --ink:#1b2430; --body:#4b5360; --soft:#7b8494; --line:#e6e8ec; --panel:#f5f6f8;
  --acc:#3b5b7a; --acc-soft:#e8eef4; --pop:#f08a24; --pop-ink:#c8650a; --pop-soft:#fdf0e0; --popInk:#fff;
  --sans:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
}
*{box-sizing:border-box;margin:0}
html{font-size:16px;-webkit-text-size-adjust:100%}
body{background:#fff;color:var(--ink);font-family:var(--sans);font-size:.86rem;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
h6{font-size:.68rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--soft);margin-bottom:.6rem;display:flex;justify-content:space-between}
h6 span{letter-spacing:0;text-transform:none;font-weight:400}
.clamp2,.clamp3{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}
.clamp2{-webkit-line-clamp:2}.clamp3{-webkit-line-clamp:3}

/* ---------- left: about ---------- */
aside{padding:2.6rem 2.2rem 2.2rem;display:flex;flex-direction:column;gap:1.5rem}
.photo{width:5.6rem;height:5.6rem;border-radius:50%;background:var(--acc-soft);color:var(--acc);display:flex;align-items:center;justify-content:center;font-size:1.5rem;font-weight:700;letter-spacing:-.03em;object-fit:cover}
h1{font-size:2.3rem;font-weight:700;letter-spacing:-.035em;line-height:1.05;margin-top:1.1rem}
.rolel{color:var(--acc);font-weight:600;margin-top:.35rem}
aside p{color:var(--body);margin-top:.7rem;line-height:1.55}
.prof{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.prof a{display:flex;align-items:center;gap:.55rem;border:1px solid var(--line);border-radius:.8rem;padding:.6rem .7rem;font-weight:600;font-size:.8rem;line-height:1.2}
.prof a:hover{border-color:var(--acc);background:var(--panel)}
.prof svg{width:1.5rem;height:1.5rem;flex:none}
.prof em{margin-left:auto;font-style:normal;color:var(--pop-ink)}
.it{display:grid;grid-template-columns:4rem 1fr;gap:.8rem;align-items:center;margin-bottom:.7rem}
.it i{width:4rem;height:2.8rem;border-radius:.6rem;background:#fff;border:1px solid var(--line);display:flex;align-items:center;justify-content:center;padding:.45rem .5rem}
.it i img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.it b{font-weight:600;display:block;line-height:1.25}.it span{font-size:.78rem;color:var(--soft)}
.foot{margin-top:auto;display:flex;flex-direction:column;gap:.8rem}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.stats div{background:var(--panel);border-radius:.8rem;padding:.7rem .9rem}
.stats b{font-size:1.5rem;font-weight:700;display:block;line-height:1.1;letter-spacing:-.02em}.stats span{font-size:.72rem;color:var(--soft)}
.ls{display:flex;flex-wrap:wrap;gap:.4rem}
.ls a{display:flex;align-items:center;gap:.4rem;border:1px solid var(--line);border-radius:2rem;padding:.3rem .8rem;font-weight:500;font-size:.78rem}
.ls a:hover{border-color:var(--acc);color:var(--acc)}
.ls svg{width:1rem;height:1rem}

/* left pane, refined: soft tinted backdrop, unboxed logos, one numbers block */
aside{background:linear-gradient(175deg,#e9eff5 0%,#f4f6f9 38%,#fff 78%)}
.photo{width:6rem;height:6rem;background:#fff;border:.2rem solid #fff;box-shadow:0 0 0 .14rem var(--pop),0 .6rem 1.4rem -.5rem rgba(27,36,48,.35)}
.rolel{color:var(--acc);font-weight:600;font-size:.95rem;margin-top:.4rem}
.prof a{background:#fff;border-color:transparent;box-shadow:0 1px 2px rgba(27,36,48,.08),0 .4rem 1rem -.6rem rgba(27,36,48,.25)}
.prof a:hover{background:#fff;border-color:var(--acc);transform:translateY(-1px)}
.it{grid-template-columns:3.6rem 1fr;gap:.9rem;margin-bottom:0;padding:.6rem 0}
.it+.it{border-top:1px solid rgba(27,36,48,.08)}
.it i{width:3.6rem;height:2.4rem;border:0;background:none;padding:0;border-radius:0;justify-content:flex-start}
.it i img{mix-blend-mode:multiply}
h6{margin-bottom:.25rem}
.stats{gap:0;background:#fff;border:1px solid var(--line);border-radius:1rem;overflow:hidden}
.stats div{background:none;border-radius:0;padding:.75rem 1rem}
.stats div:nth-child(odd){border-right:1px solid var(--line)}
.stats div:nth-child(-n+2){border-bottom:1px solid var(--line)}
.stats b{font-size:1.6rem}
.stats div:first-child b{color:var(--pop-ink)}

/* links: same rows as "Currently" below (logo column, name, account name) */
.prof{display:block}
.prof a.it,.prof a.it:hover{display:grid;gap:.9rem;background:none;border:0;border-radius:0;box-shadow:none;padding:.6rem 0;transform:none;font-size:inherit;font-weight:400;line-height:inherit}
.prof a.it+a.it{border-top:1px solid rgba(27,36,48,.08)}
.prof svg{height:1.9rem;width:1.9rem;display:block}
.prof .it i{color:var(--acc)}
.prof .it span{color:var(--acc);font-weight:500}
.prof a.it:hover span{text-decoration:underline;text-decoration-color:var(--pop);text-underline-offset:.18rem}
aside h6 span{font-family:var(--mono);font-size:.7rem;color:var(--pop-ink);font-weight:500}

/* left pane is tight with four link rows: slightly smaller photo and gaps */
aside{gap:1.1rem;padding-top:2.1rem;padding-bottom:1.8rem}
.photo{width:5rem;height:5rem;font-size:1.3rem}
h1{margin-top:.9rem}
.it{padding:.45rem 0}
.it i{height:2.1rem}
.prof svg{height:1.7rem;width:1.7rem}
.stats div{padding:.6rem 1rem}

aside p b{font-weight:600;color:var(--acc)}

/* ---------- centre: projects ---------- */
main{padding:2.4rem 2.4rem 2rem;display:flex;flex-direction:column;gap:1.1rem;position:relative;min-width:0}
.hd{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}
h2{font-size:1.25rem;font-weight:700;letter-spacing:-.02em}
.chips{display:flex;flex-wrap:wrap;gap:.2rem}
.chips button{font-size:.76rem;font-weight:500;padding:.3rem .8rem;border-radius:2rem;color:var(--body)}
.chips button:hover{background:var(--panel)}
.chips button[aria-selected=true]{background:var(--ink);color:#fff;box-shadow:inset 0 -2px 0 var(--pop)}
.stage{display:flex;flex-direction:column;gap:1.1rem;min-height:0}
.pic{overflow:hidden;background:#fff;min-height:0;min-width:0}
.pic img{width:100%;height:100%;object-fit:cover;display:block}
.pic.contain{background:#fff}.pic.contain img{object-fit:contain;padding:.5rem}
.card .pic.contain img{transform:scale(var(--zoom,1))}
.hero .pic.clear{background:none}.hero .pic.contain img{padding:1.3rem 0 1.3rem 1.6rem}
.sheet .pic.contain img{padding:1rem}
.pic.ph{background:var(--panel);color:var(--soft);display:flex;align-items:center;justify-content:center;font-size:.75rem}
.hero,.card{cursor:pointer;transition:box-shadow .15s,border-color .15s,transform .15s}
.hero:hover,.card:hover{box-shadow:0 .5rem 1.4rem -.6rem rgba(27,36,48,.28)}
.card:hover{border-color:#cfd5dd}
.hero{display:grid;grid-template-columns:1fr 1fr;border-radius:1.3rem;overflow:hidden;background:var(--acc-soft);min-height:0}
.hero .tx{padding:2rem 2.2rem;display:flex;flex-direction:column;min-height:0}
.badge{align-self:flex-start;font-size:.68rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;background:var(--pop);color:var(--popInk);padding:.25rem .7rem;border-radius:2rem}
.hero h3{font-size:2.5rem;font-weight:700;letter-spacing:-.04em;line-height:1;margin-top:.9rem}
.sub{font-weight:600;color:var(--acc);margin-top:.3rem}
.hero p{color:var(--body);font-size:.95rem;line-height:1.55;margin-top:.8rem}
.hero .role{font-size:.82rem;margin-top:.5rem}
.lk{margin-top:auto;padding-top:.8rem;display:flex;gap:.4rem;flex-wrap:wrap}
.lnk{font-size:.76rem;font-weight:600;padding:.32rem .8rem;border-radius:2rem;background:#fff;border:1px solid var(--line)}
.lnk:hover{border-color:var(--acc)}
.lnk:first-child{background:var(--acc);border-color:var(--acc);color:#fff}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:1.1rem;min-height:0}
.card{display:grid;grid-template-columns:42% 1fr;border:1px solid var(--line);border-radius:1.1rem;overflow:hidden;min-height:0;background:#fff}
.card.noimg{grid-template-columns:1fr}
.card .tx{padding:1.1rem 1.3rem;display:flex;flex-direction:column;min-height:0;min-width:0}
.card h3{font-size:1.2rem;font-weight:700;letter-spacing:-.025em;line-height:1.15}
.card .sub{font-size:.8rem;margin-top:.15rem}
.card p{color:var(--body);margin-top:.45rem;line-height:1.45;font-size:.82rem}
.card .lk{padding-top:.5rem}.card .lnk{font-size:.7rem;padding:.22rem .65rem}
.card .lnk:first-child{background:var(--acc-soft);border-color:var(--acc-soft);color:var(--acc)}
.kind{font-size:.66rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--soft);margin-bottom:.3rem;display:flex;align-items:center;gap:.4rem}
.kind::before{content:"";width:.5rem;height:.5rem;border-radius:50%;background:var(--pop)}
.more{display:flex;justify-content:center;align-items:center;gap:.6rem;border:1px dashed #cfd3da;border-radius:2rem;padding:.55rem;font-weight:600;font-size:.8rem;color:var(--body);width:100%}
.more:hover{border-color:var(--acc);color:var(--acc)}
.more i{font-style:normal;font-weight:400;color:var(--soft)}
.more b{background:var(--pop-soft);color:var(--pop-ink);border-radius:2rem;padding:.05rem .55rem;font-size:.72rem}

/* small cards: button that moves the project into the highlight spot */
.card .tx{position:relative}
.xp{position:absolute;top:.7rem;right:.8rem;width:1.7rem;height:1.7rem;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--acc);display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s,border-color .15s}
.xp svg{width:.9rem;height:.9rem}
.xp:hover,.card:hover .xp{background:var(--pop);border-color:var(--pop);color:#fff}
.card .kind{padding-right:2.2rem}
.stage.compact .card .xp{top:.55rem;right:.55rem;width:1.5rem;height:1.5rem}.stage.compact .card .xp svg{width:.75rem;height:.75rem}
/* highlight spot */
.hero{cursor:default}.hero:hover{box-shadow:none}.hero:focus{outline:none}
/* screenshots (no transparent background) sit on the tinted card as a framed picture */
.hero .pic:not(.clear):not(.ph){background:none;padding:1.5rem 0 1.5rem 1.8rem}
.hero .pic:not(.clear):not(.ph) img{object-fit:contain;object-position:center!important;filter:drop-shadow(0 .5rem 1.1rem rgba(27,36,48,.22))}
.hero .tags{margin-top:auto}
.hero .lk{margin-top:.6rem;padding-top:0}
.hero.in{animation:swap .28s ease-out}
@keyframes swap{from{opacity:.25;transform:translateY(.5rem)}to{opacity:1;transform:none}}

/* compact highlight (all-projects view): short text, never clipped */
.stage.compact .hero p.long{display:block;overflow:visible;-webkit-line-clamp:unset;flex:none}
.stage.compact .hero h3{font-size:1.8rem}

/* keywords on the cards (like GitHub topics) */
.tags{margin-top:auto;padding-top:.6rem;display:flex;gap:.35rem;flex-wrap:wrap}
.tags span{font-size:.7rem;font-weight:600;color:var(--acc);background:var(--acc-soft);border-radius:2rem;padding:.2rem .65rem;white-space:nowrap}
.hero .tags span{background:#fff;font-size:.76rem;padding:.3rem .8rem}
.sheet .tags{margin-top:.9rem;padding:0}
.stage.compact .card .tags{display:none}

/* compact view: every filter except "Featured" */
.stage.compact .hero .role{display:none}
.stage.compact .hero h3{font-size:2rem}
.stage.compact .grid{grid-template-columns:repeat(3,1fr);gap:.8rem}
.stage.compact .card{grid-template-columns:36% 1fr}
.stage.compact .card.noimg{grid-template-columns:1fr}
.stage.compact .card .lk{display:none}
.stage.compact .card h3{font-size:1rem}
.stage.compact .card .tx{padding:.8rem .9rem;justify-content:center}
.stage.compact .card p{-webkit-line-clamp:3;font-size:.78rem;margin-top:.3rem}
.stage.compact .card .sub{white-space:normal}

/* ---------- opened project ---------- */
.ov{position:fixed;inset:0;background:rgba(27,36,48,.42);padding:1rem;z-index:20;display:flex}
.ov[hidden]{display:none}
.sheet{flex:1;background:#fff;border-radius:1.5rem;overflow:auto;display:flex;flex-direction:column;box-shadow:0 2rem 4rem -1rem rgba(0,0,0,.35);position:relative;max-width:70rem;margin:auto;max-height:100%}
.sheet .pic{flex:0 0 auto;height:16rem;background:var(--panel)}
.sheet .tx{padding:1.6rem 1.6rem 1rem;display:grid;gap:1.4rem}
.sheet h3{font-size:2rem;font-weight:700;letter-spacing:-.035em;line-height:1.05}
.sheet p{color:var(--body);font-size:.95rem;line-height:1.6;margin-bottom:.7rem}
.sheet .lk{margin-top:1rem;padding:0}
.x{position:absolute;top:1rem;right:1rem;width:2.3rem;height:2.3rem;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;font-size:1.2rem;box-shadow:0 1px 5px rgba(0,0,0,.25);z-index:2}
.nv{display:flex;justify-content:space-between;gap:1rem;padding:.9rem 1.6rem 1.3rem;font-size:.78rem;font-weight:600;color:var(--soft);margin-top:auto}
.nv button:hover{color:var(--acc)}

/* ---------- right: papers and repositories ---------- */
.r{padding:2.4rem 2.1rem 2rem;display:flex;flex-direction:column;gap:1.6rem;min-width:0}
.pub{display:block;padding:.55rem 0;border-top:1px solid var(--line);line-height:1.38}
a.pub:hover .t{color:var(--acc)}
.pub .t{font-weight:500}
.pub small{display:flex;justify-content:space-between;gap:.5rem;align-items:center;color:var(--soft);font-size:.74rem;margin-top:.2rem}
.pub small b{color:var(--ink);font-weight:600}
.ven{white-space:nowrap;font-weight:600;color:var(--acc);background:var(--acc-soft);border-radius:.4rem;padding:.08rem .45rem;font-size:.68rem}
.all{display:flex;justify-content:space-between;gap:1rem;font-weight:600;font-size:.78rem;color:var(--acc);padding-top:.6rem;border-top:1px solid var(--line)}

.tog{background:var(--pop-soft);color:var(--pop-ink);border-radius:2rem;padding:.2rem .7rem;margin:-.2rem 0}
.tog:hover{background:var(--pop);color:#fff}
.all button:hover,.all a:hover{text-decoration:underline;text-underline-offset:.2rem}
/* repositories: same rows as the publications (line on top, title, small line below), stars on the right */
.repo{display:grid;grid-template-columns:1fr auto;gap:.2rem .8rem;padding:.55rem 0;border-top:1px solid var(--line);line-height:1.38;align-items:baseline}
.repo b{font-weight:500}
a.repo:hover b{color:var(--acc)}
.repo .st{font:500 .74rem var(--mono);color:var(--pop-ink);white-space:nowrap}
.repo span:not(.st){grid-column:1/3;font-size:.74rem;color:var(--soft)}
.cit{font-style:normal;font-weight:600;color:var(--pop-ink);white-space:nowrap}
.r h6{font-size:1.05rem;font-weight:700;letter-spacing:-.015em;text-transform:none;color:var(--ink);align-items:baseline;margin-bottom:.55rem}
.r h6 span{font-size:.7rem;color:var(--soft)}

/* ---------- small windows and mobile: one scrolling column ---------- */
aside,.r{border-bottom:1px solid var(--line)}
.r{border-bottom:0;border-top:1px solid var(--line)}
.hero{grid-template-columns:1fr}
.hero .pic{aspect-ratio:3/2}
.grid,.stage.compact .grid{grid-template-columns:1fr}
.card .pic{min-height:9rem}
@media (max-width:560px){
  aside,main,.r{padding-left:1.2rem;padding-right:1.2rem}
  .card,.stage.compact .card{grid-template-columns:1fr}
  .card .pic{aspect-ratio:16/9}
  .hero h3{font-size:2rem}.hero .tx{padding:1.4rem}
}
@media (min-width:700px){
  .hero{grid-template-columns:1fr 1fr}.hero .pic{aspect-ratio:auto}
  .grid{grid-template-columns:1fr 1fr}
  .stage.compact .grid{grid-template-columns:repeat(2,1fr)}
  .sheet .pic{height:22rem}
  .sheet .tx{grid-template-columns:1fr 1.3fr;gap:2.5rem;padding:1.8rem 2.2rem 1rem}
  .nv{padding:.9rem 2.2rem 1.3rem}
}
/* medium: about on the left, the rest scrolls */
@media (min-width:1000px){
  body{display:grid;grid-template-columns:20rem minmax(0,1fr)}
  aside{grid-row:1/3;border-bottom:0;border-right:1px solid var(--line);position:sticky;top:0;height:100vh;align-self:start}
}

/* ---------- desktop: everything on one screen, nothing scrolls ---------- */
@media (min-width:1280px) and (min-height:760px){
  /* 1rem = 16px on a 1920x1080 screen; shrinks with the window */
  html{font-size:clamp(11.5px,min(1.4815vh,.8333vw),22px)}
  body{height:100vh;overflow:hidden;grid-template-columns:22rem minmax(0,1fr) 27rem}
  aside{grid-row:auto;position:static;height:auto;align-self:stretch}
  main{min-height:0}
  .stage{flex:1}
  .hero{flex:1.8}
  .card .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .hero .tx{padding:1.5rem 2rem 1.4rem}.hero h3{font-size:2.2rem;margin-top:.6rem}
  .hero p.long{font-size:.88rem;line-height:1.5;margin-top:.6rem;overflow:hidden}
  .hero .tags{padding-top:.5rem}.hero .tags span{font-size:.72rem;padding:.22rem .65rem}
  .grid{flex:2;grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
  .pic{height:100%}.card .pic{min-height:0}
  /* all projects: same sizes as the start view, the centre scrolls */
  .stage.all{display:block;overflow-y:auto;scrollbar-width:none}          /* same widths as the start view; the next row peeks in as the scroll hint */
  .stage.all::-webkit-scrollbar{display:none}
  .card p,.card h3,.card .sub,.card .kind{flex:none}
  .stage.all .hero{height:var(--heroh)}
  .stage.all .grid{margin-top:1.1rem;grid-template-rows:none;grid-auto-rows:var(--rowh)}
  .r{border-top:0;border-left:1px solid var(--line);min-height:0;overflow-y:auto}
  .ov{position:absolute;padding:3rem}
  .sheet{max-width:none;margin:0;display:grid;grid-template-rows:minmax(0,1.2fr) auto auto}
  .sheet .pic{height:auto}
}
@media (min-width:1280px) and (min-height:760px) and (max-aspect-ratio:17/10){.card p{-webkit-line-clamp:2}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
