/* Inter variable, self-hosted from @fontsource-variable/inter (copied by build.ts). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin-opsz-normal.woff2) format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin-ext-opsz-normal.woff2) format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin-opsz-italic.woff2) format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --rule: #e6e6e6;
  --code-bg: #f6f6f6;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1c;
    --fg: #ededed;
    --muted: #8f8f8f;
    --rule: #2e2e2e;
    --code-bg: #242424;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 3rem 1rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font:
    1rem/1.6 "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

.muted {
  color: var(--muted);
}

/* Header */

.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin-bottom: 3.5rem;
}

/* Inter Display cut (opsz 32): tighter, narrower letterforms for the name. */
.name {
  font-size: 1.25rem;
  font-weight: 650;
  font-variation-settings: "opsz" 32;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.top nav a {
  display: flex;
  color: var(--muted);
}

.top nav a:hover {
  color: var(--fg);
}

/* 16px keeps the 448/512-wide glyphs at whole-pixel widths (14px, 16px), so they stay sharp. */
.top nav svg {
  height: 16px;
  width: auto;
  fill: currentColor;
}

/* Home */

/* Everything is 14px except the intro and post bodies. */
main {
  font-size: 0.875rem;
}

.intro,
article {
  font-size: 1rem;
}

section + section {
  margin-top: 3rem;
}

h2 {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

ul.posts,
ul.work {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.posts li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  padding: 0.35rem 0;
}

ul.posts a {
  text-decoration: none;
}

ul.posts a:hover {
  text-decoration: underline;
}

ul.work li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
}

.period {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

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

/* Post */

article h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

article h1 + p {
  margin-top: 0;
  margin-bottom: 2rem;
}

article h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
}

article h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
}

article a {
  overflow-wrap: anywhere;
}

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

article blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--code-bg);
}

pre.shiki {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 6px;
  background-color: var(--code-bg) !important;
  font-size: 0.875rem;
  line-height: 1.5;
}

pre.shiki span {
  color: var(--shiki-light);
}

@media (prefers-color-scheme: dark) {
  pre.shiki span {
    color: var(--shiki-dark);
  }
}

/* Footer */

footer {
  display: flex;
  gap: 1.25rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}
