@import url(../fonts/CrimsonPro/static/CrimsonPro.css);
@import url(../fonts/Inter/inter.css);

@font-face {
  font-family: 'Crimson Pro var';
  font-style: normal;
  font-display: swap;
  src: url(../fonts/CrimsonPro/CrimsonPro-VariableFont_wght.ttf);
}

@font-face {
  font-family: 'Crimson Pro var';
  font-style: italic;
  font-display: swap;
  src: url(../fonts/CrimsonPro/CrimsonPro-Italic-VariableFont_wght.ttf);
}

@font-face {
  font-family: 'Quicksand';
  font-display: swap;
  src: url(../fonts/Quicksand/Quicksand-Regular.ttf);
}

@font-face {
  font-family: 'Cascadia Code';
  font-display: swap;
  src: url(../fonts/CascadiaCode/CascadiaCode.ttf);
}

:root {
  --primary-colour: #0099ff;
  --secondary-colour: rgb(125, 203, 255);
  --background-colour: #fff;
  --light-background-colour: #f8f8f8;
  --text-colour: #000;
  --reduced-weight-colour: #747474;
  --reduced-weight-bg: #e6e6e6;
  --shadow: none;

  --font-heading: 'Quicksand', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-special: 'Crimson Pro', serif;
  --font-mono: 'Cascadia Code', monospace;

  --content-max-width: 768px;
  --content-padding: 10px;
}

@supports (font-variation-settings: "wght" 625) {
  :root {
    --font-body: 'InterVariable', sans-serif;
    --font-special: 'Crimson Pro var', serif;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-colour: #0099ff;
    --secondary-colour: #0066ff;
    --background-colour: #111111;
    --light-background-colour: #2b2b2b;
    --text-colour: #eee;
    --reduced-weight-colour: #868686;
    --reduced-weight-bg: #363636;
    --shadow: none;
  }

  .btn svg {
    filter: invert();
  }
}

body {
  font-family: var(--font-body);
  font-variant-ligatures: common-ligatures discretionary-ligatures contextual;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--background-colour);
  color: var(--text-colour);
}

a,
:where(a:visited),
:where(a:link) {
  text-decoration: dashed underline;
  text-decoration-thickness: 0.15rem;
  color: var(--text-colour);

  &.subsection, &.btn {
    text-decoration: none;
    transition: 0.1s linear all;
    box-shadow: 0 1px 3px #000;
    border: 1px solid var(--secondary-colour);
    border-radius: 30px;
    color: var(--text-colour);
  }

  &.subsection {
    box-shadow: 0 1px 4px #000;
  }
}

a:focus,
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.15rem;

  &.subsection, &.btn {
    border-color: var(--secondary-colour);
    background-color: var(--secondary-colour);
    box-shadow: 0 4px 12px #000;
    text-decoration: none;

    &.archived {
      background-color: var(--reduced-weight-bg);
      border-color: var(--reduced-weight-bg);
    }
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  padding-top: 1rem;
  margin-top: 0;
}

p {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  margin-top: 0;
  margin-bottom: 0;
}

.bcrumbs {
  font-family: var(--font-heading);
  font-size: 2em;
}

.image {
  position: relative;
  display: block;
  margin: auto;
  max-width: calc(100% - var(--content-padding) * 2 + 20px);

  &> a {
    position: absolute;
    top: 0;
    right: 0;
    mix-blend-mode: difference;

    img {
      width: 40px;
      filter: invert(100%);
      padding: 10px;
      opacity: 50%;
      transition: all 0.1s linear;

      &:hover, &:focus {
        background-color: var(--reduced-weight-bg);
        opacity: 100%;
      }
    }
  }

  p {
    margin-top: 5px;
    text-align: center;
  }
}

img {
  max-width: 100%;
}

.rating {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 20px;

  .star {
    margin-top: 15px;
    height: 27px;
    width: 27px;
    fill: var(--primary-colour);
  }
}

hr {
  border: 1px solid var(--secondary-colour);
  margin: 15px;
}

li {
  position: relative;
}

ol li {
  padding: 5px 0;
}

ol.footnotes-list li {
  padding: unset;
}

ul {
  list-style-type: disc;

  li {
    margin: 4px 0;
  }

  ul {
    list-style-type: circle;
  }
}

ul:has(li > img, li > br, li > p) {
  list-style-type: none;
  --border: 2px solid rgb(177, 177, 177);
  border-left: var(--border);
  border-top: var(--border);
  border-bottom: var(--border);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  padding: 0;
  margin-top: 10px;
  margin-left: 30px;
  padding-left: 10px;

  li {
    padding: 10px 0;

    &:first-of-type::before,
    &:after {
      content: '';
      width: 40px;
      height: 2px;
      background: rgb(177, 177, 177);
      position: absolute;
      left: -10px;
    }

    &:first-of-type::before,
    &:last-of-type::after {
      width: calc(100% - 40px);
      height: 5px;
      background: var(--background-colour);
      left: 50px;
    }

    &:after {
      bottom: 0;
    }

    &:first-of-type::before {
      top: -0.37em;
    }

    &:last-of-type::after {
      bottom: -0.33em;
    }
  }
}

.banner {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: right;
  top: 0;
  width: calc(100vw - 20px);
  max-height: 88px;
  overflow: auto;
  background-color: rgba(0, 153, 255, 0.3);
  color: #fff;
  backdrop-filter: blur(10px);
  font-size: 18px;
  text-align: center;
  text-wrap: nowrap;
  z-index: 1;
  box-shadow: 0 0 7px black;
  padding: 0 10px;

  p {
    margin: 16px auto;
    padding: 0;
  }

  a {
    color: #fff;
  }

  nav {
    margin: 16px 16px;
    margin-bottom: 0;
    overflow-x: auto;

    ul {
      border: none;
      margin: 0;
      padding: 0;

      li {
        display: inline-block;
        padding: 0;
        margin: 0;

        &::before, &::after {
          width: unset;
          background: unset;
          left: unset;
          top: unset;
          height: 0;
          position: unset;
        }
      }
    }

    a {
      margin-right: 20px;
    }
  }
}

#head__print {
  display: none;
  text-align: center;
  margin-top: 50px;
}

#head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  text-align: center;
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 700px;
  height: 100vh;
  z-index: 0;

  &.sub {
    max-height: 700px;
    overflow: hidden;
    transition: 1s ease-out max-height;

    &.show {
      transition: 1s ease-in max-height;

      .hero {
        transform: unset;
      }
    }

    .hero {
      transform: translateY(calc(-50% + 350px));
    }
  }

  .hero {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100vw;
    min-height: 700px;
    object-fit: cover;
    transition: 0.7s ease-out transform;
  }

  .profile {
    border: unset;
    border-radius: 50%;
    width: 80%;
    max-width: 250px;
    max-height: 250px;
    box-shadow: 0 2px 2px #000;
    margin-right: 20px;
    /* margin-top: 30px; */
    background-color: var(--primary-colour);
    padding: 0;
    line-height: 0;
    transition: 0.1s linear all;
    flex: 0 2 250px;

    &:hover, &:focus {
      border: unset;
      box-shadow: 0 6px 6px #000;
    }
  }

  .p-nickname {
    font-family: var(--font-heading);
    font-weight: bold;
    overflow-x: hidden;
    margin: 0;
    font-size: 5.75em;
    /* text-shadow: 0 2px 2px #000; */
  }

  .p-note {
    font-family: var(--font-heading);
    font-weight: bold;
    margin: 0 0 10px 0;
    font-size: 1.7em;
    /* text-shadow: 0 2px 2px #000; */
    text-wrap: nowrap;
  }

  .socials {
    display: flex;
    border: none;
    padding: 0;
    margin: 15px auto 0;
    width: 100%;
    max-width: 560px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    font-size: 48px;
    text-align: center;

    li {
      margin: 0 15px 5px;
      padding: 0;
      display: block;

      &::before, &::after {
        top: unset;
        left: unset;
        background: unset;
      }

      a {
        border: unset;
        border-radius: unset;
        padding: unset;
        line-height: unset;
        color: #fff;
        filter: drop-shadow(0 1px 1px #000);
        transition: 0.05s filter linear;

        &:hover, &:focus {
          background-color: unset;
          box-shadow: unset;
          filter: drop-shadow(0 3px 3px #000);
        }
      }
    }

    svg {
      filter: invert(100%);
      width: 0.9em;
    }
  }
}

@media screen and (max-width: 400px) {
  #head .p-nickname {
    font-size: 4em;
  }

  #head .p-note {
    font-size: 1.15em;
  }
}

#head__content {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /* width: 100%; */
  max-width: calc(100% - 60px);
  top: calc(90% + 40px);
  backdrop-filter: blur(10px);
  left: 50%;
  padding: 30px;
  border-radius: 30px;
  box-shadow: 0 0 15px black;
  background-color: rgba(0, 153, 255, 0.3);
  margin-bottom: 50px;
}

.head__content__block {
  display: block;
  width: 100%;
}

section {
  /* padding: 10px 10px; */
  font-size: 1.1em;

  &:nth-of-type(even) {
    background: var(--primary-colour);
    color: #fff;
  }

  &:nth-of-type(even) h2 {
    text-shadow: 0 1px 1px #000;
  }

  h1 {
    font-size: 2em;
  }
}

section {
  padding: var(--content-padding) var(--content-padding);
  display: grid;
  grid-template-columns: 
    [full-start] 1fr
    [content-start]
    min(var(--content-max-width), calc(100% - var(--content-padding) * 2))
    [content-end]
    1fr [full-end];
  row-gap: var(--content-padding);
  
  &> * {
    grid-column: content;
    margin-bottom: 0;
    margin-top: 0;
  }

  &> h1 {
    padding-top: 20px;
  }

  &> a.subsection {
    margin: 5px;
  }
}

.gallery {
  grid-column: full;
  display: grid;
  grid-template-columns: inherit;
  padding-block: 20px;
  overflow-x: scroll;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--primary-colour) rgba(1.0, 1.0, 1.0, 0.0);

  .gallery__wrapper {
    grid-column: content;
    display: flex;
    align-items: center;
    gap: 20px;

    &::after {
      content: "";
      align-self: stretch;
      padding-inline-end: max(
        20px,
        (100vw - var(--content-max-width)) / 2 - 20px
      );
    }

    &> * {
      flex-shrink: 0;
      scroll-snap-align: center;
    }
  }
}

.description, blockquote, aside.inline {
  font-family: var(--font-special);
  border-left: 7px solid var(--primary-colour);
  background-color: var(--light-background-colour);
}

blockquote {
  margin: 20px 30px;
}

.description {
  font-style: italic;
  font-size: 1.15em;
  padding: 20px 0 20px 25px;
}

blockquote {
  padding: 5px 10px 5px 45px;
  position: relative;

  &::before {
    content: "“";
    font-size: 2em;
    font-weight: bold;
    position: absolute;
    top: 12px;
    left: 12px;
    color: var(--reduced-weight-colour);
  }
}

aside.inline {
  padding: 5px 10px 5px 15px;
  margin: 10px 0;
}

li > aside.inline {
  margin-left: 10px;
}

.meta {
  font-family: var(--font-heading);
  color: var(--reduced-weight-colour);
  border-color: var(--reduced-weight-colour);
  font-weight: lighter;

  a, a:link, a:visited {
    color: #747474;
    border-color: #747474;
  }

  a:hover, a:focus {
    color: var(--text-colour);
  }

  span {
    display: inline-block;
    margin-right: 15px;
  }

  strong {
    font-weight: bold;
  }
}

.subsection {
  display: block;
  position: relative;
  border: 2px solid var(--primary-colour);
  border-radius: 30px;
  padding: 5px 20px;
  background: var(--background-colour);
  color: var(--text-colour);
  margin: 10px;

  &.archived {
    border-color: var(--reduced-weight-colour);
  }

  img {
    position: relative;
    left: -22px;
    top: -7px;
    width: var(--content-max-width);
    max-width: calc(100% + 40px);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    border-top: inherit;
    border-left: inherit;
    border-right: inherit;
  }

  h1, h2, h3, h4, h5, h6 {
    padding: 1rem 0 0.5rem;
    margin: 0;
  }

  h2 {
    text-shadow: none !important;
  }

  &> *:last-child {
    margin-bottom: 1rem;
  }

  &:has(img) > * {
    margin: 0;
  }

  p {
    padding: 0.4rem 0;
    margin: 0;
  }

  &:has(.rating) {
    padding-bottom: 102px;
  }

  .rating {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 72px;
    width: 100%;
  }
}

.subsection--expandable {
  display: block;

  .wrapper {
    display: none;
  }
}

.subsection--expandable h3, .interactive {
  cursor: pointer;
}

#projects, .wrapper,
.subsection--expandable.show .wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: stretch;
  align-content: space-between;
}

.subsection--project {
  flex-grow: 1;
  width: 300px;
  margin-bottom: 15px;
}

.btn {
  display: inline-block;
  margin: 5px;
  position: relative;
  font-size: 20px;
  padding: 10px;
  font-weight: normal;
  font-family: var(--font-heading);
  background-color: var(--background-colour);
  min-width: 40px;
  text-align: center;

  svg {
    position: relative;
    width: 30px;
    height: 30px;
    top: 3px;
  }
}

.btn--noclick {
  cursor: default;

  &:hover, &:focus {
    cursor: default;
    background-color: unset;
    box-shadow: unset;
  }
}

#btn__load_twitch {
  display: none;

  &.show {
    display: block;
  }
}

.twitch-embed {
  margin-bottom: 20px;
}

#sect__twitch > div {
  margin-bottom: calc(-1 * var(--content-padding));
}

div:has(.twitch-embed) {
  grid-column: full;
}

iframe {
  display: block;
  margin: auto;
  width: 100%;
  max-width: 1108px;
  height: 432px;
}

footer {
  text-align: center;
  padding: 5px 15px;
  font-size: 0.85em;
}

.webrings {
  text-align: center;

  span {
    display: block;
    font-size: 20px;
    font-family: var(--font-heading);
    margin-top: 15px;
    margin-bottom: 15px;
  }
}

img.badge {
  width: 88px;
  height: 31px;
  display: inline-block;
  transition: scale linear 0.1s;

  image-rendering: crisp-edges;

  &:hover, &:focus {
    scale: 2.0;
  }
}
a:has(img.badge) {
  text-decoration: none;
}

pre {
  padding: 1rem;
  overflow: auto;
  border-radius: 15px;
}

code {
  font-family: var(--font-mono);
  font-size: 1rem;
}

pre[data-linenos] {
  padding: 1rem 0;
}

pre {
  table {
    width: 100%;
    border-collapse: collapse;

    td {
      padding: 0;

      &:nth-of-type(1) {
        text-align: center;
        user-select: none;
      }
    }
  }

  mark {
    display: block;
    background-color: rgba(254, 252, 232, 0.9);
  }
}

.footnote-definition {
  width: 100%;
  display: flex;
  margin: 15px 0;

  p {
    display: inline-block;
    margin: 0;
    margin-left: 10px;
  }
}

.hidden {
  display: none;
}

@media print {
  .banner {
    display: none;
  }

  #head {
    display: none;
  }

  #head__print {
    display: block;
  }

  .image > a {
    display: none;
  }

  .gallery .gallery__wrapper {
    display: block;
  }

  .noprint {
    display: none;
  }
}
