/* Site styles. Originally based on the Gruvhugo Hugo theme
   (GPL-3.0, https://gitlab.com/avron/gruvhugo). */

/* ---- Colours ------------------------------------------------------------ */

:root {
  --bg: #121212;
  --text: #e6e3de;
  --muted: #9a958d;
  --rule: #2c2c2c;
  --panel: #1b1b1b;
  --accent: #74b3f5;
  --accent-soft: rgba(116, 179, 245, 0.35);

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 40rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfaf7;
    --text: #1f1d1a;
    --muted: #6b665e;
    --rule: #e4e0d8;
    --panel: #f2efe8;
    --accent: #1f62b8;
    --accent-soft: rgba(31, 98, 184, 0.3);
  }
}

/* ---- Base --------------------------------------------------------------- */

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

html {
  font-size: 112.5%; /* 18px */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

.main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

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

/* ---- Header ------------------------------------------------------------- */

.title {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.name h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.plain {
  color: inherit;
  text-decoration: none;
}

/* ---- Home --------------------------------------------------------------- */

.intro {
  display: flex;
  flex-direction: column;
}

.image {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 50%;
  margin: 1rem 0 1.5rem;
}

.intro > p {
  font-size: 1.35rem;
  line-height: 1.45;
  text-align: center;
  margin: 0;
}

/* ---- Page and post headers --------------------------------------------- */

.post-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.go-back {
  color: var(--muted);
  text-decoration: none;
  flex: none;
  transform: translateY(0.15em);
}

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

.go-back svg {
  height: 1.1rem;
  width: auto;
}

.post-title {
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: break-word;
}

.post-dets,
.well h4 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.intro > .post-dets {
  margin: 0.9rem 0 2.25rem;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: left;
}

/* ---- Post body ---------------------------------------------------------- */

.content > p:first-child {
  margin-top: 0;
}

.content h4 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.5rem;
}

blockquote {
  margin: 1.75rem 0;
  padding: 0.1rem 0 0.1rem 1.25rem;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
  font-style: italic;
}

blockquote p {
  margin: 0.5rem 0;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.3rem;
}

table.figures {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

table.figures td {
  width: 50%;
  padding: 0 0.4rem;
  vertical-align: top;
  text-align: center;
}

table.figures tr + tr td {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.4rem;
}

table.figures img {
  display: block;
  border-radius: 3px;
}

/* ---- Post list ---------------------------------------------------------- */

.post-header + p {
  color: var(--muted);
  margin: 0.9rem 0 2rem;
}

.post-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.well h3 {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
}

.well h3 a {
  color: var(--text);
  text-decoration: none;
}

.well h3 a:hover {
  color: var(--accent);
}

.well h4 {
  margin: 0 0 0.6rem;
}

.well p {
  margin: 0;
}

/* ---- 404 ---------------------------------------------------------------- */

.not-found {
  font-size: 2.5rem;
  text-align: center;
  margin: 2rem 0 0.5rem;
}

.intro .not-found + p {
  font-size: 1rem;
}

/* ---- Footer ------------------------------------------------------------- */

#footer {
  margin-top: auto;
  padding: 3rem 0 2.5rem;
}

.social {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.social a {
  color: var(--muted);
  text-decoration: none;
}

.social a:hover {
  color: var(--accent);
}

.social svg {
  width: 20px;
  height: 20px;
}

/* ---- Code --------------------------------------------------------------- */

pre,
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--panel);
}

code {
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

pre {
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  padding: 0;
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 600px) {
  html {
    font-size: 106.25%; /* 17px */
  }
  .title {
    padding-top: 1.25rem;
    margin-bottom: 1.75rem;
  }
  .post-title {
    font-size: 1.65rem;
  }
  .intro > p {
    font-size: 1.2rem;
  }
}
