/* ----------------------------------------------------------
   Inspired by the excellent stylesheet used by Anatoliy Babushka.
   ---------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&display=swap');

/* ----------------------------------------------------------
   A Modern CSS Reset by Joshua Comeau.
   ---------------------------------------------------------- */
/* Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* Increase line-height */
  line-height: 1.5;
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/* Create a root stacking context */
#root, #__next {
  isolation: isolate;
}

/* Enable page fade transitions */
@view-transition {
  navigation: auto;
}

/* ----------------------------------------------------------
   Design tokens
   ---------------------------------------------------------- */
:root {
    --bg:   #fcfcfc;
    --text:  #1a1a1a;
    --muted: #4c4c4c;
    --line: #dcdcd6;
    --accent: #0b85cc;

    --serif: 'Merriweather', 'Times New Roman', Times, serif;
    --sans: 'Inter', Tahoma, Geneva, Verdana, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Monaco, 'Liberation Mono', monospace;
}

/* ----------------------------------------------------------
   Header
   ---------------------------------------------------------- */
header {
    border-block-end: 1px solid var(--line);
    padding-block: 1.25rem;
}

header nav a {
    text-decoration: none;
    font-family: var(--sans);
    font-weight: 500;
}

.logo {
    color: var(--accent);
    font-size: 28px;
    font-weight: 700;
    padding-inline-end: 8px;
}

/* ----------------------------------------------------------
   Main content
   ---------------------------------------------------------- */
main {
    padding-block: 3rem 2rem;
}

/* ----------------------------------------------------------
   Prose width
   ---------------------------------------------------------- */
.prose {
    max-width: 65ch;
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 28px);
}

/* ----------------------------------------------------------
   Typography
   ---------------------------------------------------------- */
body {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    text-align: left;
}

/* ----------------------------------------------------------
   Headings
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 { font-size: 2rem;    margin-block-start: 2.5rem; }
h2 { font-size: 1.5rem;  margin-block-start: 2rem; }
h3 { font-size: 1.25rem; margin-block-start: 1.75rem; }
h4 { font-size: 1.125rem; margin-block-start: 1.5rem; }

/* First heading in a page section needs no top gap */
h1:first-child,
h2:first-child,
h3:first-child {
    margin-block-start: 0;
}

/* ----------------------------------------------------------
   Paragraphs & prose spacing
   ---------------------------------------------------------- */
p {
    margin-block: 1em;
}

p:last-child {
    margin-block-end: 0;
}

/* ----------------------------------------------------------
   Links
   ---------------------------------------------------------- */
a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-thickness: 2px;
}

a:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ----------------------------------------------------------
   Lists
   ---------------------------------------------------------- */
ul,
ol {
    padding-inline-start: 1.4em;
    margin-block: 1em;
}

li {
    margin-block: 0.35em;
}

li:last-child {
    margin-block-end: 0;
}

/* ----------------------------------------------------------
   Blockquote
   ---------------------------------------------------------- */
blockquote {
    border-inline-start: 3px solid var(--line);
    margin-inline: 0;
    margin-block: 1.5em;
    padding-inline-start: 1.25em;
    color: var(--muted);
    font-style: italic;
}

blockquote p {
    margin-block: 0.5em;
}

/* ----------------------------------------------------------
   Code
   ---------------------------------------------------------- */
code,
kbd,
samp {
    font-family: var(--mono);
    font-size: 0.875em;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15em 0.35em;
    border-radius: 3px;
}

pre {
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.55;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.1em 1.25em;
    overflow: auto;
    margin-block: 1.5em;
    -webkit-overflow-scrolling: touch;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* ----------------------------------------------------------
   Horizontal rule
   ---------------------------------------------------------- */
hr {
    border: none;
    border-block-start: 1px solid var(--line);
    margin-block: 2.5em;
}

/* Selection colour */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* ----------------------------------------------------------
   Classes
   ---------------------------------------------------------- */

.avatar {
    border-radius: 9999px;
    width: 120px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.date {
    font-size: 16px;
    margin-block: 0.5em 2em;
    color: var(--muted);
}