/* peitek.com — plain CSS, no build step, no external requests. */

:root {
  --bg: #fdfdfc;
  --surface: #f4f4f1;
  --text: #1d1f21;
  --muted: #5d6268;
  --faint: #8a8f95;
  --rule: #e3e3de;
  --accent: #1f5a8a;
  --accent-hover: #123e63;
  --award: #8a5a00;
  --award-bg: #fbf1dc;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --measure: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131517;
    --surface: #1c1f22;
    --text: #e6e6e3;
    --muted: #a3a8ad;
    --faint: #7b8086;
    --rule: #2c3034;
    --accent: #7db3e0;
    --accent-hover: #a9cdee;
    --award: #e8b960;
    --award-bg: #2e2617;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--text); color: var(--bg); padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; }

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

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

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1rem; padding-bottom: 1rem;
}
.site-title {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 650; letter-spacing: -0.01em; color: var(--text); text-decoration: none;
}
.site-title:hover { color: var(--text); }
.site-title .mark { width: 1.6rem; height: 1.6rem; flex: none; color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { font-weight: 600; }

/* ---------- Intro / profile ---------- */

.intro {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 2rem;
  align-items: center;
  padding: 3.25rem 0 1rem;
}
.intro img {
  width: 9.5rem; height: 9.5rem; border-radius: 50%; object-fit: cover;
  background: var(--surface);
}
.intro h1 {
  margin: 0 0 0.2rem;
  font-size: 2.1rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em;
}
.intro .role { margin: 0; color: var(--muted); line-height: 1.45; }
.intro .role a { color: inherit; }

.links {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
  margin: 0.9rem 0 0; padding: 0; list-style: none; font-size: 0.95rem;
}
.links a { display: inline-flex; align-items: center; gap: 0.4em; text-decoration: none; }
.links a:hover { text-decoration: underline; }
.links svg { width: 1em; height: 1em; flex: none; fill: currentColor; }

@media (max-width: 560px) {
  .intro { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 2.25rem; text-align: left; }
  .intro img { width: 7.5rem; height: 7.5rem; }
  .intro h1 { font-size: 1.8rem; }
}

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

main { padding-bottom: 3rem; }

section { padding-top: 2.25rem; }

h2 {
  margin: 0 0 0.9rem;
  font-size: 0.8rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }

p { margin: 0 0 1rem; }

.lead { font-size: 1.125rem; }

.more { font-size: 0.95rem; }

/* Research themes */
.themes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.themes li { padding-left: 1rem; border-left: 2px solid var(--rule); }
.themes strong { display: block; font-weight: 600; }
.themes span { color: var(--muted); font-size: 0.98rem; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li {
  display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: baseline;
  padding: 0.35rem 0;
}
.news time {
  color: var(--faint); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 560px) {
  .news li { grid-template-columns: 1fr; gap: 0; padding: 0.5rem 0; }
}

/* ---------- Publications ---------- */

.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0.8rem 0; }
.pub + .pub { border-top: 1px solid var(--rule); }
.pub .title { display: block; font-weight: 600; line-height: 1.4; color: var(--text); }
.pub .authors, .pub .venue { display: block; font-size: 0.95rem; color: var(--muted); line-height: 1.5; }
.pub .authors .me { color: var(--text); font-weight: 600; }
.pub .venue em { font-style: normal; }
.pub .meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; margin-top: 0.35rem;
  font-size: 0.875rem;
}
.pub .meta a { text-decoration: none; }
.pub .meta a:hover { text-decoration: underline; }

.tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 650; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  padding: 0.05rem 0.45rem; border-radius: 4px;
  background: var(--surface); color: var(--muted);
}
.award {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-size: 0.8rem; font-weight: 600;
  padding: 0.08rem 0.5rem; border-radius: 4px;
  background: var(--award-bg); color: var(--award);
}
.award svg { width: 0.95em; height: 0.95em; fill: currentColor; }

.year {
  margin: 2rem 0 0.25rem;
  font-size: 1rem; font-weight: 650; color: var(--text);
  font-variant-numeric: tabular-nums;
}

.page-head { padding: 3rem 0 0.5rem; }
.page-head h1 { margin: 0 0 0.5rem; font-size: 2rem; letter-spacing: -0.02em; line-height: 1.2; }
.page-head p { color: var(--muted); margin: 0; }

.toc { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }

/* ---------- Two-column lists (teaching, service) ---------- */

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
@media (max-width: 680px) { .cols { grid-template-columns: 1fr; } }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 0.3rem 0; line-height: 1.5; }
.plain .when { display: block; color: var(--faint); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* Date column on wide screens, matching the news list */
@media (min-width: 561px) {
  .dated li { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: baseline; padding: 0.35rem 0; }
  .dated .when { font-size: 0.9rem; }
}

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

.site-footer { border-top: 1px solid var(--rule); color: var(--faint); font-size: 0.875rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding-top: 1.5rem; padding-bottom: 2rem;
}
.site-footer a { color: var(--muted); }

/* ---------- Legal page ---------- */

.legal h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }
.legal h4 { font-size: 0.98rem; margin: 1.5rem 0 0.4rem; }
.legal h5 { font-size: 0.95rem; font-weight: 600; margin: 1.1rem 0 0.3rem; color: var(--muted); }
.legal section > h3:first-of-type { margin-top: 0.5rem; }
.legal p, .legal li { font-size: 0.95rem; color: var(--text); }
.legal address { font-style: normal; margin-bottom: 1rem; }

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

@media print {
  :root { --bg: #fff; --text: #000; --muted: #333; --faint: #555; --accent: #000; }
  .site-nav, .skip, .site-footer { display: none; }
  body { font-size: 10.5pt; }
  a { text-decoration: none; }
  .pub { break-inside: avoid; }
}

/* ---------- Research areas ---------- */

.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.25rem; }
.area {
  padding: 1rem 1.1rem 0.4rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--surface);
}
.area-wide { grid-column: 1 / -1; }
.area-label {
  display: block; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.area h3 { margin: 0.15rem 0 0.4rem; font-size: 1.02rem; }
.area p { font-size: 0.95rem; color: var(--muted); }
@media (min-width: 900px) {
  .areas { grid-template-columns: repeat(3, 1fr); }
  .area-wide { grid-column: auto; }
}
@media (max-width: 680px) { .areas { grid-template-columns: 1fr; } }

/* ---------- Small text helpers ---------- */

.stats { font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { font-weight: 400; color: var(--faint); font-size: 0.9rem; }
.legend { font-size: 0.85rem; color: var(--faint); margin: 0.75rem 0 0.25rem; }
.pub sup { font-size: 0.7em; line-height: 0; margin-left: 0.05em; }
.pub .status { font-style: italic; color: var(--text); }
.pub .note { font-style: italic; }

/* Sub-headings inside sections stay quieter than the section label */
section > h3, .cols h3 {
  font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 0.4rem;
}
.cols h3 { margin-top: 0.5rem; }
.cols > div > h3 ~ h3 { margin-top: 1.5rem; }
