html { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0; /* For height: 100% to work without annoying scroll */
  min-height: 100%;
  padding: 0 1rem;

  font-family: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-weight: 450;
  font-size: 1.125rem;
  -webkit-text-size-adjust: 100%; /* To prevent odd font size changes in landscape Safari on iOS */

  color: rgb(41, 37, 36);
  background-color: rgb(255, 247, 237);
}

h1, h2 {
  font-family: ui-sans-serif, "Segoe UI Variable Display", "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

#header-main-wrap {
  display: flex;
  flex-direction: row;
}
@media (max-width: 39rem) { #header-main-wrap { flex-direction: column; } }

header {
  position: relative;
  top: 1.5rem;
  left: 0.5rem; /* in addition to the 1rem padding from body, for 1.5rem total */
  height: 100%;
  min-width: 7rem; /* To prevent link arrow from wrapping at narrow main-on-the-right viewport widths */
  margin-right: 5rem;
  max-width: 60vw; /* To prevent horizontal overflow (due to margin-right) on narrow main-below-header viewports */
}
@media (min-width: 39rem) and (max-width: 45rem) { header { margin-right: 2rem; } }

header > a > img { height: 5rem; width: 5rem; }
header nav { min-width: 100%; }
header nav ul {
  list-style: none;
  margin-block-start: 0.5rem;
  line-height: 1.35;
  padding-inline-start: 1.125rem;
}

main {
  width: 100%;
  max-width: 44rem;
  padding-top: 4rem;
}
main > h1 { font-size: 1.75rem; }
@media (max-width: 39rem) { main { margin-top: -3.2rem; } }
@media (max-width: 39rem) { main.home { margin-top: -10rem; } }

section { margin-top: 2rem; }
section h2 { font-size: 1.375rem; }
section h2 > span {
  font-weight: 500;
  font-size: 1.125rem;
}
section ul { padding-inline-start: 2rem; }
section ul > li { margin-bottom: 1rem; }

section figure {
  display: flex;
  flex-direction: column;
  margin-inline-start: 0;
  margin-inline-end: 0;
}
section figure > img {
  max-width: 100%;
  align-self: center;
}
section figure > figcaption {
  margin-top: 0.55em;
  padding-inline-start: 1em;
  padding-inline-end: 1em;
  font-family: ui-sans-serif, "Segoe UI Variable Small", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 0.8125rem;
  text-align: center;
  color: hsl(12 6% 45%); /* rgb(41, 37, 36) in HSL, lightened by +30% */
}
section figure > .image-row {
  display: inherit;
  flex-direction: row;
  justify-content: space-between;
  gap: 8px;
}
section figure > .image-row img { width: 100%; }

main #greeting img {
  position: relative;
  top: 2.5rem;
  left: 13rem;
  margin-top: calc(-2.5rem - 2rem); /* To compensate for relative, 2.5rem offset from the top and section margin-top */
  max-height: 10rem;
}
main #greeting h1 {
  font-size: 2rem;
  margin: 0.25rem auto;
}
main #greeting h2 {
  font-size: 1.5rem;
  margin: 0.25rem auto 0 auto;
}
main #greeting small {
  font-size: 0.875rem;
  margin-left: 0.25rem;
}
@media (max-width: 360px) {
  main #greeting img {
    top: 0.5rem;
    left: 8.5rem;
  }
}

main #intro { margin-top: 2rem; }

main #now h2 > span,
main #updates h2 > span {
  font-weight: 500;
  font-size: 1.125rem;
}

main #updates ol {
  list-style: none;
  padding-inline-start: 0;
  margin-block-end: 0;
}
main #updates ol > li { display: flex; }
main #updates ol > li > time {
  width: 12ch;
  height: 100%;
  margin-right: 0.75rem;
  padding-block-start: 0.1rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", "Noto Sans Mono", monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  color: hsl(12 6% 45%); /* rgb(41, 37, 36) in HSL, lightened by +30% */
}
main #updates ol > li > time > a { text-decoration-line: none; }
main #updates ol > li > time > a:hover { text-decoration-line: underline; }
main #updates ol > li > div { width: calc(100% - 12ch - 0.75rem); }
main #updates ol > li > div > h3 {
  margin-block-start: 0;
  font-size: 1.125rem;
}
main #updates p { margin-block-start: 0; }
@media (max-width: 49rem) {
  main #updates ol > li { flex-direction: column; }
  main #updates ol > li::after {
    content: "— ✶ —";
    align-self: center;
    position: relative;
    top: -0.875rem;
  }
  main #updates ol > li:last-of-type::after { margin-bottom: -1rem; }
  main #updates ol > li > time { margin-bottom: 0.5rem; }
  main #updates ol > li > div { width: 100%; }
}

main #posts h3 { font-size: 1.125rem; }
main #posts ol {
  list-style: none;
  padding-inline-start: 0;
}
main #posts ol > li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-inline-start: 1.25rem;
}
main #posts ol > li > time {
  width: 12ch;
  height: 100%;
  margin-left: 1rem;
  margin-right: 1.35rem;
  padding-block-start: 0.1rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", "Noto Sans Mono", monospace;
  font-size: 0.9375rem;
  color: hsl(12 6% 45%); /* rgb(41, 37, 36) in HSL, lightened by +30% */
}
main #posts p { margin-block-start: 1.5rem; }
@media (max-width: 49rem) {
  main #posts ol > li { flex-direction: column; }
  main #posts ol > li > time { margin-left: 0rem; }
  main #posts ol > li > a { width: 100%; }
}

footer {
  display: flex;
  position: relative;
  left: -1rem;
  padding-left: 1rem;
  padding: 1rem;
  margin-top: 1rem;
  width: 100%;
  font-family: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 1rem;
  border-top: 4px double rgb(41, 37, 36);
}
footer { justify-content: space-between; }
footer #mark { display: flex; }
footer #mark a > img { height: 3rem; width: 3rem; }
footer #mark > div {
  display: inherit;
  flex-direction: column;
  width: 100%;
  margin-left: 0.5em;
  font-size: 1rem;
  color: hsl(12 6% 45%); /* rgb(41, 37, 36) in HSL, lightened by +30% */
}
footer #mark + img {
  width: 1.5rem;
  height: 0.985rem;
  align-self: center;
}
footer #mark + img + span { text-align: right; }
@media (max-width: 42rem) {
  footer { flex-direction: column-reverse; }
  footer #mark { margin-top: 1rem; }
  footer #mark + img { margin-top: 1rem; }
}
@media (min-width: 56rem) { /* 7rem + 5rem + 44rem - 1rem (width) = 55rem, + 1rem (body padding) */
  footer { max-width: calc(7rem + 5rem + 44rem - 1rem); }
}

code {
  padding: 2px 4px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", "Noto Sans Mono", monospace;
  font-size: 0.9375rem;
  font-size: 1rem;
  color: hsl(12 6% 45%); /* rgb(41, 37, 36) in HSL, lightened by +30% */
  background-color: hsl(33 100% 100%);
}

a:any-link {
  display: inline-block; /* To prevent ::after link arrows from wrapping */
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 5px;
  text-decoration-color: #F5565650;
  text-decoration-skip-ink: none;
  text-underline-offset: -0.166em;
}
a:visited { text-decoration-color: #FF68CC50; }
a:hover {
  text-decoration-thickness: 1em;
  text-underline-offset: -0.834em;
}
a:active { color: #F55656; }

a.up::after {
  content: url("link-arrow.svg");
  display: inline-block;
  position: relative;
  transform: rotate(-90deg);
  top: -0.15em;
  right: 0.13em;
  width: 0.55em;
  margin-right: -0.07em;
}
a.down::after {
  content: url("link-arrow.svg");
  display: inline-block;
  position: relative;
  transform: rotate(90deg);
  top: 0.2em;
  right: -0.18em;
  width: 0.55em;
  margin-right: 0.05em;
}
a.ext::after {
  content: url("link-arrow.svg");
  display: inline-block;
  position: relative;
  transform: rotate(-45deg);
  top: -0.2em;
  right: 0.1em;
  width: 0.55em;
  margin-right: -0.05em;
}
