html {
  --primaryTextColor: #333;
  --secondaryTextColor: #666;
  --accentTextColor: #666;
  --subtleBorder: #d6d6d6;
  --superSubtleBorder: #e4e4e4;
  --backgroundColor: #f7f7f7;
  scroll-behavior: smooth;
}

body {
  background-color: var(--backgroundColor);
}

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

/* TYPOGRAPHY
---------------------------------------------------------------------------- */

body {
  background-color: var(--backgroundColor);
  font-family: "Georgia","Times", serif;
  font-size: 1.125rem;
  line-height: 1.5556;
  color: var(--primaryTextColor);
}

h1, h2, h3, .introduction {
  font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  font-weight: bold;
}

.subtitle {
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.5;
}

h3 {
    font-size: 1.6rem;
}

/* HELPERS
---------------------------------------------------------------------------- */

.no-underline-link {
  text-decoration: none;
}

.no-underline-link:hover,
.no-underline-link:focus,
.no-underline-link:active {
  text-decoration: underline;
}


/* LAYOUT
---------------------------------------------------------------------------- */

body {
  margin: 2rem;
}

body.grid {
  background-size: 100% 8px;
  background-image: linear-gradient(to top, #e5e5e5 1px, transparent 1px);
}

.wrapper {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.wrapper.page {
  max-width: 750px;
}

.full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* HEADER
---------------------------------------------------------------------------- */

/* THEME SWITCHER */

.themeSelector {
  margin: 0;
  padding: 0;
  list-style: none;
  float: left;
}

.themeSelector.pageThemeSelector {
  float: right;
}

.themeSelector > li {
  float: left;
  margin-right: 1rem;
}

.pageThemeSelector > li {
    margin-right: 0.8rem;
}

.themeSelector > li:last-child {
  margin-right: 0;
}

.themeButton {
  display: block;
  padding: 0;
  overflow: hidden;
  text-indent: -999rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--backgroundColor);
  box-shadow: 0 0 1px black, 0 0 1px white;
  cursor: pointer;
}

.top {
  position: relative;
  margin-bottom: 4rem;
}

.top::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 280px;
  height: 300px;
  background-size: 100%;
  background-position: right bottom;
  background-repeat: no-repeat;
}

.top[data-image="memoji-1"]::after {
  background-image: url(./images/header-memoji-1.png);
}
.top[data-image="memoji-2"]::after {
  background-image: url(./images/header-memoji-2.png);
}
.top[data-image="memoji-3"]::after {
  background-image: url(./images/header-memoji-3.png);
}
.top[data-image="memoji-4"]::after {
  background-image: url(./images/header-memoji-4.png);
}

.indexHeader {
  padding: 8rem 0 4rem;
}

.pageHeader {
  padding: 0 0 2rem;
}

.introduction {
  color: var(--secondaryTextColor);
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: -0.0625rem;
  line-height: 1;
}

.indexTitle {
  font-size: 4rem;
  letter-spacing: -0.0625rem;
  line-height: 1;
  margin: 0 0 0 -0.1rem;
}

.pageTitle {
  font-size: 1rem;
  line-height: 1;
  margin: 0;
}

.headerPathSeperator {
  padding: 0 0.5rem;
}

.whoAmI {
  color: var(--primaryTextColor);
  margin: 0;
}

/* CONTENT
---------------------------------------------------------------------------- */

.section {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--subtleBorder);
}

.sectionHeader {
  padding: 2rem 0;
}

.sectionMetadata {
    font-style: italic;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--secondaryTextColor);
}

.sectionTitle {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -1px;
  margin: 0 0 0.5rem 0;
}

.sectionSubtitle {
  color: var(--secondaryTextColor);
}

/* BLOG RELATED
---------------------------------------------------------------------------- */

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

.itemSummaryItem {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--superSubtleBorder);
    padding-bottom: 2rem;
}

.itemSummaryItem:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border: none;
}

.itemSummaryItemTitle {
    margin: 0;
}

.itemSummaryItem .subtitle {
    font-size: 1.25rem;
}

.itemSummaryItemMetadata {
    font-style: italic;
    font-size: 1rem;
}

.sectionSubtitle code {
  color: var(--primaryTextColor);
}

.blogpost .subtitle {
  font-size: 1.25rem;
  margin-top: 1rem;
}

code {
  font-size: 0.9em;
  background-color: var(--subtleBorder);
  padding: 1px 4px;
}

/* Images in Blog Posts */

dl {
  margin: 3rem 0;
}

dl.captionedImageCenter dt img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

dl.captionedImageCenter dd {
  padding: 5px 0 0 0;
  border: 0;
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  display: block;
}

.blogpost abbr[title] {
  text-decoration: none;
  color: var(--secondaryTextColor);
  border-bottom: 1px dotted var(--accentTextColor);
}

.blogpost hr {
  border: 0;
  height: 1px;
  background-color: var(--superSubtleBorder);
}

/* PHOTOS
---------------------------------------------------------------------------- */

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  align-content: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gallery-item {
  height: 36vh;
  -moz-box-flex: 1;
  flex-grow: 1;
  position: relative;
  background-size: 100%;
  box-sizing: border-box;
  outline: 8px solid var(--backgroundColor);
}

.gallery-img {
  max-height: 100%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  object-fit: cover;
  display: block;
}

.gallery-grid .gallery-item div {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

/* GITHUB PROJECTS
---------------------------------------------------------------------------- */

.github-project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 3%;
}

.github-project:nth-child(2) {
    padding-top: 50px;
}

.github-project:nth-child(3) {
    padding-top: 100px;
}

.github-project-title {
    margin: 1.3rem 0;
}

.github-project-imglink {
    display: block;
    outline: 3px solid var(--accentTextColor);
    border-radius: 5px;
}

.github-project-imglink img {
    display: block;
    width: 100%;
    height: auto;
}


/* FOOTER
---------------------------------------------------------------------------- */

.footer {
  overflow: hidden;
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--subtleBorder);
}

.footerContactLink {
  font-size: 1rem;
}

/* THEMES
---------------------------------------------------------------------------- */

/* OUR THEMES */

html[data-theme="solarized-light"] {
  --primaryTextColor: rgb(101, 123, 131);
  --secondaryTextColor: rgb(147, 161, 161);
  --accentTextColor: rgb(42, 161, 152);
  --subtleBorder: rgb(229, 218, 189);
  --superSubtleBorder: rgb(239 229 203);

  --backgroundColor: rgb(253, 246, 227);
}

html[data-theme="duotone-dark"] {
  --primaryTextColor: rgb(210, 205, 229);
  --secondaryTextColor: rgb(165, 156, 204);
  --accentTextColor: rgb(255, 230, 133);
  --subtleBorder: rgb(90, 86, 109);
  --superSubtleBorder: rgb(60, 57, 75);

  --backgroundColor: rgb(42, 40, 51);
}

html[data-theme="duotone-dark-sea"] {
  --primaryTextColor: rgb(214, 233, 255);
  --secondaryTextColor: rgb(93, 140, 192);
  --accentTextColor: rgb(52, 254, 187);
  --subtleBorder: rgb(72, 94, 116);
  --superSubtleBorder: rgb(44, 61, 77);

  --backgroundColor: rgb(29, 38, 47);
}

html[data-theme="duotone-dark"] .top::after,
html[data-theme="duotone-dark-sea"] .top::after {
  border-radius: 10px;
  background-color: var(--secondaryTextColor);
}

/* SYSTEM DARK MODE */

@media (prefers-color-scheme: dark) {
  html {
    --primaryTextColor: #fefefe;
    --secondaryTextColor: #9f9f9f;
    --accentTextColor: #9f9f9f;
    --subtleBorder: #4b4b4b;
    --superSubtleBorder: #393939;

    --backgroundColor: #222;
  }

  html[data-theme=""] .top::after {
    border-radius: 10px;
    background-color: var(--secondaryTextColor);
  }
}

/* Theme Selector theming */

.themeButton[name=""] {
  background-image: linear-gradient(90deg, rgb(102,102,102) 50%, rgb(200,200,200) 50%);
  background-origin: border-box;
  border-color: var(--backgroundColor);
}

.themeButton[name="solarized-light"] {
  background-color: rgb(42, 161, 152);
  border-color: rgb(253, 246, 227);
}

.themeButton[name="duotone-dark"] {
  background-color: rgb(255, 230, 133);
  border-color: rgb(42, 40, 51);
}

.themeButton[name="duotone-dark-sea"] {
  background-color: rgb(52, 254, 187);
  border-color: rgb(29, 38, 47);
}

html[data-theme=""] .themeButton[name=""],
html[data-theme="solarized-light"] .themeButton[name="solarized-light"],
html[data-theme="duotone-dark"] .themeButton[name="duotone-dark"],
html[data-theme="duotone-dark-sea"] .themeButton[name="duotone-dark-sea"] {
  box-shadow: 0 0 1px var(--accentTextColor), 0 0 2px var(--accentTextColor), 0 0 2px var(--accentTextColor);
}

/* MEDIA QUERIES
---------------------------------------------------------------------------- */

@media (max-width: 1280px) {
  .gallery-item {
    height: 30vw;
  }
}

@media (max-width: 920px) {
  .top::after {
    width: 200px;
    height: 217px;
    top: 0;
    bottom: auto;
  }

  .gallery-item {
    height: 36vw;
  }

  .github-project-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 3%;
  }

  .github-project:nth-child(2),
  .github-project:nth-child(3) {
      padding-top: 0;
  }
}

@media (max-width: 700px) {
  body {
    margin: 1rem;
  }

  .pageHeader {
      padding-bottom: 1.1rem;
  }
}

@media (max-width: 660px) {
  .top::after {
    top: 8rem;
    height: 156px;
    width: 156px;
  }

  .indexTitle {
    width: 350px;
  }

  .gallery-item,
  .gallery-img {
    height: auto;
    width: 100%;
  }
}

@media (max-width: 550px) {
    .github-project-grid {
        grid-template-columns: 1fr;
        gap: 1%;
    }
}

@media (max-width: 450px) {
  .indexHeader {
    padding: 3rem 0;
  }

  .top::after {
    top: 3rem;
    height: 116px;
    width: 116px;
  }

  .indexTitle {
    width: 200px;
  }

  .introduction {
    font-size: 1.5rem;
  }

  .indexTitle {
    font-size: 3rem;
  }

  .whoAmI {
    font-size: 1.125rem;
  }

  .pageThemeSelector {
      margin-top: 0.2rem;
  }
  
  .pageThemeSelector > li {
      margin-right: 0.5rem;
  }

  .pageThemeSelector .themeButton {
      width: 14px;
      height: 14px;
  }
}

@media (max-width: 320px) {
  .top::after {
    top: 0;
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 290px) {
  .top::after {
    display: none;
  }
}
