@import url("normalize.css");
@import url("type.css");
@import url("colors.css");

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

body {
  font-family: "Fraunces Variable";
  overflow-x: hidden;
  -webkit-font-smoothing: anitaliased;
  background: var(--black);
  color: var(--white);
  counter-reset: section;
}

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

figure {
  margin: 0;
  img {
    display: block;
    margin: 0 auto 1rem;
    border-radius: 0.375rem;
  }
  figcaption > *:last-child {
    margin-bottom: 0;
  }
}

blockquote {
  background: var(--lightblue);
  border-radius: 0.375rem;
  margin: 2rem 0;
  padding: 1.75rem 2.25rem;
  *:last-child {
    margin-bottom: 0.25rem;
  }
}

img {
  max-width: 100%;
  height: auto;
}

a:focus-visible,
button:focus-visible,
.projects-inner:focus-visible {
  outline: solid 0.25rem var(--blue);
  outline-offset: 0.25rem;
  border-radius: 1px;
}

::-moz-selection,
::selection {
  color: var(--black);
  background: var(--yellow);
  border-radius: 0.125rem;
}

.sr-only {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

.button {
  display: inline-block;
  text-decoration: none;
  font-family: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  font-weight: 300;
  padding: .625em 1.125em;
  border: solid 1px var(--gray);
  color: var(--white);
  margin-top: 1.375rem;
  transition: 200ms linear color;
  box-shadow: none;
  border-radius: .25rem;
  background: none;
  cursor: pointer;
}

.button:hover {
  color: var(--lightyellow);
  .arrow {
    color: var(--white);
  }
}

.segmented-control {
  background-color: rgba(255, 255, 255, 0.0625);
  border-radius: .375rem;
  padding: .25rem;
  display: flex;
  flex-direction: row;
  .button {
    background-color: var(--black);
    font-weight: 500;
  }
  .button:not(.active) {
    background: transparent;
    border-color: transparent;
    font-weight: 300;
  }
}

.site-main {
  margin: 2rem auto;
  max-width: 90vw;
}

.midcontainer {
  max-width: 70rem;
  margin-right: auto;
  margin-left: auto;
}

.pill {
  display: inline-block;
  padding: 0.225rem 0.625rem;
  font-size: var(--text-xs);
  text-transform: uppercase;
  border-radius: 0.375rem;
  font-weight: var(--font-bold);
  letter-spacing: 0.125em;
  margin: 2rem 0 3rem -2vw;
  transform: skew(0deg, -6deg) rotate(-4deg);
  text-decoration: none;
  background-color: var(--black);
}

.badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  font-size: var(--text-xs);
  border-radius: 2rem;
  background-color: var(--ecru);
  color: #444444;
  font-family: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  font-weight: 400;
  letter-spacing: 0.03125em;
  box-shadow:
    0px 0px 2px 0px rgba(0, 0, 0, 0.14),
    0px 2px 2px 0px rgba(0, 0, 0, 0.04),
    0px 2px 4px 0px rgba(0, 0, 0, 0.08);
}

.overline {
  line-height: 1.3;
  font-family: var(--sans-serif);
  font-size: var(--text-sm);
  text-transform: uppercase;
  font-weight: var(--font-regular);
  letter-spacing: 0.0625em;
  margin: 0;
}

.project-gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-right: 1.5rem;
  .project-asset {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    scroll-snap-align: start;
    margin-right: 4vw;
    flex: 0 0 45vw;
  }
}

.callout {
  background-color: var(--lightyellow);
  padding: 1.75rem;
}

.intro-outer {
  background: var(--black);
  color: var(--white);
}
.intro {
  h1 {
    margin: 0 0 0.25em;
  }
}
.intro-content {
  max-width: 70rem;
  margin: 0 auto;
}

/* Header */
.site-header {
  padding: 2rem 5vw 0;
  .site-header-inner {
    max-width: 70rem;
    margin: 0 auto;
    /* border-bottom: solid 2px var(--white); */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
  .site-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4.25rem;
    width: 4.25rem;
    background: var(--red);
    border-radius: 100%;
    img {
      width: 1.75rem;
    }
  }
  .site-nav {
    position: relative;
  }
  .nav-toggle {
    background: none;
    box-shadow: none;
    cursor: pointer;
    font-size: var(--text-sm);
  }
  .nav-menu {
    border-radius: 0.25rem;
    background: var(--white);
    padding: 0.75rem 0.25rem;
    position: absolute;
    right: 0;
    z-index: 9999;
    top: calc(100% + 1rem);
    width: 180px;
    box-shadow:
      0px 0px 2px 0px rgba(0, 0, 0, 0.14),
      0px 2px 2px 0px rgba(0, 0, 0, 0.04),
      0px 2px 4px 0px rgba(0, 0, 0, 0.08);
    a {
      display: block;
      color: var(--black);
      text-decoration: none;
      padding: 0.25rem 1rem;
      border-radius: 3rem;
      margin-bottom: 0.25rem;
    }
    a:last-of-type {
      margin-bottom: 0;
    }
    a:hover {
      background-color: var(--lightyellow);
    }
  }
  .nav-menu[hidden] {
    display: none;
  }
  .site-breadcrumb {
    font-family: var(--sans-serif);
    flex: 1 0 100%;
    padding: 1.5rem 0;
    margin-top: 2.25rem;
    border-top: 1px solid var(--gray);
  }
  .breadcrumb-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    color: var(--lightgray);
  }
  .breadcrumb-item:not(:last-child)::after {
    content: "/";
    display: inline-block;
    padding: 0 0.5em;
    color: var(--gray);
  }
  .breadcrumb-link {
    text-decoration: none;
  }
}

/* Footer */
.site-footer {
  background: var(--black);
  color: var(--lightgray);
  padding: 2.75rem 1.5rem 2rem;
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  > img {
    display: inline-block;
    margin-bottom: 1.5rem;
  }
  p {
    margin-bottom: 0.5em;
    text-align: center;
    max-width: 24em;
  }
  .footer-nav {
    ul {
      list-style: none;
      margin: 0 0 1rem;
      padding: 0;
      display: flex;
      gap: 1.5rem;
      li {
        padding: 0;
        margin: 0;
        text-align: center;
        a {
          text-decoration: none;
        }
      }
    }
  }
}

/* Single Entry */
body.post {
  background: var(--white);
  color: var(--black);
}
.post .entry {
  .cover-image {
    margin: 0 auto 3rem;
    max-width: 56rem;
    position: relative;
  }
  .entry-intro {
    margin-bottom: 1.5em;
  }
  .cover-image::after {
    content: " ";
    display: block;
    position: absolute;
    width: 200%;
    height: 1600px;
    left: -50%;
    right: -50%;
    bottom: 50%;
    background: var(--black);
    color: var(--white);
    z-index: -1;
  }
  .entry-header-inner {
    margin: 0 auto;
    max-width: 56rem;
    color: var(--white);
    .entry-title {
      margin: 0 0 0.5em;
    }
    .entry-label {
      background-color: var(--green);
      color: var(--black);
    }
  }
  .entry-date {
    display: block;
    margin: 0 auto 2rem;
    font-size: var(--text-sm);
    color: var(--gray);
    font-family: var(--sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.0625em;
    max-width: 45rem;
    font-weight: 400;
  }
  .text-block {
    margin: 0 auto;
    max-width: 45rem;
  }
  .code-block {
    margin: 1.5rem auto;
    max-width: 55rem;
    font-size: 60%;
    pre[class*="language-"]::before,
    pre[class*="language-"]::after {
      display: none;
    }
  }
  .image-block {
    margin: 2.25rem auto;
    max-width: 55rem;
    img {
      display: block;
      border-radius: 0.375rem;
    }
  }
  .entry-content {
    font-size: var(--text-base);
    h1,
    .h1 {
      font-size: var(--text-3xl);
      line-height: 1.1;
      font-weight: var(--font-light);
    }

    h2,
    .h2 {
      font-size: var(--text-2xl);
      line-height: 1.2;
      font-weight: var(--font-regular);
    }

    h3,
    .h3 {
      font-size: var(--text-xl);
      line-height: 1.2;
      font-weight: var(--font-regular);
    }
    h4,
    .h4 {
      font-size: var(--text-lg);
      line-height: 1.3;
      font-weight: var(--font-semibold);
    }
    h5,
    .h5 {
      font-size: var(--text-base);
      line-height: 1.3;
      font-weight: var(--font-semibold);
    }
    h6,
    .h6 {
        line-height: 1.3;
        font-family: var(--sans-serif);
        font-size: var(--text-sm);
        text-transform: uppercase;
        font-weight: var(--font-regular);
        letter-spacing: 0.0625em;
        color: var(--gray);
    }
    hr {
      border: none;
      border-bottom: solid 1px var(--lightgray);
      color: var(--lightgray);
      margin-block: 3rem;
    }
  }
}

/* Homepage */
.page-homepage {
  .home-wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    gap: 2rem;
    svg {
      max-width: 100%;
      height: auto;
    }
  }
  .home-content {
    flex: 1 0 60%;
    max-width: 32rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
  h1 {
    margin: 0 0 0.25em;
  }
  p {
    margin-bottom: 0.75em;
  }
  
  .pattern {
    max-width: 45%;
    .medium,
    .small {
      display: none;
    }
  }
}

/* About/Work Page */
.page-work {
  .pill {
    background: var(--green);
    color: var(--black);
  }
  .intro {
    padding: 0;
    margin: 3vw auto 7vw;
    p {
      margin-bottom: 0.625em;
      max-width: 20em;
    }
    p:first-of-type {
      max-width: 16em;
    }
  }
  .focus-areas-outer {
    margin: 7vw auto;
  }
  .focus-areas {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4%;
    margin-top: 3rem;
    .item {
      box-sizing: border-box;
      flex-basis: 30.66666%;
      /* border: solid 1px rgba(255,255,255,.4); */
      margin-bottom: 2rem;

      h3 {
        margin-top: 0;
      }
      p {
        margin-bottom: 0.75rem;
      }
      p:last-child {
        margin-bottom: 0;
      }
    }
    .item::before {
      counter-increment: section;
      content: counter(section);
      height: 2rem;
      width: 2rem;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 100%;
      background: var(--darkgreen);
      font-family: var(--sans-serif);
      font-weight: 400;
      font-size: var(--text-sm);
      margin-bottom: 1rem;
    }
    .item-2::before {
      background: var(--purple);
    }
    .item-3::before {
      background: var(--dullblue);
    }
  }
  .all-projects {
    max-width: 85rem;
    margin-right: auto;
    margin-left: auto;
    background: #f7cf72;
    color: var(--black);
    border-radius: 0.625rem;
    > h2 {
      padding: 2.125rem 0 0 2.125rem;
    }
    .projects-inner {
      display: flex;
      flex-direction: row;
      overflow-x: auto;
      padding: 1.625rem 2.25rem 2.25rem;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      scroll-padding-left: 2.25rem;
      gap: 2.25rem;
    }
  }
  .single-project {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    scroll-snap-align: start;
    flex: 0 0 23vw;
    .project-img {
      display: block;
      transition: 200ms linear filter;
      border-radius: 0.25rem;
    }
    .project-title {
      margin: 1.125rem 0 0.875rem;
    }
    p:last-child {
      margin-bottom: 0;
    }
  }

}

.project {
  .project-desc {
    p, ul, ol {
    font-weight: var(--font-extralight);
    font-size: var(--text-sm);
    max-width: 40rem;
    }
    p:first-of-type {
      font-size: var(--text-lg);
    }
  }
  .project-album {
    margin: 5vw auto 7vw;
    color: var(--black);
    .button {
      margin: 0;
    }
    .album-view {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      margin-bottom: 1.125rem;
    }
    .all-images {
      background-color: var(--white);
      border-radius: 0.5rem;
      padding: 1.5rem;
    }
  }
  .carousel {
    .all-images {
      overflow: hidden;
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      overflow-x: hidden;
      scroll-snap-type: x mandatory;
      scrollbar-width: none;
      scroll-padding-left: 1.5rem;
      padding-right: 1.5rem;
      offset: 100px;
      /* cursor: pointer; */
      &::-webkit-scrollbar {
        display: none;
      }
      .project-img {
        scroll-snap-align: start;
        margin-right: 3rem;
        margin-bottom: 0;
        flex: 0 0 100%;
        &:last-of-type {
          margin-right: 0;
        }
      }
    }
    .all-images.moving-forward {
      cursor: url('./assets/forward.svg'), e-resize;
    }
    .all-images.moving-backward {
      cursor: url('./assets/back.svg'), w-resize;
    }
  }
  .list {
    .project-img {
      margin-bottom: 3rem;
    }
    .project-img:last-child {
      margin-bottom: 0;
    }
  }
}

/* Writing Page */
.page-writing {
  .site-main {
    padding: 0;
    margin: auto;
    max-width: 90vw;
  }
  .all-posts {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1%;
  }
  .post {
    flex: 0 0 32.625%;
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 1.125rem;
    margin-bottom: 2rem;
    border-radius: 0.625rem;
    transition: all linear 200ms;
    position: relative;
  }
  .post:hover {
    background: rgba(255, 255, 255, 0.0625);
  }
  .post-img-outer {
    position: relative;
  }
  .post-tag {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
  }
  .post-date {
    font-family: var(--sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.0625em;
    color: var(--gray);
    font-weight: 400;
  }
  .post-img {
    display: block;
    border-radius: 0.375rem;
    margin: 0 0 1rem;
  }
  .post-title {
    margin: 0.25em 0 0.5em;
  }
  .post-desc {
    margin-bottom: 0;
  }
  .protected-bug {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: block;
    text-indent: -9999px;
    height: 36px;
    width: 36px;
    background: transparent no-repeat center center url(./assets/lock.svg);
  }
}

/* Bookshelf Page */
.page-bookshelf {
  .all-books {
    padding: 3rem 5vw;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: stretch;
  }
  .book {
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 2.5rem 4rem;
    .book-cover {
      /* flex-grow: 1; */
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .book-title {
      margin-top: 1.25rem;
      max-width: 16em;
    }
    img {
      display: block;
      transition: width linear 150ms;
      border-radius: 0.125rem;
      box-shadow:
        0px 0px 2px 0px rgba(0, 0, 0, 0.14),
        0px 2px 2px 0px rgba(0, 0, 0, 0.04),
        0px 2px 4px 0px rgba(0, 0, 0, 0.08);
    }
  }
  .cover-img-sm {
    width: 190px;
  }
  .cover-img-md {
    width: 210px;
  }
  .cover-img-lg {
    width: 310px;
  }
}

@media screen and (max-width: 1244px) {
  .page-bookshelf {
    .cover-img-sm {
      width: calc(190px * 0.8);
    }
    .cover-img-md {
      width: calc(210px * 0.8);
    }
    .cover-img-lg {
      width: calc(310px * 0.8);
    }
  }
}

@media screen and (max-width: 1040px) {
  .page-writing {
    & .post {
      flex: 0 0 49%;
    }
  }
  .page-homepage {
    .pattern {
      .medium {
        display: block;
      }
      .large {
        display: none;
      }
    }
  }
  .page-work {
    .single-project {
      flex-basis: 34%;
    }
    .focus-areas {
      flex-direction: column;
      .item {
        flex-basis: 100%;
        margin: 0 0 3rem 3.5rem;
        padding: 0;
        position: relative;
        p {
          max-width: 40em;
        }
      }
      .item::before {
        position: absolute;
        right: calc(100% + 1.5rem);
        top: 0;
      }
    }
  }
  .page-bookshelf {
    .cover-img-sm {
      width: calc(190px * 0.7);
    }
    .cover-img-md {
      width: calc(210px * 0.7);
    }
    .cover-img-lg {
      width: calc(310px * 0.7);
    }
  }
}

@media screen and (max-width: 810px) {
  .page-homepage {
    .pattern {
      max-width: 30%;
    }
  }
  .page-work {
    .single-project {
      flex-basis: 45%;
    }
  }
  .site-main {
    margin: 0 auto;
  }
  .page-writing {
    .post {
      flex-basis: 100%;
    }
  }
}

@media screen and (max-width: 680px) {
  .page-homepage {
    .pattern {
      max-width: 20%;
      .small {
        display: block;
      }
      .medium {
        display: none;
      }
    }
  }
  .page-work {

    .intro {
      font-size: var(--text-3xl);
    }
    .all-projects {
      .projects-inner {
        flex-direction: column;
      }
    }
    .single-project {
      flex-basis: 100%;
    }
  }
  .page-bookshelf {
    .all-books {
      padding: 3rem 0;
    }
    .book {
      max-width: 50%;
      padding: 1.5rem 0.75rem 2.5rem;
    }
    .cover-img-sm {
      width: calc(190px * 0.6);
    }
    .cover-img-md {
      width: calc(210px * 0.6);
    }
    .cover-img-lg {
      width: calc(310px * 0.6);
    }
  }
}

@media screen and (max-width: 520px) {
  .page-homepage {
    .pattern {
      display: none;
    }
  }
}