/* ---------------------------------------------------------------
   bwuebben.github.io — base stylesheet
   Shared by the landing page and any sub-pages added later.
   --------------------------------------------------------------- */

:root {
  --bg:         #fbfaf8;
  --bg-panel:   #f3f1ec;
  --ink:        #1c1b19;
  --ink-soft:   #55524c;
  --ink-faint:  #86827a;
  --rule:       #ddd9d1;
  --accent:     #7a2e2e;
  --accent-lit: #a04040;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #16161a;
    --bg-panel:   #1e1e23;
    --ink:        #e7e4de;
    --ink-soft:   #a9a49b;
    --ink-faint:  #7c776e;
    --rule:       #2e2e35;
    --accent:     #d98a8a;
    --accent-lit: #eaa3a3;
  }
}

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

img, svg, video { max-width: 100%; height: auto; }
figure { margin: 0; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { color: var(--accent-lit); border-bottom-color: currentColor; }

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

header.masthead { margin-bottom: 3.25rem; }

/* the floated portrait is taller than the text beside it on wide screens,
   so the masthead has to contain its own float */
header.masthead::after { content: ""; display: block; clear: both; }

/* --- portrait ---------------------------------------------------- */

.portrait {
  float: right;
  width: 12rem;
  margin: 0.35rem 0 1.1rem 2.25rem;
}

/* the portrait opens full size in a new tab; zoom-in is the only
   affordance telling a visitor it is clickable at all */
.portrait a {
  display: block;
  border-bottom: none;
  cursor: zoom-in;
}
.portrait a:hover { border-bottom: none; }
.portrait a:hover img { opacity: 0.9; }
.portrait a:focus-visible img { outline: 2px solid var(--accent); outline-offset: 3px; }

.portrait img {
  transition: opacity 0.18s ease;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 22%;   /* hold the face just above centre */
  border-radius: 2px;
  background: #0d0d0f;        /* matches the photo's own falloff */
  box-shadow:
    0 1px 2px rgba(20, 18, 15, 0.10),
    0 10px 26px -8px rgba(20, 18, 15, 0.26);
}

@media (prefers-color-scheme: dark) {
  .portrait img {
    box-shadow: none;
    outline: 1px solid var(--rule);
    outline-offset: -1px;
  }
}

h1 {
  font-size: 2.05rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 0.55rem;
}

.tagline {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.lede { margin: 0; color: var(--ink-soft); }
.lede + .lede { margin-top: 0.9rem; }

/* --- epigraph ---------------------------------------------------- */

.epigraph {
  margin: 4.25rem auto 0.5rem;
  max-width: 33rem;
  padding: 0.7rem 0;
  font-size: 1.42rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
  text-wrap: balance;
}

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

section { margin-top: 3.25rem; }

h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin: 2rem 0 0.9rem;
}
h3:first-of-type { margin-top: 0; }

/* --- entry list (papers, projects) ------------------------------ */

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

ul.entries > li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
ul.entries > li:last-child { border-bottom: none; }

.entry-title { display: block; font-size: 1.02rem; line-height: 1.4; }
.entry-title a { color: var(--ink); }
.entry-title a:hover { color: var(--accent); }

.entry-note {
  display: block;
  margin-top: 0.28rem;
  font-family: var(--sans);
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 34rem;
}

.entry-note a { color: var(--ink-soft); }

/* an identifier must never break across lines at its colon or dot */
.entry-note a[href*="arxiv.org"] { white-space: nowrap; }
.entry-note a:hover { color: var(--accent); }

/* --- research areas --------------------------------------------- */

.areas { margin: 0; padding: 0; list-style: none; }
.areas li { padding: 0.4rem 0 0.4rem 1.1rem; position: relative; color: var(--ink-soft); }
.areas li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}
.areas strong { color: var(--ink); font-weight: 600; }

/* --- contact ---------------------------------------------------- */

.contact {
  font-family: var(--sans);
  font-size: 0.92rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* flex, not inline-block, so a long value wraps aligned under itself
   rather than running back under the label */
.contact li {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
}
.contact .label {
  flex: 0 0 6rem;
  color: var(--ink-faint);
}

/* arXiv category names contain hyphens and dots; without this a line break
   can land inside one, e.g. "q-" / "fin.PM" */
.contact .cat { white-space: nowrap; }

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

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

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

@media (max-width: 46rem) {
  .portrait { float: none; width: 10.5rem; margin: 0 0 1.6rem; }
}

@media (max-width: 34rem) {
  .epigraph {
    padding: 0.5rem 0;
    font-size: 1.15rem;
  }

  body { font-size: 17px; }
  .wrap { padding: 3rem 1.15rem 3.5rem; }
  h1 { font-size: 1.7rem; }
  .contact li { display: block; }
  .contact .label { display: block; }
}


/* ==================================================================
   Poem page — /poem.html
   Mirrors the LaTeX source: narrow measure, Palatino, 1.5 leading,
   ragged right, centred title in small caps, diamond dividers, and
   KaTeX-typeset display math with an italic caption beneath.
   ================================================================== */

:root {
  --poem-title:   #1a1a1a;
  --poem-body:    #2c2c2c;
  --poem-rule:    #aaaaaa;
  --poem-math:    #444444;
  --poem-caption: #777777;
  /* the LaTeX loads palatino; keep it first here even though the site
     stack leads with Iowan Old Style */
  --poem-serif: Palatino, "Palatino Linotype", "Book Antiqua",
                "Iowan Old Style", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --poem-title:   #ece9e3;
    --poem-body:    #d6d2ca;
    --poem-rule:    #4c4c55;
    --poem-math:    #c8c4bc;
    --poem-caption: #8b867d;
  }
}

.wrap.poem {
  max-width: 31rem;
  padding: 4rem 1.5rem 5rem;
  font-family: var(--poem-serif);
  color: var(--poem-body);
  font-size: 1.12rem;
  line-height: 1.5;
}

.poem-title {
  margin: 0 0 2.75rem;
  text-align: center;
  font-family: var(--poem-serif);
  font-size: 2.1rem;
  font-weight: 400;
  font-variant-caps: small-caps;
  letter-spacing: 0.05em;
  color: var(--poem-title);
}

.stanza {
  margin: 0;
  text-align: left;   /* \raggedright */
  text-wrap: initial;
}

.stanza + .stanza { margin-top: 1.5rem; }
.coda { margin-top: 1.75rem; }

/* --- divider: rule, diamond, rule --- */

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.9rem 0;
  color: var(--poem-rule);
}
.divider span {
  display: block;
  width: 5.5rem;
  height: 1px;
  background: currentColor;
}
.divider i { font-style: normal; font-size: 0.8em; line-height: 1; }

/* --- display math + caption --- */

.pmath {
  margin: 1.6rem 0;
  color: var(--poem-math);
}

.pmath .katex-display { margin: 0; }
.pmath .katex { font-size: 1.12em; }

.pcaption {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--poem-caption);
}

/* --- back link --- */

.poem-back {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
}
.poem-back a { color: var(--ink-faint); }
.poem-back a:hover { color: var(--accent); }

/* --- the epigraph on the index links here --- */

.epigraph a {
  color: inherit;
  border-bottom: none;
  transition: color 0.15s ease;
}
.epigraph a:hover { color: var(--accent); border-bottom: none; }

@media (max-width: 34rem) {
  .wrap.poem { padding: 2.75rem 1.15rem 3.5rem; font-size: 1.05rem; }
  .poem-title { font-size: 1.7rem; margin-bottom: 2rem; }
  .divider span { width: 3.5rem; }
  /* a long display formula must scroll in its own box, never the page */
  .pmath { overflow-x: auto; }
}
