/* Layout follows piccardi.me: Inconsolata, orange accent, sidebar (profile + news) + content. */
:root {
  --bg: #ffffff;
  --text: #272727;
  --muted: #777777;
  --accent: #EF7B00;
  --line: rgba(0, 0, 0, 0.1);
  --tag-bg: #f1f1f1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616;
    --text: #e4e4e4;
    --muted: #9a9a9a;
    --accent: #FF9A3D;
    --line: rgba(255, 255, 255, 0.14);
    --tag-bg: #262626;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161616;
  --text: #e4e4e4;
  --muted: #9a9a9a;
  --accent: #FF9A3D;
  --line: rgba(255, 255, 255, 0.14);
  --tag-bg: #262626;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inconsolata", ui-monospace, Menlo, monospace;
  font-size: 17px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.muted { color: var(--muted); }

.container { max-width: 960px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.navbar { padding-top: 44px; padding-bottom: 36px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.navbar .name { font-size: 30px; color: var(--text); }
.navbar nav { display: flex; gap: 18px; }
.navbar nav a { color: var(--text); }
.navbar nav a:hover { color: var(--accent); }

.site { display: grid; grid-template-columns: 270px 1fr; gap: 44px; padding-top: 28px; padding-bottom: 48px; }

/* Sidebar: profile card, then the news box */
.sidebar {
  position: sticky; top: 20px; align-self: start;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; gap: 20px;
}
.photo { width: 100%; max-width: 150px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; display: block; margin: 0 auto; }
.role { margin-top: 14px; }
.email { display: inline-block; margin-top: 10px; word-break: break-all; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; min-width: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font-size: 15px; font-weight: 700;
}
.btn.icon { width: 32px; padding: 0; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.side-news {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column;
  min-height: 140px; flex: 1 1 auto;
}
.side-heading { font-size: 16px; margin: 0 0 6px; }
.news {
  list-style: none; margin: 0; padding: 0 6px 0 0;
  overflow-y: auto; min-height: 0; flex: 1 1 auto;
  font-size: 14px; line-height: 1.45;
  overscroll-behavior: contain;
}
.news li + li { margin-top: 8px; }
.news .date { color: var(--muted); font-weight: 700; display: block; }

/* Content */
.content { min-width: 0; }
.content > p { max-width: 68ch; }
.content h2 { font-size: 24px; margin: 44px 0 6px; }
.content p { margin: 0 0 12px; }
.section-anchor { scroll-margin-top: 24px; }

/* Research themes: a clear heading, then the projects indented under a rule */
.theme { margin-top: 28px; }
.theme-title {
  font-size: 16px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text);
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.theme .items { border-left: 2px solid var(--line); padding-left: 16px; }

.items { list-style: none; padding: 0; margin: 0; }
.items li { margin: 0 0 18px; }
.items .title { font-weight: 700; }
.items .desc { display: block; }
.items .meta { display: block; color: var(--muted); font-size: 15px; }
.tag {
  display: inline-block; font-size: 13px; line-height: 1;
  padding: 3px 7px; margin-left: 6px; border-radius: 4px;
  background: var(--tag-bg); color: var(--muted); font-weight: 400;
  vertical-align: 1px; white-space: nowrap;
}
.tag.pub { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
u.me { text-decoration-color: var(--muted); }

footer { color: var(--muted); font-size: 12px; padding-top: 0; padding-bottom: 32px; }
footer a { color: var(--muted); text-decoration: underline; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .navbar { padding-top: 28px; padding-bottom: 20px; }
  .navbar .name { font-size: 26px; }
  .site { grid-template-columns: 1fr; gap: 28px; padding-top: 22px; }
  .sidebar { position: static; max-height: none; }
  .profile { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start; }
  .photo { max-width: 110px; margin: 0; }
  .role { margin-top: 0; }
  .side-news { max-height: 300px; }
}

.cta { border-left: 3px solid var(--accent); padding-left: 12px; }
