/* brianburke.net: one stylesheet. White page, black text, one grey for quiet text, one hairline,
   and one accent (Creosote forest) on link underlines and the short rule. Avenir throughout. */

:root {
  --bg: #ffffff;
  --text: #111111;
  --strong: #000000;
  --muted: #6b6b6b;
  --rule: #e6e6e6;
  --accent: #3a5d44;
  --sans: "Avenir Next", Avenir, "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #eeeeee;
    --strong: #ffffff;
    --muted: #9b9b9b;
    --rule: #2e2e2e;
    --accent: #8fae99;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  font-weight: 400;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  box-sizing: content-box;
  max-width: 36rem;
  margin: 0 auto;
  padding: 14vh 24px 0;
}

@media (max-width: 640px) {
  .wrap {
    padding-top: 9vh;
  }
}

/* Links: text colour, a 1px forest underline that turns solid text colour on hover. */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--strong);
  text-decoration-color: currentColor;
}

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

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

strong {
  font-weight: 600;
}

p {
  margin: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
}

time {
  font-variant-numeric: tabular-nums;
}

/* Back link above a page title. The arrow sits outside the underline. */
.back {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
}

.back a {
  text-decoration: none;
}

.back .u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.back .arrow {
  display: inline-block;
  margin-right: 0.4em;
}

/* Home page */
.card h1 {
  font-size: 2.75rem;
  letter-spacing: -0.02em;
}

.place {
  margin-top: 0.35rem;
  color: var(--muted);
}

.line {
  text-wrap: pretty;
  margin-top: 1.75rem;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.line::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin-bottom: 1.75rem;
  background: var(--accent);
}

/* Now: a few lines, one sentence each. */
.now {
  margin-top: 2.5rem;
}

.now ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.now li {
  text-wrap: pretty;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
  line-height: 1.5;
}

.now li:last-child {
  border-bottom: 1px solid var(--rule);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 640px) {
  .card h1 {
    font-size: 2.25rem;
  }

  .line {
    font-size: 1.125rem;
  }
}

/* Latest Reflections: one post, never a list. Not on the page at all when there is none. */
.reflection {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.section {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.reflection .title {
  display: inline-block;
  margin-top: 0.125rem;
  font-size: 1.125rem;
}

.reflection .standfirst {
  margin-top: 0.25rem;
  color: var(--muted);
}

.date,
.meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.date {
  display: block;
}

/* A post */
.meta {
  margin-top: 0.75rem;
}

.lede {
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--muted);
}

.prose {
  margin-top: 2rem;
}

.prose > *,
.prose blockquote > * {
  margin: 0;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose blockquote > * + * {
  margin-top: 0.8em;
}

.prose > h2 {
  margin-top: 2.2em;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.prose > h3 {
  margin-top: 1.8em;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

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

.prose > h2 + *,
.prose > h3 + * {
  margin-top: 0.5em;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.3em;
}

.prose blockquote {
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

.prose > hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose > hr + * {
  margin-top: 0;
}

.prose pre {
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.prose pre code {
  font-size: inherit;
}

footer {
  margin-top: 4rem;
  padding-bottom: 3rem;
  color: var(--muted);
  font-size: 0.8125rem;
}
