:root {
  --crimson: #841617;
  --crimson-soft: #a83133;
  --ink: #14161a;
  --body: #3d434d;
  --muted: #6b7280;
  --faint: #9aa1ac;
  --bg: #ffffff;
  --panel: #f7f7f8;
  --line: #e5e7eb;
  --radius: 12px;
  --max: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --crimson: #e8595b;
    --crimson-soft: #f08284;
    --ink: #f3f4f6;
    --body: #c3c8d0;
    --muted: #98a0ab;
    --faint: #6f7783;
    --bg: #0f1115;
    --panel: #171a20;
    --line: #262b33;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }

a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ topbar */
#topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem max(1.25rem, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#brand { font-weight: 700; color: var(--ink); font-size: 15px; letter-spacing: -.01em; }
/* -------------------------------------------------------------------- page */
#page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

#side { position: sticky; top: 4.5rem; }

#avatar {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--crimson), var(--crimson-soft));
  margin-bottom: 1.1rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: .02em;
}

#name { font-size: 27px; letter-spacing: -.02em; margin-bottom: .35rem; }
#headline { margin: 0 0 .6rem; font-size: 15px; color: var(--body); }
#available {
  margin: 0 0 1.2rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--crimson);
}
#available:empty { display: none; }

#contact { margin: 0 0 1rem; font-size: 14px; }
#contact div { display: flex; gap: .5rem; margin-bottom: .3rem; }
#contact dt { color: var(--faint); min-width: 4.5rem; }
#contact dd { margin: 0; color: var(--body); word-break: break-word; }

#links { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.8rem; }
#links a {
  font-size: 13px;
  font-weight: 600;
  padding: .3rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}
#links a:hover { border-color: var(--crimson); color: var(--crimson); text-decoration: none; }
#links:empty { display: none; }

h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--faint);
  font-weight: 700;
  margin-bottom: .9rem;
}

.skill-group { margin-bottom: 1rem; }
.skill-group h3 { font-size: 13px; font-weight: 700; margin-bottom: .4rem; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  font-size: 12.5px;
  line-height: 1.45;
  padding: .2rem .55rem;
  border-radius: 6px;
  background: var(--panel);
  color: var(--body);
  border: 1px solid var(--line);
}
/* long items (course titles) read better as a list than as pills */
.skill-group.long .chips { display: block; }
.skill-group.long .chip {
  display: block;
  border: 0;
  background: transparent;
  padding: .1rem 0;
  color: var(--muted);
}

/* ----------------------------------------------------------------- content */
#content > section { margin-bottom: 2.6rem; }
#content > section:last-child { margin-bottom: 0; }

#about { margin: 0; font-size: 16.5px; max-width: 62ch; }

.item { padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem 1rem;
  margin-bottom: .15rem;
}
.item-head h3 { font-size: 17px; }
.period { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.org { font-size: 14.5px; color: var(--muted); margin: 0 0 .6rem; }
.org strong { color: var(--body); font-weight: 600; }

.item ul { margin: 0; padding-left: 1.1rem; }
.item li { margin-bottom: .35rem; max-width: 68ch; }
.item li::marker { color: var(--faint); }

.projects-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.project {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  background: var(--panel);
}
.project h3 { font-size: 16px; margin-bottom: .35rem; }
.project-link {
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-thickness: 1px;
}
.project-link:hover { text-decoration-thickness: 2px; }
.project-link:focus-visible { outline: 2px solid var(--crimson); outline-offset: 4px; border-radius: 2px; }
.project-link svg {
  width: 1em;
  height: 1em;
  vertical-align: -.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.project p { margin: 0 0 .8rem; font-size: 14.5px; }
.project .period { font-size: 13px; white-space: normal; }
.project ul { margin: 0 0 1rem; padding-left: 1.1rem; font-size: 14.5px; }
.project li { margin-bottom: .35rem; }
.project .chips .chip { background: var(--bg); }

/* ------------------------------------------------------------------ footer */
#foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--faint);
}
#runtime-note { font-family: var(--mono); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 860px) {
  #page { grid-template-columns: 1fr; gap: 2.2rem; padding-top: 1.8rem; }
  #side { position: static; }
  #topbar { padding-left: 1rem; padding-right: 1rem; }
}

@media print {
  #topbar, #foot { display: none !important; }
  #page { display: block; max-width: none; padding: 0; }
  #side { margin-bottom: 1.5rem; }
  a { color: var(--ink); }
}
