* {
  margin-left: auto;
  margin-right: auto;
  font-family: sans-serif;
}

/* Visible keyboard focus indicators for accessibility */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #ffcc00 !important;
  outline-offset: 2px !important;
}

body {
  max-width: 650px;
  margin: 40px auto;
  padding: 0 10px;
  font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

p {
  font-weight: 400;
  font-size: 1.2em;
  line-height: 1.5em;
  max-width: 40rem;
}

ul {
  font-weight: 400;
  font-size: 19px;
  line-height: 28px;
  padding-left: 1em;
  max-width: 40rem;
}

ol {
  padding-left: 2em;
  max-width: 40rem;
}

li {
  max-width: 40rem;
  padding: 0.1em;
}

ol > li,
ol > li > ul > a,
li > ul > li:nth-child(1) {
  font-weight: 800;
}

.update {
  padding: 1em;
  background-color: aliceblue;
  border-radius: 20px;
}

nav,
footer {
  padding: 1em;
}

code {
  background-color: #eee;
  border: 1px solid #999;
  display: block;
  padding: 20px;
  margin-top: 1em;
  font-family: "Fira Mono", monospace;
  font-display: swap;
  overflow-wrap: break-word;
}

blockquote {
  max-width: 38rem;
  background-color: #f4f4f4;
  padding: 1em;
}

aside {
  max-width: 38rem;
  background-color: #f4f4f4;
  padding: 1em;
}

aside > figure {
  border-bottom: solid 1px #000;
  padding-bottom: 1em;
}

aside > figure:last-child {
  border-bottom: none;
}

h1 {
  font-weight: 700;
  font-size: 30px;
  text-align: center;
  padding-top: 6px;
  padding-bottom: 6px;
  margin-top: 0;
  background-color: #346;
  color: #fff;
}

h2 {
  font-weight: 700;
  font-size: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  max-width: 40rem;
}

h3 {
  font-weight: 600;
  font-size: 20px;
  padding-top: 4pt;
  padding-bottom: 4pt;
  max-width: 40rem;
}

h4 {
  max-width: 40rem;
}

a {
  color: #346;
}

img {
  display: block;
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
}

figure {
  display: block;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-top: 1em;
  padding-bottom: 1em;
}

figcaption {
  padding-top: 1em;
  text-align: center;
  max-width: 30rem;
}

.small-img {
  max-width: 20rem;
}

.return {
  text-transform: uppercase;
  font-size: 0.8em;
  color: #346;
}

table {
  max-width: 60rem;
}

td > ul > li {
  width: 30vw;
  margin-left: 2em;
  list-style: none;
}

td > li {
  list-style: none;
}

thead > * {
  text-transform: uppercase;
}

tr {
  padding-bottom: 1em;
  border: solid 1px #000;
}

td {
  border-bottom: solid 1px #000;
}

td:nth-child(2n) {
}

audio {
  display: block;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

video {
  display: block;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

#profile {
  width: 300px;
  height: 320px;
  margin-left: 0px;
  padding: 2em 1em 2em 0em;
}

.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  align-self: flex-start;
}

.container ul {
  padding-top: 2em;
  margin-left: 0px;
}

.note {
  color: #346;
  background-color: #f4f4f4;
  max-width: 33rem;
  padding: 1em;
  text-align: center;
  border: solid 2px #000;
}

@media only screen and (max-width: 600px),
  only screen and (max-device-width: 600px) {
  * {
    max-width: 98%;
  }

  .container ul {
    padding-top: 2em;
    margin-left: 0px;
  }
}

@media only screen and (max-width: 450px),
  only screen and (max-device-width: 450px) {
  * {
    max-width: 98%;
  }

  #profile {
    margin-left: auto;
    margin-right: auto;
  }

  .container ul {
    padding-top: 0em;
    margin-left: 0px;
  }

  li {
    padding: 0.5em 0em 0em 0em;
  }

  table {
    max-width: 98vw;
  }
}

@media (prefers-color-scheme: dark) {
  * {
    background-color: #000;
    color: #eee;
  }

  .note,
  blockquote,
  blockquote > em {
    background-color: #346;
    color: #eee;
  }

  .note {
    border-color: #fff;
  }

  aside {
    max-width: 38rem;
    background-color: #346;
    padding: 1em;
  }

  aside > .return {
    background-color: #346;
    color: #cecece;
    font-weight: 600;
  }

  aside > h3 {
    background-color: #346;
  }

  aside > figure {
    border-bottom: solid 1px #fff;
    background-color: #346;
    padding-bottom: 1em;
  }

  figure > *,
  figure,
  figcaption > table > thead > tr > td,
  figcaption > table > tbody > tr > td,
  figcaption > table > thead > tr > td > sup {
    background-color: #346;
    border: none;
  }

  a {
    color: #7795d1;
    background-color: #fff0;
  }

  p {
    font-weight: 500;
  }
}

@media only screen and (min-width: 1256px) {
  #contents {
    display: block;
    position: fixed;
    left: 1em;
    top: 80px;
    width: 200px;
  }

  .intro {
    right: 0;
  }
}

@media only screen and (max-width: 800px),
  only screen and (max-device-width: 800px) {
  #contents {
    position: relative;
  }

  .intro {
    flex-direction: column;
  }
}

/* Persistent Navigation Header */
.persistent-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  background-color: #334466;
  color: #ffffff;
  z-index: 10000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-bottom: 2px solid #223355;
  margin: 0 0 20px 0;
}

/* Offset targeted headings to account for the sticky navbar height */
h1[id], h2[id], h3[id], h4[id], section[id], [id] {
  scroll-margin-top: 80px;
}

.persistent-nav a {
  color: #ffffff;
  text-decoration: none;
  background-color: transparent;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  margin: 0;
}

.persistent-nav a:hover {
  background-color: #445577;
  color: #ffffff;
}

.nav-brand {
  margin: 0;
}

.nav-brand a {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  margin: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.nav-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #aabcca;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 5px 0 0;
}

/* Reset margin for all elements in nav */
.persistent-nav * {
  margin-left: initial;
  margin-right: initial;
}

/* Dark Mode styles for Navigation */
@media (prefers-color-scheme: dark) {
  .persistent-nav {
    background-color: #111122;
    border-bottom: 2px solid #334466;
  }
  .persistent-nav a {
    color: #eee;
  }
  .persistent-nav a:hover {
    background-color: #334466;
  }
  .nav-toggle {
    border-color: #eee;
    color: #eee;
  }
}

/* Responsive adjustments */
@media only screen and (max-width: 950px) {
  .nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 15px;
    margin-top: 10px;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-section {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 5px;
    border-top: 1px solid #445577;
    padding-top: 10px;
  }
}