/* bilgehansel.com - minimal academic
   Palette is warm-paper light with a matched dark mode. All colors are
   defined as tokens on :root; dark only redefines them. */

@import url("./fonts/fonts.css");

:root {
  --serif: "Source Serif 4", Charter, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg:      #fbfaf7;
  --surface: #f3f1ec;
  --text:    #1c1b19;
  --muted:   #6d6960;
  --faint:   #938f86;
  --rule:    #e4e0d7;
  --accent:  #9c4221;
  --accent-soft: rgba(156, 66, 33, 0.10);

  --measure: 40rem;
  --gap: 1.6rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #171614;
    --surface: #201f1c;
    --text:    #e9e6df;
    --muted:   #a19c92;
    --faint:   #7d786f;
    --rule:    #302e29;
    --accent:  #e0885e;
    --accent-soft: rgba(224, 136, 94, 0.13);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

@media (max-width: 34rem) {
  .wrap { padding: 2.75rem 1.25rem 3.5rem; }
}

/* ---------- links ---------- */

a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 0.06em;
  transition: background-color 0.14s ease, color 0.14s ease;
}
a:hover { color: var(--accent); background-color: var(--accent-soft); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- masthead ---------- */

.name {
  font-size: 2.125rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}

.affil {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  letter-spacing: 0.01em;
}
.affil .sep { color: var(--faint); margin: 0 0.4em; }

.lede { margin: 0 0 1.15rem; }
.lede:last-of-type { margin-bottom: 0; }

/* ---------- link row ---------- */

.links {
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin-top: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
}
.links a { background-size: 100% 1px; }

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

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0 2.25rem;
}

h2 {
  font-family: var(--sans);
  font-size: 0.78125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* ---------- publication entries ---------- */

.pubs { display: flex; flex-direction: column; gap: 1.5rem; }

.pub { display: grid; grid-template-columns: 3.25rem 1fr; column-gap: 1rem; }

.pub .year {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--faint);
  padding-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.pub .title { font-weight: 600; line-height: 1.4; display: block; }

.pub .meta {
  font-family: var(--sans);
  font-size: 0.84375rem;
  color: var(--muted);
  margin-top: 0.28rem;
  line-height: 1.55;
}

.pub .authors { color: var(--muted); }
.pub .authors .me { color: var(--text); font-weight: 500; }

.venue {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.13em 0.5em;
  border-radius: 3px;
  white-space: nowrap;
}
.venue.quiet {
  color: var(--muted);
  background: var(--surface);
}

.note {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--faint);
}

.pub .refs { margin-left: 0.15rem; }
.pub .refs a {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}
.pub .refs a:hover { color: var(--accent); }

@media (max-width: 34rem) {
  .pub { grid-template-columns: 1fr; }
  .pub .year { padding-top: 0; margin-bottom: 0.15rem; }
}

/* ---------- year groups (publications page) ---------- */

.group { margin-bottom: 2.75rem; }
.group:last-child { margin-bottom: 0; }

.group > h3 {
  font-family: var(--sans);
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

/* ---------- misc ---------- */

.more {
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin-top: 2rem;
}

.back {
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin-bottom: 2.5rem;
  display: block;
}

footer {
  font-family: var(--sans);
  font-size: 0.84375rem;
  color: var(--faint);
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  column-gap: 1rem;
  margin-bottom: 0.85rem;
}
.timeline .when {
  font-family: var(--sans);
  font-size: 0.84375rem;
  color: var(--faint);
  padding-top: 0.15rem;
}
.timeline .what { line-height: 1.5; }
.timeline .where { font-weight: 600; }
.timeline .role { color: var(--muted); font-size: 0.96em; }

@media (max-width: 34rem) {
  .timeline li { grid-template-columns: 1fr; }
  .timeline .when { padding-top: 0; }
}

/* ---------- paper pages ---------- */

.paper-meta {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

h1.paper-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
  text-wrap: balance;
}

.paper-authors {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.6rem;
}
.paper-authors .me { color: var(--text); font-weight: 500; }

.paper-links {
  font-family: var(--sans);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
  margin-bottom: 2.5rem;
}

/* Figures break out wider than the text measure. The panel stays light in
   both themes: the figures are line art on white and invert badly. */
.fig {
  width: min(48rem, 100vw - 2.5rem);
  margin: 2.5rem 0 2.5rem 50%;
  transform: translateX(-50%);
}
.fig .panel {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
}
.fig img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}
.fig figcaption {
  font-family: var(--sans);
  font-size: 0.84375rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 0.8rem;
  padding: 0 0.15rem;
}
.fig figcaption b {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 34rem) {
  .fig .panel { padding: 0.9rem; border-radius: 4px; }
}

.keypoints {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.keypoints li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.7rem;
  line-height: 1.6;
}
.keypoints li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.72em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
}

details.bib {
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}
details.bib summary {
  font-family: var(--sans);
  font-size: 0.84375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
details.bib summary::-webkit-details-marker { display: none; }
details.bib summary::before { content: "+ "; color: var(--accent); }
details.bib[open] summary::before { content: "\2212 "; }
details.bib summary:hover { color: var(--accent); }
details.bib pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  background: var(--surface);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1rem 0 0;
  color: var(--text);
}

/* link through to a paper page from a publication entry */
.pub .readmore {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--accent);
  white-space: nowrap;
}
