/* ==========================================================
   LaTeX-style stylesheet, v3
   Font: Latin Modern (the web version of Computer Modern).
   We import latex.css, which defines the "Latin Modern"
   @font-face rules, then apply our own layout below.
   ========================================================== */

@import url('https://latex.now.sh/style.css');

/* Neutralize latex.css's page layout (we use .page instead) */
body {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ---------- Base ---------- */
:root {
  --text: #1a1a1a;
  --muted: #555;
  --rule: #1a1a1a;
  --link: #a00;              /* classic hyperref dark red */
  --paper: #fffefb;          /* faint warm paper tone */
  --box: #fbf9f4;
}

* { box-sizing: border-box; }

html { font-size: 18px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--text);
  font-family: 'Latin Modern', 'Computer Modern Serif', Georgia, 'Times New Roman', serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 46rem;              /* ~ \textwidth of an article */
  margin: 0 auto;
  padding: 3rem 1.25rem 3rem;
  counter-reset: sec;
}

/* ---------- Headings ---------- */
h1, h2, h3 {
  font-weight: bold;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h1 { font-size: 1.9rem; text-align: center; margin-bottom: 0.75rem; }

h2 {
  font-size: 1.35rem;
  margin-top: 2.4rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--rule);   /* full-width ruled section headers */
}

/* Numbered sections, like an article */
.page > section:not(.abstract) { counter-increment: sec; }
.page > section:not(.abstract) > h2::before { content: counter(sec) '.\2002'; }

h3 { font-size: 1.05rem; margin-top: 1.35rem; }

/* ---------- Hero ---------- */
.hero { text-align: center; }

.welcome {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.links { margin: 0.5rem 0 0.75rem; }
.links a { margin: 0 0.4rem; white-space: nowrap; }
.links a::before { content: '['; color: var(--muted); }
.links a::after  { content: ']'; color: var(--muted); }

.email, .updated {
  margin: 0.1rem 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- Portrait figure ---------- */
.portrait {
  margin: 1.5rem auto 0.25rem;
}
.portrait img {
  max-width: min(300px, 70vw);
  height: auto;
  border: 1px solid #ccc;
  padding: 4px;               /* \fbox feel */
  background: #fff;
}
.portrait figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.45rem;
  font-style: italic;
}

/* ---------- Abstract ---------- */
.abstract {
  margin: 1.9rem 0 0;
  text-align: justify;
  hyphens: auto;
}
.abstract h2 {
  border: none;
  text-align: center;
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}
.abstract p {
  font-size: 0.97rem;
  margin: 0 0 0.75rem;
}
.abstract .keywords {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: left;
}

/* ---------- Table of contents nav ---------- */
.toc {
  margin: 2rem 0 0.5rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.03em;
}
.toc a { margin: 0 0.5rem; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- Body sections ---------- */
section p {
  margin: 0.4rem 0 0.9rem;
  text-align: justify;
  hyphens: auto;
}

.paper { margin-bottom: 1.45rem; }
.paper h3 { margin-bottom: 0.15rem; }
.paper .meta {
  font-style: italic;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.3rem;
  text-align: left;
}
.paper .authors {
  font-size: 0.95rem;
  margin: 0 0 0.3rem;
  text-align: left;
}
.paper p { margin: 0.25rem 0; }

/* ---------- Links ---------- */
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Contact form ---------- */
#contact form {
  display: grid;
  gap: 0.8rem;
  max-width: 30rem;
  margin: 1rem 0;
}
#contact label { display: grid; gap: 0.25rem; font-size: 0.95rem; }
#contact input,
#contact textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #999;
  border-radius: 2px;
  background: #fff;
  color: var(--text);
}
#contact input:focus,
#contact textarea:focus { outline: none; border-color: var(--link); }
#contact button {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  justify-self: start;
}
#contact button:hover { background: #f2f2f2; }

/* ---------- Colophon ---------- */
.colophon {
  margin-top: 3rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  html { font-size: 16.5px; }
  .page { padding: 2rem 1rem 2.5rem; }
  .toc a { margin: 0 0.3rem; }
  .abstract, section p { text-align: left; }
}
