/* ── Doodle theme ─────────────────────────────────────────────
   Pen handwriting on a sheet of white paper.
   Text stays Arial; all personality lives in hand-drawn SVG ink:
   squiggle underlines, wavy dividers, a scribbled ellipse around
   the site mark. One accent: ballpoint blue.
   ───────────────────────────────────────────────────────────── */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --pencil: #757575;
  --faint: #9e9e9e;
  --sketch: #cfcfcf;
  --pen-blue: #1d3fbf;
  --measure: 38rem;

  /* hand-drawn ink strokes, drawn inline so there are no assets */
  --squiggle-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M4 8 C 40 2, 80 11, 130 6 S 220 3, 296 7' fill='none' stroke='%23111111' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --squiggle-faint: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 10' preserveAspectRatio='none'%3E%3Cpath d='M2 5 C 30 2, 60 8, 100 5 S 170 2, 220 6 S 270 4, 298 5' fill='none' stroke='%23cfcfcf' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --doodle-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 3 Q 16 20, 12 36 Q 24 24, 38 15 Q 20 13, 3 16 Q 18 25, 30 37 Q 25 19, 21 6' fill='none' stroke='%23111111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --dash-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M3 6 C 18 3, 34 8, 57 5' fill='none' stroke='%23111111' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #dfe6ff; }

a { color: var(--pen-blue); }

a:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 2.75rem, var(--measure));
  margin: 0 auto;
  padding: 3.25rem 0 5rem;
}

/* ── Header: name circled in pen, like a doodle on a notepad ── */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4.25rem;
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--ink);
  text-decoration: none;
}

/* hand-doodled star beside the name */
.site-mark::after {
  content: "";
  width: 1.3rem;
  height: 1.3rem;
  background: var(--doodle-star) no-repeat center / 100% 100%;
  transform: rotate(-8deg);
}

.site-mark:hover { opacity: 0.6; }

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.88rem;
}

.site-nav a {
  color: var(--pencil);
  text-decoration: none;
  padding-bottom: 6px;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--dash-ink) no-repeat bottom center / 100% 7px;
}

/* ── Type ── */

.page-label {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* the signature: a hand-drawn ink squiggle under every page title */
h1::after {
  content: "";
  display: block;
  width: min(11rem, 60%);
  height: 11px;
  margin-top: 0.5rem;
  background: var(--squiggle-ink) no-repeat center / 100% 100%;
}

h2 {
  margin: 2.25rem 0 0.6rem;
  font-size: 1.3rem;
  font-weight: bold;
  line-height: 1.3;
}

h3 {
  margin: 1.75rem 0 0.45rem;
  font-size: 1.05rem;
  font-weight: bold;
}

.lede {
  margin: 0 0 3.25rem;
  max-width: 32rem;
  color: var(--pencil);
  font-size: 1.02rem;
}

.meta {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ── Publication list: entries separated by wavy pencil lines ── */

.pub-list {
  display: flex;
  flex-direction: column;
}

.pub { padding: 1.8rem 0; }

.pub + .pub::before {
  content: "";
  display: block;
  height: 9px;
  margin: 0 0 1.8rem;
  background: var(--squiggle-faint) no-repeat center / 100% 100%;
}

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

.pub h2 {
  margin: 0;
  font-size: 1.3rem;
}

.pub h2 a {
  color: var(--ink);
  text-decoration: none;
}

.pub h2 a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}

.pub .summary {
  margin: 0.6rem 0 0;
  color: var(--pencil);
  font-size: 0.95rem;
  line-height: 1.6;
}

.pub .links {
  display: flex;
  gap: 1.15rem;
  margin: 0.9rem 0 0;
  font-size: 0.84rem;
}

.pub .links a {
  color: var(--pen-blue);
  text-decoration: none;
}

.pub .links a::after { content: " \2197"; /* ↗ pen flick */ }

.pub .links a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 0.3em;
}

/* ── Article body ── */

article .summary {
  margin: 0 0 1.9rem;
  color: var(--pencil);
  font-size: 1.05rem;
  line-height: 1.6;
}

article p {
  margin: 0 0 1.15rem;
  max-width: var(--measure);
}

article a {
  color: var(--pen-blue);
  text-decoration: underline;
  text-decoration-color: #b9c4ee;
  text-underline-offset: 0.2em;
}

article a:hover {
  text-decoration-style: wavy;
  text-decoration-color: var(--pen-blue);
}

article blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  color: var(--pencil);
  border-left: 2px dashed var(--sketch);
}

article ul, article ol { padding-left: 1.4rem; }

article li { margin-bottom: 0.35rem; }

article code {
  font-family: "Courier New", monospace;
  font-size: 0.92em;
  background: #f4f4f4;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

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

article hr {
  border: none;
  height: 9px;
  margin: 2.5rem 0;
  background: var(--squiggle-faint) no-repeat center / 100% 100%;
}

/* ── Embedded PDF pane: sheet of paper pinned into the page ── */

.pdf-pane {
  margin: 2.25rem 0 0.5rem;
}

.pdf-pane object {
  display: block;
  width: 100%;
  height: 78vh;
  border: 2px dashed var(--sketch);
  background: var(--paper);
}

.pdf-alt {
  margin: 0.6rem 0 0;
  font-size: 0.84rem;
}

.pdf-alt a {
  color: var(--pen-blue);
  text-decoration: none;
}

.pdf-alt a::after { content: " \2197"; }

.pdf-alt a:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 0.3em;
}

.back {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: var(--pencil);
  text-decoration: none;
}

.back:hover { color: var(--ink); }

/* ── Footer ── */

.site-footer {
  margin-top: 5rem;
  padding-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--faint);
  background: var(--squiggle-faint) no-repeat top left / min(9rem, 50%) 8px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: wavy;
}

.empty {
  color: var(--pencil);
  font-style: italic;
}

@media (max-width: 640px) {
  .wrap { padding: 2rem 0 3.5rem; }
  .site-header { margin-bottom: 3rem; }
  h1 { font-size: 1.8rem; }
  .lede { margin-bottom: 2.25rem; }
  .pdf-pane object { height: 65vh; }
}
