/* qpetit.com/resume — dark, single theme.
   Layout: one centered column (1120px); header with name and a low-rank portrait,
   then experience as a vertical timeline, publications, education, skills. */

:root {
  --bg: #0b0d12;
  --panel: #11141b;
  --panel-2: #0e1117;
  --line: #1f2430;
  --line-2: #2a3040;
  --chip-line: #343b52;
  --ink: #eceef4;
  --body: #c3c8d4;
  --muted: #9aa1b2;
  --faint: #596071;
  --accent: #a5b4fc;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: 32px;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-color: #474e5f;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.mono {
  font-family: var(--mono);
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Header ------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
}

/* Hero ---------------------------------------------------------------- */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 80px;
}

.hero-text {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.role {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(48px, 9vw, 76px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 58ch;
  font-size: 18px;
  color: var(--body);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 14px;
}

.links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  color: var(--bg);
  background: #c7d0fe;
  border-color: #c7d0fe;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
  font-weight: 500;
}

.btn-ghost:hover {
  background: var(--panel);
  border-color: var(--accent);
  color: var(--accent);
}

.contact {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.contact a {
  color: var(--muted);
}

/* Low-rank portrait */

.svd {
  flex: 0 1 380px;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.svd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 380px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.svd-grid li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.svd-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  image-rendering: pixelated;
  object-fit: cover;
}

.svd-grid .full img {
  image-rendering: auto;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.svd-grid .full {
  color: var(--accent);
}

/* 404 page: the rank-0 tile has nothing left to show */
.svd-void {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--accent);
  border-radius: 10px;
  font-size: 22px;
  color: var(--faint);
}

.svd figcaption {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* Sections ------------------------------------------------------------ */

.section {
  padding-top: 24px;
  padding-bottom: 48px;
  scroll-margin-top: 16px;
}

.section + .section {
  padding-top: 40px;
}

.section h2 {
  margin-bottom: 28px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.org {
  color: var(--muted);
}

.org a {
  color: var(--muted);
}

.bullets {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--body);
}

.bullets ul {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bullets li::marker {
  color: var(--faint);
}

.bullets strong {
  color: var(--ink);
  font-weight: 600;
}

/* Experience timeline */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tl-item {
  position: relative;
  padding: 0 0 48px 44px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--faint);
  background: var(--bg);
}

.tl-item::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 30px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item:last-child::after {
  display: none;
}

.tl-current::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--line-2);
}

.tl-minor {
  padding-bottom: 32px;
}

.tl-minor::before {
  left: 2px;
  top: 7px;
  width: 12px;
  height: 12px;
}

.tl-body {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.tl-main {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tl-minor .tl-main {
  gap: 4px;
}

.tl-when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.tl-current .tl-when {
  color: var(--accent);
}

.tl-item h3 {
  font-size: 23px;
  line-height: 1.3;
  font-weight: 600;
}

.tl-minor h3 {
  font-size: 18px;
}

.tl-minor h3 span {
  font-weight: 400;
  color: var(--muted);
}

.tl-intro {
  margin-top: 4px;
  color: var(--body);
}

.tl-minor p:last-child {
  color: var(--body);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
}

.chips li {
  padding: 4px 10px;
  border: 1px solid var(--chip-line);
  border-radius: 6px;
  color: var(--accent);
}

.specs {
  flex: 1 1 220px;
  max-width: 260px;
  align-self: flex-start;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

.specs dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.specs dd {
  margin: 0;
}

/* Publications */

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.pub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.pub-year {
  flex: 0 0 56px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.pub-body {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-body h3 {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
}

.pub-body h3 a {
  text-decoration: none;
}

.pub-authors {
  font-size: 15px;
  color: var(--muted);
}

.pub-authors strong {
  color: var(--body);
  font-weight: 600;
}

.pub-summary {
  max-width: 72ch;
  font-size: 15px;
  color: var(--body);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--mono);
  font-size: 13px;
}

.pub-links a {
  color: var(--body);
}

.pub-venue {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 6px;
  background: #191d27;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--body);
}

/* Education */

.edu {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.edu-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.edu-when {
  flex: 0 0 130px;
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

.edu-body {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edu-body h3 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
}

.edu-body > p {
  color: var(--body);
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  margin: 10px 0 0;
  font-size: 15px;
}

.facts dt {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--body);
}

.jury {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jury span {
  color: var(--muted);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Skills, service, interests */

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
}

.split > section {
  flex: 1 1 420px;
  min-width: 0;
}

.split h2 {
  margin-bottom: 22px;
}

.kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kv dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.kv dd {
  margin: 2px 0 0;
}

.plain {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--body);
}

.plain li::marker {
  color: var(--faint);
}

.sub {
  margin: 28px 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.sub:first-of-type {
  margin-top: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
}

.tags li {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--panel);
  color: var(--body);
}

/* Footer */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 40px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

/* Home page: index in three columns ----------------------------------- */

.index {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 48px;
  margin-bottom: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.index-col {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-margin-top: 16px;
}

.index-col.wide {
  flex: 2 1 440px;
}

.index-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.index-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.index-link strong {
  font-size: 20px;
  font-weight: 600;
}

.index-link span {
  font-size: 15px;
  color: var(--muted);
}

.index-link:hover span {
  color: var(--body);
}

.project {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.project img {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.project > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project h3 {
  font-size: 20px;
  font-weight: 600;
}

.project h3 a {
  text-decoration: none;
}

.kind {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.project p {
  font-size: 15px;
  color: var(--body);
}

.project .project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 12px;
}

.latest {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.latest li {
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

.latest time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.latest a {
  text-decoration: none;
}

.index-more {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* Projects page ------------------------------------------------------- */

.nav a[aria-current="page"] {
  color: var(--accent);
}

.hero.page-head {
  padding-bottom: 48px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 13px;
}

.filters[hidden] {
  display: none;
}

.filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--panel);
  color: var(--body);
  font: inherit;
  cursor: pointer;
}

.filters button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filters button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.filters button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.filters .count {
  color: var(--faint);
}

.filters button[aria-pressed="true"] .count {
  color: inherit;
  opacity: 0.65;
}

.proj-group {
  margin-bottom: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.proj {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 280px;
  gap: 16px 28px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.index-label + .proj {
  padding-top: 24px;
  border-top: 0;
}

.proj:last-child {
  padding-bottom: 0;
}

.proj-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  outline: 1px solid var(--line);
  outline-offset: -1px;
}

.proj-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj h3 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
}

.proj h3 a {
  text-decoration: none;
}

.proj-desc {
  max-width: 68ch;
  color: var(--body);
}

.proj code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--ink);
}

.proj-credit {
  font-size: 15px;
  color: var(--muted);
}

.proj-credit a {
  color: var(--body);
}

.proj-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--mono);
  font-size: 13px;
}

.proj-facts {
  align-self: start;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  font-size: 14px;
}

.proj-facts dt {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.proj-facts dd {
  margin: 0;
  color: var(--body);
}

/* Facts under the description when the third column no longer fits */
@media (max-width: 900px) {
  .proj {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .proj-facts {
    grid-column: 2;
    padding-left: 0;
    border-left: 0;
  }
}

/* Small screens ------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }

  .hero {
    padding-top: 48px;
    padding-bottom: 56px;
    gap: 40px;
  }

  /* Low-rank portrait: the four tiles side by side, full width */
  .svd {
    flex: 1 1 100%;
  }

  .svd-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-width: none;
  }

  .svd-grid img,
  .svd-void {
    border-radius: 6px;
  }

  .svd-void {
    font-size: 16px;
  }

  .tl-item {
    padding-left: 32px;
  }

  .tl-item h3 {
    font-size: 20px;
  }

  .specs {
    max-width: none;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .facts dd {
    margin-bottom: 8px;
  }

  .proj {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px 16px;
  }

  .proj-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
  }

  .proj h3 {
    font-size: 20px;
  }

  .proj-desc {
    font-size: 15px;
  }

  .proj-facts {
    grid-column: 1 / -1;
  }
}

/* Print --------------------------------------------------------------- */

@media print {
  :root {
    --bg: #ffffff;
    --panel: #ffffff;
    --ink: #111111;
    --body: #222222;
    --muted: #555555;
    --accent: #1d4ed8;
    color-scheme: light;
  }

  .site-header nav,
  .svd,
  .skip-link,
  .btn-row,
  .filters {
    display: none;
  }

  .proj-group[hidden] {
    display: block;
  }

  .tl-item,
  .pub,
  .edu-item {
    break-inside: avoid;
  }
}
