/* ==========================================================================
   Anthony Christidis personal site
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */

:root {
  --paper:      #fbfaf8;
  --surface:    #ffffff;
  --surface-2:  #f4f2ee;
  --ink:        #1a1d21;
  --ink-soft:   #454c54;
  --ink-mute:   #79818a;
  --rule:       #e5e1d9;
  --rule-soft:  #efece6;
  --accent:     #8a2332;
  --accent-ink: #6d1a27;
  --accent-bg:  #f6ebec;
  --shadow:     0 1px 2px rgba(24, 20, 16, .04), 0 8px 28px rgba(24, 20, 16, .05);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono:  "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;

  --measure: 68ch;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #131519;
    --surface:    #1a1d22;
    --surface-2:  #22262c;
    --ink:        #e7e5e1;
    --ink-soft:   #b3b8bf;
    --ink-mute:   #878e97;
    --rule:       #2c3138;
    --rule-soft:  #24282e;
    --accent:     #e0808d;
    --accent-ink: #f0a3ad;
    --accent-bg:  #2a1f23;
    --shadow:     0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  }
}

:root[data-theme="dark"] {
  --paper:      #131519;
  --surface:    #1a1d22;
  --surface-2:  #22262c;
  --ink:        #e7e5e1;
  --ink-soft:   #b3b8bf;
  --ink-mute:   #878e97;
  --rule:       #2c3138;
  --rule-soft:  #24282e;
  --accent:     #e0808d;
  --accent-ink: #f0a3ad;
  --accent-bg:  #2a1f23;
  --shadow:     0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
}

/* --- Base --------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

a:hover {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: .45em; }
li:last-child { margin-bottom: 0; }

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

code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--surface-2);
  padding: .12em .38em;
  border-radius: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border: 0;
}
.skip-link:focus { left: 8px; top: 8px; }

/* --- Top bar ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 60px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  border: 0;
  white-space: nowrap;
  letter-spacing: -0.015em;
}
.brand:hover { color: var(--accent); }

.mainnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mainnav a {
  color: var(--ink-soft);
  border: 0;
  font-size: .875rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 6px;
  white-space: nowrap;
}

.mainnav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

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

/* --- Page shell --------------------------------------------------------- */

.shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px var(--gutter) 72px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* --- Sidebar ------------------------------------------------------------ */

.sidebar {
  position: sticky;
  top: 92px;
}

.sidebar__photo {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--rule);
}

.sidebar__name {
  font-size: 1.44rem;
  margin: 0 0 12px;
}

.sidebar__role {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  margin: 0 0 18px;
}

.sidebar__role .r-title {
  font-weight: 600;
  font-size: .945rem;
  color: var(--ink);
  display: block;
  line-height: 1.4;
}

.sidebar__role .r-line {
  font-size: .87rem;
  color: var(--ink-soft);
  display: block;
  line-height: 1.5;
}

.sidebar__role .r-line a { border-bottom-color: transparent; }
.sidebar__role .r-line a:hover { border-bottom-color: var(--accent); }

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

.sidebar__links a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  color: var(--ink-soft);
  border: 0;
  padding: 6px 8px;
  margin-left: -8px;
  border-radius: 6px;
}

.sidebar__links a:hover {
  color: var(--accent);
  background: var(--surface-2);
}

.sidebar__links svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .85;
}

.sidebar__links svg.fill {
  fill: currentColor;
  stroke: none;
}

/* --- Content ------------------------------------------------------------ */

.content { min-width: 0; }

.content > p,
.content > ul,
.content > ol { max-width: var(--measure); }

.page-title {
  font-size: clamp(1.9rem, 1.4rem + 1.7vw, 2.55rem);
  margin: 0 0 10px;
}

.page-lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 8px;
}

.section {
  margin-top: 52px;
  scroll-margin-top: 84px;
}

.section:first-of-type { margin-top: 40px; }

.section__title {
  font-size: 1.34rem;
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section__title .count {
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section__intro {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 14px 0 22px;
}

.eyebrow {
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.subhead {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--sans);
  margin: 34px 0 16px;
}

/* --- Stat strip --------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin: 30px 0 0;
}

.stat {
  background: var(--surface);
  padding: 16px 18px;
}

.stat__num {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  display: block;
  letter-spacing: -0.02em;
}

.stat__label {
  font-size: .765rem;
  color: var(--ink-mute);
  letter-spacing: .035em;
  text-transform: uppercase;
  margin-top: 5px;
  display: block;
  line-height: 1.4;
}

/* --- Focus-area list ---------------------------------------------------- */

.areas {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 2px;
}

.areas li {
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.areas li:last-child { border-bottom: 1px solid var(--rule-soft); }

.areas h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.areas p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .945rem;
}

/* --- Cards -------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--rule));
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.card__kicker {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.card h3 {
  font-size: 1.04rem;
  margin: 0;
  line-height: 1.35;
}

.card h3 a { border: 0; color: var(--ink); }
.card h3 a:hover { color: var(--accent); }

.card p {
  margin: 0;
  font-size: .91rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.card__foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: .82rem;
}

/* --- Publication entries ------------------------------------------------ */

.pubs { list-style: none; margin: 18px 0 0; padding: 0; }

.pub {
  margin: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 20px;
}

.pub:first-child { border-top: 1px solid var(--rule-soft); }

.pub__year {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink-mute);
  padding-top: 4px;
  letter-spacing: -0.02em;
}

.pub__title {
  font-family: var(--serif);
  font-size: 1.055rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 6px;
}

.pub__title a { color: var(--ink); border-bottom-color: transparent; }
.pub__title a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.pub__authors {
  font-size: .89rem;
  color: var(--ink-soft);
  margin: 0 0 5px;
  line-height: 1.55;
}

.pub__authors .me { color: var(--ink); font-weight: 600; }

.pub__venue {
  font-size: .875rem;
  color: var(--ink-mute);
  font-style: italic;
  margin: 0;
}

.pub__links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: .81rem;
}

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-style: normal;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 7px;
  border-radius: 4px;
  vertical-align: 1px;
  margin-left: 6px;
}

.tag--mute {
  color: var(--ink-mute);
  background: var(--surface-2);
}

/* --- Timeline ----------------------------------------------------------- */

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

.tl {
  margin: 0;
  padding: 0 0 26px 26px;
  border-left: 1px solid var(--rule);
  position: relative;
}

.tl:last-child { padding-bottom: 4px; border-left-color: transparent; }

.tl::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--rule);
}

.tl--now::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.tl__when {
  font-family: var(--mono);
  font-size: .765rem;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}

.tl__role {
  font-family: var(--serif);
  font-size: 1.055rem;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.35;
}

.tl__org {
  font-size: .9rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.tl__body {
  font-size: .93rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: var(--measure);
}

/* --- Definition-style rows (awards, talks, education) ------------------- */

.rows { list-style: none; margin: 18px 0 0; padding: 0; }

.row {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.row:first-child { border-top: 1px solid var(--rule-soft); }

.row__main { font-size: .96rem; }
.row__main strong { display: block; font-weight: 600; }
.row__sub { color: var(--ink-mute); font-size: .875rem; }

.row__meta {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-mute);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

/* --- Compact course list ------------------------------------------------ */

.courses {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 4px 32px;
}

.courses li {
  margin: 0;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.courses .code {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-right: 7px;
}

/* --- Software table ----------------------------------------------------- */

.pkg-table-wrap {
  margin-top: 22px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow-x: auto;
  background: var(--surface);
}

.pkg-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: .9rem;
}

.pkg-table th {
  text-align: left;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.pkg-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.pkg-table tr:last-child td { border-bottom: 0; }
.pkg-table tbody tr:hover { background: var(--surface-2); }

.pkg-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: .875rem;
  white-space: nowrap;
}
.pkg-name a { border-bottom-color: transparent; }
.pkg-name a:hover { border-bottom-color: var(--accent); }

.pkg-desc { color: var(--ink-soft); min-width: 190px; }

.pkg-num {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-mute);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pkg-links { font-size: .8rem; line-height: 1.9; }
.pkg-links a { margin-right: 10px; white-space: nowrap; }
.pkg-links a:last-child { margin-right: 0; }

/* --- Callout ------------------------------------------------------------ */

.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  margin: 26px 0 0;
  max-width: var(--measure);
  font-size: .945rem;
  color: var(--ink-soft);
}

.callout strong { color: var(--ink); }

/* --- Next / prev page links -------------------------------------------- */

.more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  font-weight: 500;
  margin-top: 20px;
  border: 0;
}

.more::after {
  content: "→";
  transition: transform .15s ease;
}

.more:hover::after { transform: translateX(3px); }

/* --- Footer ------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  margin-top: 0;
  background: var(--paper);
}

.footer__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--ink-mute);
}

.footer__inner a { color: var(--ink-mute); border-bottom-color: var(--rule); }
.footer__inner a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* --- Responsive --------------------------------------------------------- */

/* The two-column focus-area rows need a wide description column to stay at two
   lines; below this the label stacks above the text instead of beside it. */
@media (max-width: 1080px) {
  .areas li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-top: 32px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--rule);
  }

  .sidebar__photo { width: 112px; height: 112px; margin-bottom: 0; }
  .sidebar__name { margin-top: 0; }
  .sidebar__links { margin-top: 4px; }

  .areas li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }

  .topbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .mainnav {
    justify-content: flex-start;
    margin-left: -11px;
    flex-wrap: wrap;
    gap: 0 2px;
    padding-bottom: 2px;
  }

  .mainnav a { padding: 6px 11px; }

  .sidebar { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sidebar__photo { width: 96px; height: 96px; }

  .pub { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pub__year { padding-top: 0; }

  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
