@import url("prism.css");
@import url("fonts/all.css");

:root {
  --color-primary: hsl(3deg 39% 47%);
  --color-foreground: hsl(73deg 12% 14%);
  --color-foreground-light: hsl(73deg 12% 86.7%);
  --color-region: hsl(33deg 31% 67%);
  --color-region-light: hsl(32.6deg 29.4% 86.7%);
  --color-secondary: hsl(7deg 32% 31%);
  --color-heading: hsl(73deg 12% 14%);
  --color-background: hsl(30deg 15% 95%);
  --color-highlight: hsl(50deg 100% 50%);
  --header-nav-bg: var(--color-primary);
  --header-nav-color: var(--color-foreground-light);
  --link-color: var(--color-secondary);
  --visited-link-color: #b10dc9;
  --pull-bg: var(--color-region);
  --pull-color: var(--color-foreground);
  --content-width: max(50rem, 40vw);
  --txt-line-height: 1.7;
  --text-size: 120%;
  --background-color: #fff;
  --color: #000;
  --mark-background-color: var(--color-highlight);
  --mark-color: #000;
  --heading-size: 2.75rem;
  --sequoia-accent-color: var(--color-primary);
  --sequoia-fg-color: var(--color-foreground);
  --sequoia-bg-color: var(--color-background);
  --sequoia-border-color: var(--color-region);
  --sequoia-secondary-color: var(--color-secondary);
  --sequoia-border-radius: 0.25rem;
}

@media screen and (width >=60rem) {
  :root {
    --content-width: max(60rem, 40vw);
    --text-size: 140%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color: #fff;
    --background-color: #000;
    --color-secondary: hsl(7deg 42% 70%);
  }
}

h1 {
  font-size: var(--heading-size);
  letter-spacing: -0.1rem;
}

header>nav {
  display: flex;
  align-items: center;
  min-height: 4.5rem;
  background: var(--header-nav-bg);
  color: var(--header-nav-color);
  margin: 1rem auto 0.5rem;
  padding: 1rem;
  border-radius: 0.25rem;
  max-width: 90vw;
}

aside.thanks>a {
  color: inherit;
}

header>nav a:first-of-type {
  font-weight: bolder;
  width: 100%;
  text-decoration: none;
}

header>nav a:first-of-type .u-photo {
  height: 2rem;
  width: 2rem;
  margin-right: 0.5rem;
}

header>nav a>span {
  width: 100%;
}

header>nav a {
  color: var(--header-nav-color);
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem;
}

header>nav a:visited {
  color: var(--header-nav-color);
}

@media screen and (width <=40rem) {
  header>nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  header>nav a:first-of-type {
    font-size: larger;
    text-align: center;
  }
}

main {
  flex-grow: 3;
}

footer {
  --bg: var(--color-region);
  --color: var(--color-foreground);
  padding: 1rem;
  align-items: center;
  background: var(--bg);
  color: var(--color);
  margin-top: 2rem;
}

main+footer,
header>nav {
  border-top: 0.5rem solid var(--color-foreground);
}

footer a:visited {
  color: inherit;
}

footer>p:nth-of-type(2) picture {
  width: 1.25rem;
  display: inline;
  vertical-align: middle;
  margin: 0 0.25rem;
  margin-top: -1rem;
  overflow: auto;
}

footer picture>img {
  vertical-align: middle;
  margin: 0;
  width: 1.5rem;
  height: 1.5rem;
  max-width: initial;
  display: inline-block;
}

ul {
  list-style: square;
  max-width: calc(var(--content-width) * 0.9);
  margin: 1rem auto;
}

mark {
  background-color: var(--mark-background-color);
  color: var(--mark-color);
  padding: 0.125rem;
}

@media screen and (width >=120rem) {
  main {
    max-width: 120rem;
    margin: 0 auto;
  }
}

main p a:not([class]),
main li a:not([class]) {
  color: var(--link-color);
}

figure>picture,
figure>video {
  margin: 0 auto;
}

figure>picture+figcaption,
figure>.embed+figcaption,
figure>video+figcaption {
  font-style: oblique;
  max-width: calc(var(--content-width) * 0.75);
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

pre[class*="language-"] {
  width: 100%;
  margin: 0.5rem 0;
}

@media screen and (width >=120rem) {
  pre[class*="language-"] {
    max-width: var(--content-width);
  }
}

pre>code {
  display: inline-block;
  background-color: black;
  font-size: 120%;
  color: white;
  width: 100%;
  overflow-x: scroll;
  padding: 1rem;
}

video {
  width: 100%;
  max-width: 60rem;
}

article.h-entry>footer {
  margin: 1rem auto;
  font-size: large;
  max-width: var(--content-width);
}

article.h-entry>footer p {
  margin: 0;
  padding: 1rem;
  max-width: var(--content-width);
  line-height: 1.5;
}

article.h-entry>footer a {
  color: inherit;
}

p a {
  word-wrap: break-word;
}

@media print {

  body>header,
  aside.thanks,
  body>footer {
    display: none;
  }

  main {
    margin: 0;
    padding: 0;
  }
}

.text-post-media,
.mastodon-embed {
  display: block;
  border: none;
  margin: 0.5rem auto !important;
  width: min(100%, 35rem);
}

p>sup.footnote-ref,
a.footnote-backref {
  font-size: small;
  color: var(--link-color);
  text-decoration: none;
}

figure>picture:nth-child(n + 1) {
  margin-bottom: 0.25rem;
}

picture>img {
  margin: 0 auto;
  height: min-content;
}

@media screen and (width <=40rem) {
  :root {
    --txt-line-height: 1.4;
    --content-width: max(40rem, 90vw);
  }

  picture>img {
    width: 100%;
  }
}

p,
dd,
dt,
li {
  max-width: var(--content-width);
  font-family: var(--font-sans);
}

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

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

p+hr {
  margin: 2rem 0;
  max-width: var(--content-width);
}

article.h-entry,
article.h-resume,
article.h-feed {
  margin: 1rem auto;
  padding: 0 1rem;
}

article.h-entry>header,
article.h-feed>header {
  margin: 0 auto;
  width: 100%;
  max-width: 70rem;
}

article.h-entry>header>aside {
  text-align: center;
}

article.h-entry h1.p-name,
article.h-feed h1.p-name {
  margin-bottom: 1rem;
  font-size: calc(var(--heading-size) * 1.2);
  letter-spacing: -0.1rem;
  text-align: center;
  width: 100%;
}

article.h-entry>header>h1+h2 {
  margin-bottom: 1rem;
}

.h-entry .e-content,
.h-feed>section {
  max-width: var(--content-width);
  margin: 0 auto;
}

article.h-entry>section>blockquote>p:first-of-type {
  margin: 0;
}

article.h-entry>section>blockquote {
  max-width: var(--content-width);
  line-height: var(--txt-line-height);
  padding: 1.5rem;
  font-size: 125%;
  background: var(--pull-bg);
  color: var(--pull-color);
  margin: 1rem 0;
}

article.h-entry>section>blockquote a {
  color: var(--pull-color);
}

#audio {
  margin: 1rem auto;
  width: 100%;
  max-width: 40rem;
  text-align: center;
}

#audio>audio {
  width: 100%;
}

article.h-entry>section>p,
article.h-entry>section>li,
article.h-entry>section>dd,
article.h-entry>section>dt,
article.h-entry>section>dl,
article.h-entry>section>ul,
article.h-entry>section>ol,
artice.h-entry section.footnotes {
  max-width: var(--content-width);
  line-height: var(--txt-line-height);
  font-size: var(--text-size);
  text-align-last: left;
  word-wrap: break-word;
}

@media screen and (width <=40rem) {
  article.h-entry {
    margin: 1rem 0;
  }

  article.h-entry>header {
    max-width: 100vw;
    width: 100%;
    margin: 0;
  }

  #audio>audio {
    width: 100%;
  }

  article.h-entry picture>img {
    max-width: var(--content-width);
    width: 100%;
  }
}

@media print {
  .print-hide {
    display: none;
  }
}

aside.thanks {
  padding: 1rem;
  color: var(--pull-color);
  background-color: var(--pull-bg);
  max-width: var(--content-width);
  margin: 0 auto;
}

/** nabbed from https://piccalil.li/blog/a-more-modern-css-reset/ */

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

/* Prevent font size inflation */
html {
  text-size-adjust: none;
  color: var(--color);
  background-color: var(--background-color);
  border-top: 0.5rem solid var(--header-nav-bg);
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
ul,
ol,
li,
dd {
  margin-block-end: 0;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;

  /** my tweaks */
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-content: center;
  font-family: var(--font-family);
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentcolor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

figure {
  margin-inline: 0;
}

iframe.bandcamp-player {
  width: 70%;
  display: block;
  height: calc((120 / 16) * 1rem);
  margin: 0.5rem auto;
  border: 0;
}

/* ---- Archive listings (essays, links, weeknotes) ---- */

.archive {
  max-width: var(--content-width);
  margin: 0 auto;
}

.archive-year+.archive-year {
  margin-top: 3.5rem;
}

.archive-year-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 2.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid var(--color-primary);
}

.archive-year-heading>a {
  color: inherit;
  text-decoration: none;
}

.archive-year-count {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: normal;
  letter-spacing: 0;
  color: var(--color-secondary);
}

.archive-month {
  margin-top: 1.5rem;
}

.archive-month-heading {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.archive-list {
  list-style: none;
  max-width: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.archive-list>li {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  max-width: none;
  padding: 0.3rem 0;
}

.archive-list>li+li {
  border-top: 1px solid var(--color-region);
}

.archive-list time {
  flex: none;
  width: 2ch;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-secondary);
}

/* Entries carrying a thumbnail need to stack rather than sit on one baseline. */
.archive-list-rich>li {
  align-items: flex-start;
  padding: 0.6rem 0;
}

.archive-list-rich time {
  margin-top: 0.2rem;
}

.archive-entry {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.archive-thumb,
.archive-thumb picture {
  display: block;
  line-height: 0;
}

.archive-thumb picture>img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 20rem;
  margin: 0;
  border-radius: 0.35rem;
}

/* Weeknotes are date-only, so they read better as a wrapped run of links. */
.archive-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  list-style: none;
  max-width: none;
  margin: 1rem 0 0;
  padding: 0;
}

.archive-dates>li {
  max-width: none;
}

.archive-dates a {
  display: block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-region);
  border-radius: 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  text-decoration: none;
}

.archive-dates a:hover,
.archive-dates a:focus-visible {
  border-color: var(--color-primary);
  background-color: var(--color-region-light);
  color: var(--color-foreground);
}

@media screen and (width >=60rem) {

  /* Float the month label into the left gutter so titles form one
     continuous column down the year. */
  .archive-month {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0 1.5rem;
    margin-top: 1.25rem;
  }

  .archive-month-heading {
    margin-top: 0.4rem;
    text-align: right;
  }

  .archive-month>.archive-list {
    margin-top: 0;
  }
}

bluesky-post {
  margin: 0 auto;
}
