/* sstich.ch stylesheet
   Named site.css (not style.css) so it can live next to the old page's
   stylesheet on the server without overwriting it. */

/* Light only, on purpose.

   Every colour is a token in the :root block below, so swapping the palette
   means replacing that block (plus deleting the header-band section further
   down, if you want the band gone). The alternate palette is written out in
   README.md.

   The palette here is the one the previous sstich.ch used: the #b3b5e4
   lavender band behind the header, #f8f6ff tints, and navy #003355 links.

   To follow the visitor's OS theme, add a @media (prefers-color-scheme: dark)
   block redefining these same tokens. */

:root {
  --bg: #ffffff;
  --bg-soft: #f8f6ff;
  --card: #ffffff;
  --fg: #16161c;
  --fg-soft: #3a3a48;
  --muted: #676776;
  --rule: #e3e1ee;
  --accent: #003355;
  --accent-fg: #ffffff;
  --accent-soft: #f8f6ff;
  --accent-line: #b3b5e4;
  --badge: #eeecf8;

  /* header band; only used by the band block below */
  --band: #b3b5e4;
  --band-edge: #9a9cd4;
  --band-meta: #3a3a52;
  --band-dot: #7e80b8;

  --radius: 12px;
  --maxw: 60rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

p { margin: 0 0 1rem; }
strong { font-weight: 650; }

/* ---------- navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .nav { background: var(--bg); }
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  min-height: 52px;
}

.nav-name {
  font-weight: 650;
  color: var(--fg);
  margin-right: auto;
  letter-spacing: -0.01em;
}

.nav a:not(.nav-name) {
  color: var(--fg-soft);
  font-size: 0.93rem;
  padding: 0.35rem 0;
}

.nav a:not(.nav-name):hover { color: var(--accent); text-decoration: none; }

/* ---------- header ---------- */

.masthead {
  padding: 3rem 0 2.25rem;
  border-bottom: 1px solid var(--rule);
}

.masthead-grid {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.portrait {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.masthead h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.role {
  margin: 0 0 1rem;
  color: var(--fg-soft);
  font-size: 1.05rem;
}

.meta {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta span + span::before {
  content: "·";
  margin: 0 0.5rem;
  color: var(--rule);
}

.linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--fg-soft);
  background: var(--card);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.btn-primary:hover { color: var(--accent-fg); opacity: 0.9; text-decoration: none; }


/* ---------- header band ----------
   Self-contained on purpose: delete this block and the four --band-* tokens
   to get the white-header variant. Nothing else depends on it. */

.masthead {
  background: var(--band);
  border-bottom-color: var(--band-edge);
}

.masthead .meta { color: var(--band-meta); }
.masthead .meta span + span::before { color: var(--band-dot); }

.masthead .btn:not(.btn-primary) {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.95);
}

.masthead .portrait { border-color: rgba(255, 255, 255, 0.7); }

/* ---------- end header band ---------- */

/* ---------- sections ---------- */

section {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 60px; /* clears the sticky nav when jumping to an anchor */
}

section:last-of-type { border-bottom: 0; }

h2 {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h3:first-child { margin-top: 0; }

.lede { font-size: 1.1rem; color: var(--fg-soft); max-width: 46rem; }
.prose { max-width: 46rem; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }

.note { color: var(--muted); font-size: 0.93rem; }
.mt { margin-top: 1.4rem; }

.themes { list-style: none; padding: 0; margin: 0; }
.themes li { margin-bottom: 0.7rem; }
.themes b { color: var(--fg); font-weight: 650; }

/* ---------- highlights ---------- */

.highlights {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  /* 290px gives three per row at full width, so five cards sit 3 + 2 rather
     than leaving one stranded on its own line. */
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0.75rem;
}

.highlights li {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.93rem;
  line-height: 1.45;
}

.highlights b { display: block; font-weight: 650; margin-bottom: 0.1rem; }
.highlights span { color: var(--muted); }

/* ---------- openings ---------- */

.openings {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.openings h2 { color: var(--fg-soft); }

.roles {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  border-top: 1px solid var(--rule);
}

.roles li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.role-name {
  flex: 0 0 11rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.cta {
  margin: 1.2rem 0 0;
}

.role-desc {
  min-width: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- publications ---------- */

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

.pub {
  display: flex;
  gap: 1.1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.pub:first-child { border-top: 0; padding-top: 0; }

.pub-mark {
  flex: 0 0 4.6rem;
  text-align: right;
  padding-top: 0.15rem;
}

.pub-abbr {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--fg-soft);
}

.pub-year { display: block; font-size: 0.78rem; color: var(--muted); }

.pub-body { min-width: 0; }

.pub-title {
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
}

/* The title is the only link on an entry, so it has to read as one. */
a.pub-title { color: var(--accent); }
a.pub-title:hover { text-decoration: underline; text-underline-offset: 2px; }

.pub-authors,
.pub-venue,
.pub-note,
.pub-links {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.pub-authors strong { color: var(--fg-soft); font-weight: 650; }

.pub-award {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--badge);
  color: var(--fg-soft);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.pub-links { margin-top: 0.3rem; font-size: 0.88rem; }
.pub-links .sep { margin: 0 0.45rem; color: var(--rule); }

/* ---------- people ---------- */

.people {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.35rem 1.5rem;
}

.people li { font-size: 0.95rem; }
.people .since { color: var(--muted); font-size: 0.85rem; }

/* ---------- compact fact lists ---------- */

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

.facts li {
  display: flex;
  gap: 1.1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.facts li:first-child { border-top: 0; }

.facts .when {
  flex: 0 0 7.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  padding-top: 0.12rem;
}

.facts .what { min-width: 0; }
.facts .what em { color: var(--fg-soft); font-style: italic; }
.facts .where { display: block; color: var(--muted); font-size: 0.88rem; }

/* ---------- footer ---------- */

footer {
  padding: 2.5rem 0 3.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--rule);
}

footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--accent); }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 1.15rem; }
  .masthead { padding: 2rem 0 1.75rem; }
  .masthead-grid { flex-direction: column; gap: 1.25rem; }
  .portrait { width: 96px; height: 96px; }
  /* One scrollable row rather than three wrapped ones. */
  .nav .wrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1rem;
    min-height: 46px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav .wrap::-webkit-scrollbar { display: none; }
  .nav .wrap > a { white-space: nowrap; }
  .nav-name { padding-right: 0.25rem; }
  .roles li { flex-direction: column; gap: 0.15rem; align-items: stretch; }
  .role-name { flex: none; }
  .pub { flex-direction: column; gap: 0.3rem; }
  .pub-mark { text-align: left; flex: none; }
  .pub-abbr, .pub-year { display: inline; font-size: 0.8rem; }
  .pub-year::before { content: " · "; color: var(--rule); }
  .facts li { flex-direction: column; gap: 0.1rem; }
  .facts .when { flex: none; }
}

@media print {
  .nav, .openings { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .masthead { background: none; border-bottom-color: #999; }
}
