/* Orizon P. Ferreira, academic page. Plain CSS, no external dependencies. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1b2228;
  --muted: #5a6670;
  --rule: #e2dfd6;
  --accent: #0d5868;
  --accent-ink: #ffffff;
  --accent-soft: #e2eef0;
  --code: #7a4b0e;
  --code-soft: #f7ecdc;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151a;
    --surface: #172027;
    --ink: #e4e9ec;
    --muted: #98a5ae;
    --rule: #25313a;
    --accent: #6bbfcf;
    --accent-ink: #0c1a1f;
    --accent-soft: #16323a;
    --code: #e2b673;
    --code-soft: #33281a;
  }
}
* { box-sizing: border-box; }
/* Always reserve the scrollbar's space: switching between short and long tabs must not shift the page sideways */
html { scroll-behavior: smooth; overflow-y: scroll; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga";
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: name, title and tabs, fixed at the top of the window */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--rule);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.masthead .wrap { padding-top: 18px; padding-bottom: 0; }
.masthead h1 { font: 600 2.1rem/1.1 var(--serif); margin: 0; letter-spacing: -0.015em; }
.masthead .role { margin: 4px 0 0; color: var(--muted); font-size: 0.98rem; }
.masthead .role a { color: var(--accent); }
body { padding-top: var(--head, 128px); }
.wrap { padding-top: 36px; padding-bottom: 18px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.masthead h1 { font: 600 2.7rem/1.1 var(--serif); margin: 0; letter-spacing: -0.015em; }
.masthead .role { margin: 8px 0 0; color: var(--muted); font-size: 1.05rem; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 0 26px; margin-top: 10px; }
.masthead nav a {
  color: var(--muted); padding: 15px 0 13px; border-bottom: 2px solid transparent;
  font-size: 0.95rem; font-weight: 500;
}
.masthead nav a:hover { color: var(--ink); text-decoration: none; }
.masthead nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
main > section[hidden] { display: none; }

/* Layout */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 64px; }
aside { align-self: start; font-size: 0.86rem; }
/* The side column (photo, profiles, contact) is pinned to the window and does not move */
.aside-inner {
  position: fixed; top: calc(var(--head, 128px) + 28px); width: 250px;
  max-height: calc(100vh - var(--head, 128px) - 40px); overflow-y: auto; scrollbar-width: thin;
}

/* Smaller photo that shrinks on short screens, so the whole column always fits without scrolling */
aside .photo {
  display: block; width: clamp(80px, calc((100vh - var(--head, 128px) - 440px) * 0.8), 190px); height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--rule); margin-bottom: 18px; background: #fff;
}
aside h2 {
  font: 600 1.02rem/1.2 var(--serif); color: var(--accent); letter-spacing: 0; text-transform: none;
  margin: 0 0 6px; padding-bottom: 5px; border-bottom: 2px solid var(--accent);
}
aside section + section { margin-top: 20px; }
aside ul { list-style: none; margin: 0; padding: 0; }
aside li { padding: 3px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 8px; }
aside li span { color: var(--muted); font-size: 0.8rem; }
aside address { font-style: normal; color: var(--muted); line-height: 1.5; }

main section { scroll-margin-top: calc(var(--head, 128px) + 16px); }

main h2 {
  font: 600 1.55rem/1.2 var(--serif); margin: 0 0 18px; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule); display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
main h2 small { font: 400 0.85rem var(--sans); color: var(--muted); }
main h3 { font: 600 1.05rem/1.3 var(--sans); margin: 28px 0 10px; color: var(--ink); }
.lead { font-size: 1.07rem; }
.lead p { margin: 0 0 12px; }

figure { margin: 26px 0 0; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 16px 16px 12px; }
figure img { display: block; width: 100%; height: auto; }
figcaption { color: #4d5860; font-size: 0.86rem; margin-top: 8px; }

/* Code cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.card .repo { font: 600 0.92rem var(--mono); color: var(--code); }
.card .ptitle { font-weight: 600; line-height: 1.35; }
.card .meta { color: var(--muted); font-size: 0.88rem; }
.card .row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.chip { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.note { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }

/* Publications */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] {
  flex: 1 1 260px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.toolbar label { color: var(--muted); font-size: 0.92rem; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.count { color: var(--muted); font-size: 0.88rem; }
.year { font: 600 0.8rem var(--sans); letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 6px; }
ol.pubs { list-style: none; margin: 0; padding: 0; }
hr.yearsep { border: 0; border-top: 1px dotted var(--muted); opacity: 0.8; margin: 8px 0; }
ol.pubs li { display: grid; grid-template-columns: 34px 1fr; gap: 4px; padding: 8px 0; }
ol.pubs .num { color: var(--muted); font-size: 0.85rem; padding-top: 2px; }
.authors { font-size: 0.93rem; color: var(--muted); }
.authors b { color: var(--ink); font-weight: 600; }
.authors a.coauthor { color: inherit; text-decoration: none; }
.authors a.coauthor:hover { color: var(--accent); }
.ptitle { font-family: var(--serif); font-size: 1.04rem; line-height: 1.4; }
.ptitle a { color: var(--ink); }
.ptitle a:hover { color: var(--accent); }
.venue { font-size: 0.93rem; color: var(--muted); }
.venue i { color: var(--ink); }
.venue a.journal { color: var(--ink); text-decoration: none; }
.venue a.journal:hover { color: var(--accent); }
.badges { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: 1px; }
.badge { font-size: 0.72rem; font-weight: 600; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--rule); color: var(--muted); }
.badge:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.badge.code { background: var(--code-soft); color: var(--code); border-color: transparent; }
.status { font-size: 0.72rem; font-weight: 600; color: var(--accent); margin-left: 6px; }

/* Supervision */
ol.people { list-style: none; margin: 0; padding: 0; }
ol.people li { display: grid; grid-template-columns: 52px 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
ol.people .y { color: var(--muted); font-size: 0.88rem; padding-top: 1px; }
ol.people .who { font-weight: 600; }
ol.people .what { font-size: 0.93rem; }
ol.people .inst { color: var(--muted); font-size: 0.87rem; }

ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 4px 0; }

/* Events */
ul.events { list-style: none; margin: 0; padding: 0; }
ul.events li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
ul.events li a { font-weight: 500; }
ul.events .detail { display: block; color: var(--muted); font-size: 0.88rem; }
details.past { margin-top: 22px; }
details.past summary {
  cursor: pointer; font-weight: 600; padding: 10px 14px; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--surface); list-style-position: inside;
}
details.past summary:hover { border-color: var(--accent); }
details.past[open] summary { margin-bottom: 4px; }

footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; padding: 18px 0 40px; }
/* Very short windows: the side column scrolls with the page instead of on its own */
@media (max-height: 700px) and (min-width: 821px) {
  .aside-inner { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 32px; }
  .aside-inner { position: static; width: auto; max-height: none; overflow: visible; }
  aside .photo { width: 180px; }
  .masthead h1 { font-size: 1.55rem; }
  .masthead .role { font-size: 0.85rem; }
  .masthead nav { gap: 0 18px; overflow-x: auto; flex-wrap: nowrap; }
  .masthead nav a { white-space: nowrap; }
}
