/* ---------------------------------------------------------------------------
   Ben Prystawski — personal site
   A GeoCities-style homepage in an "old library" palette: a tiled starry
   wallpaper on parchment behind one centred cream page with a double brown border, a chunky 3D
   Times title, raised buttons for the nav, and printer's fleurons (❦)
   between sections. Times throughout, Arial for the buttons. One light look only, so there is no dark mode.
   All colours and fonts are tokens on :root.
--------------------------------------------------------------------------- */

:root {
  --parchment: #e6d5ac;
  --page: #fbf4e0;
  --news-bg: #f4e8c6;
  --brown: #7a4a1a;
  --bronze: #b08a4a;
  --gold: #c08a1a;
  --button-top: #fffaf0;
  --button-bottom: #ead9b0;
  --button-border: #d8c08a;
  --ink: #2a1a0e;
  --muted: #6a5a48;
  --maroon: #6a1a10;
  --link: #7a1010;
  --visited: #5a2a5a;

  color-scheme: light;

  --font-body: "Times New Roman", Times, serif;
  --font-ui: Arial, Helvetica, sans-serif;

  --page-width: 700px;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--parchment);
  /* A classic GeoCities wallpaper: one small tile of stars on
     a diamond lattice, repeated so the pattern is plainly visible. */
  background-image: url("/assets/bg-tile.svg");
}

body {
  margin: 0;
  padding: 24px 12px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--visited);
}

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* ----- the page ------------------------------------------------------------ */

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 18px 22px;
  background: var(--page);
  border: 6px double var(--brown);
}

/* ----- header: title, tagline, nav ------------------------------------------ */

.welcome {
  margin: 0;
  text-align: center;
  font: bold 2.5rem/1.15 var(--font-body);
  color: var(--maroon);
  /* Stacked hard shadows give the chunky 3D look. */
  text-shadow:
    1px 1px 0 var(--gold),
    2px 2px 0 var(--gold),
    3px 3px 0 var(--brown),
    4px 4px 0 var(--brown),
    5px 5px 3px rgba(60, 30, 0, 0.35);
}

.welcome a,
.welcome a:visited {
  color: inherit;
  text-decoration: none;
}

.tagline {
  margin: 6px 0 0;
  text-align: center;
  font-style: italic;
  color: var(--maroon);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* Raised buttons that press in when clicked. */
.site-nav a,
.site-nav a:visited {
  padding: 4px 12px;
  font: bold 0.8125rem var(--font-ui);
  color: var(--maroon);
  text-decoration: none;
  background: linear-gradient(var(--button-top), var(--button-bottom));
  border: 3px outset var(--button-border);
}

.site-nav a:hover {
  background: var(--button-top);
}

.site-nav a:active {
  border-style: inset;
}

/* ----- fleuron rules between sections ------------------------------------- */

.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--brown);
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 4px;
  border-top: 1px solid var(--brown);
  border-bottom: 1px solid var(--brown);
}

.rule span {
  font-size: 1.5rem;
  line-height: 1;
}

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

.section-heading {
  margin: 18px 0 10px;
  text-align: center;
  font: bold 1.625rem var(--font-body);
  color: var(--maroon);
}

/* ----- home: bio ------------------------------------------------------------- */

.bio {
  display: flow-root; /* contain the figure if it is ever floated */
}

.bio p {
  margin: 0 0 12px;
}

.bio-figure {
  width: 170px;
  margin: 0 auto 14px;
  text-align: center;
}

.bio-photo {
  display: block;
  width: 100%;
  height: auto;
  border: 7px ridge var(--bronze);
}

/* ----- home: papers ---------------------------------------------------------- */

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.pub {
  position: relative;
  padding-left: 26px;
}

/* A printer's leaf (❧) as each paper's bullet. */
.pub::before {
  content: "\2767";
  position: absolute;
  left: 2px;
  top: -2px;
  font-size: 1.125rem;
  color: var(--brown);
}

.pub-title {
  margin: 0;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.4;
  /* Balanced wrapping (set on h3 above) breaks long titles too early here. */
  text-wrap: wrap;
}

.pub-authors {
  margin: 0;
  font-size: 0.875rem;
}

.pub-me {
  font-weight: bold;
}

.pub-venue {
  margin: 0;
  font-style: italic;
}

.selected-more {
  margin: 14px 0 0;
  text-align: center;
}

/* ----- page headers (404, blog posts) ---------------------------------------- */

.page-header {
  margin: 18px 0 12px;
  text-align: center;
}

.page-title {
  margin: 0 0 6px;
  font: bold 1.75rem var(--font-body);
  color: var(--maroon);
}

.page-note {
  margin: 0;
  color: var(--muted);
}

/* ----- blog ------------------------------------------------------------------ */

.post-entry {
  padding: 12px 0;
}

.post-entry-title {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}

.post-entry-date {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre {
  margin: 0 0 1em;
}

.post-body h2 {
  margin: 1.5rem 0 0.5rem;
  font: bold 1.375rem var(--font-body);
  color: var(--maroon);
}

.post-body h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.125rem;
}

.post-body blockquote {
  padding-left: 1rem;
  border-left: 3px double var(--brown);
  color: var(--muted);
}

.post-body pre {
  padding: 0.75rem 1rem;
  overflow-x: auto;
  background: var(--news-bg);
  border: 2px inset var(--button-border);
  font-size: 0.875rem;
}

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

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

.site-footer {
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.9;
}

.site-footer p {
  margin: 0;
}

.footer-colophon {
  font-size: 0.75rem;
  color: var(--muted);
}

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

@media (max-width: 36rem) {
  body {
    padding: 12px 8px;
  }

  .page {
    padding: 14px;
  }

  .welcome {
    font-size: 1.75rem;
  }
}
