@font-face {
  font-display: swap;
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 500;
  src: url('/fonts/ubuntu-v20-latin-500.woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Fira sans';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/fira-sans-v17-latin-regular.woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Noto Sans Symbols 2';
  font-style: normal;
  font-weight: 400;
  src: url('/fonts/noto-sans-symbols-2-regular.woff2');
}

:root {
  --background:#222222;
  --background-hover:#404040;
  --text:#BBBBBB;
  --bar:#7777CC;
  --link:#30B5FF;

  --topbar-height: min(5rem, 15cqw);
}

html {
  /* header */
  scroll-padding-top: var(--topbar-height);
}

body {
  background: var(--background);
  color: var(--text);
  margin: 0;
}

.bar {
  background: var(--bar);
}

#topbar {
  position: fixed;
  z-index: 1;
  left: 0px;
  right: 0px;
  top: 0px;
  bottom: calc(100% - var(--topbar-height));
  display: flex;
  justify-content: center;
  align-items: center;
}

.topbutton {
  padding: min(2rem, 4cqw);
  position: relative;
  color: var(--background);
  text-decoration: none;
  font-family: 'Ubuntu', sans-serif;
  font-size: min(1.6rem, 3.5cqw);
}

.topbutton:hover {
  color: var(--background-hover);
}

#maincontent {
  padding-top: var(--topbar-height);
  padding-bottom: 2rem;
  font-family: 'Fira Sans', sans-serif;
  font-size: 1.75rem;
  container-name: maincontent;
  /* if I use size it doesnt resize with children and it doesnt make body scrollable */
  container-type: inline-size;
}

#maincontent .widgetcontainer {
  width: auto;
  max-width: 100rem;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: 25% 50% 25%;
}

#maincontent .widgetcontainer .widget {
  background-color: var(--background-hover);
  /* the first elemnt is always the header which is padded vertically itself */
  padding: 0.1rem 2rem 2rem 2rem;
  margin: 2rem 1rem 2rem 1rem;
  border-radius: 1rem;
}

#maincontent > #textcontent p,
#maincontent > #textcontent h1,
#maincontent > #textcontent h2,
#maincontent > #textcontent h3,
#maincontent > #textcontent h4,
#maincontent > #textcontent h5,
#maincontent > #textcontent h6 {
  padding-left: 10%;
  padding-right: 10%;
  text-align: center;
  max-width: 1000px;
  margin-right: auto;
  margin-left: auto;
}

#maincontent > #textcontent > h1,
#maincontent > h1 {
  font-size: 1.5em;
  margin-block: 0.83em;
}

#maincontent > #textcontent > h2,
#maincontent > h2 {
  font-size: 1.17em;
  margin-block: 1em;
}

#maincontent > #textcontent > h3,
#maincontent > h3 {
  font-size: 1em;
  margin-block: 1.33em;
}

#maincontent > #textcontent > h4,
#maincontent > h4 {
  font-size: 0.83em;
  margin-block: 1.67em;
}

#maincontent > #textcontent > h5,
#maincontent > h5 {
  font-size: 0.67em;
  margin-block: 2.33em;
}

.sideimage {
  position: relative;
}

p.left {
  padding-left: 10%;
  padding-right: 45%;
  text-align: left;
}

p.right {
  padding-right: 10%;
  padding-left: 45%;
  text-align: right;
}

.sideimage img {
  z-index: -1;
}

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

.flex {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flex-reverse {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

.contact-src {
  position: relative;
  margin-left: 2rem;
  margin-right: 2rem;
  /* 100% - ((margin-left + margin-right) * 2) */
  width: calc(100% - 8rem);
  max-width: 30rem;
  height: 4rem;
  margin-top: 2rem;
  padding: 2rem;
  background-color: var(--background-hover);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 1rem;
  flex-shrink: 0;
  overflow: hidden
}

a.contact-src {
  text-decoration: none;
}

.contact-src img {
  max-width: 4rem;
  max-height: 4rem;
  margin-right: 1rem;
}

.contact-src span {
  color: white;
  text-decoration: none;
}

.contact-src span a {
  color: white;
  text-decoration: none;
}

.project {
  position: relative;
  margin-left: 2rem;
  margin-right: 2rem;
  /* 100% - ((margin-left + margin-right) * 2) */
  width: calc(100% - 8rem);
  max-width: 60rem;
  height: 10rem;
  margin-top: 2rem;
  padding: 2rem;
  background-color: var(--background-hover);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 1rem;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
}

.project.blog {
  height: auto;
  min-height: 10rem;
}

a.project {
  text-decoration: none;
}

#linkcontainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}

.link {
  position: relative;
  height: 8rem;
  margin: 1rem;
  padding: 2rem;
  background-color: var(--background-hover);
  justify-content: center;
  align-items: center;
  display: flex;
  border-radius: 1rem;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
  border: none;
}

.link:active {
  filter: brightness(75%) !important;
}

.link:hover {
  filter: brightness(90%);
}


.project .name {
  color: white;
  text-decoration: none;
  font-size: 2.5rem;
  margin-right: 3rem;
  white-space: nowrap;
}

.project.blog .name {
  white-space: wrap;
}

.link .name {
  color: white;
  text-decoration: none;
  text-align: center;
  font-size: 2.5rem;
  white-space: nowrap;
}

.project .description {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  text-align: right;
  margin-left: auto;
}

.tag {
  position: absolute;
  padding: 0.5rem;
  font-size: 1.5rem;
  left: 0;
  top: 0;
  border-radius: 0 0 1rem 0;
  color: var(--background-hover) !important;
}

.contact-src .tag {
  left: auto;
  right: 0;
  border-radius: 0 0 0 1rem;
}

.widget p {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

small {
  font-size: 70%;
}

.buttoncontainer {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.buttoncontainer img {
  width: 88px;
  height: 31px;
  image-rendering: smooth;
}

.buttoncontainer > span, .buttoncontainer > a {
  width: 88px;
  height: 31px;
  margin: 0;
}

#buttons h1 {
  margin-bottom: 1rem;
}

.language {
  display: grid;
  grid-template-columns: auto auto;
}

.language .name {
  margin-bottom: 0.5rem;
  width: auto;
}

.language progress {
  /* For some reason margin-right doesn't work as expected here */
  width: calc(100% - 1rem);
  margin-left: 1rem;
  background-color: var(--background);
  border-width: 0;
  border-radius: 5px;
  height: 10px;
  margin-top: auto;
  margin-bottom: auto;

  /* for chrome (it is silly) */
  overflow: hidden;
}

/* how is this not standardized yet */
.language progress::-moz-progress-bar {
  background-color: var(--link);
}
.language progress::-webkit-progress-bar {
  background-color: var(--background);
}
.language progress::-webkit-progress-value {
  background-color: var(--link);
}

#time > p:has(time) {
  display: flex;
  align-items: center;
  justify-content: center;
}

#time time {
  padding: 1rem;
  border-radius: 1rem;
  background-color: var(--background);
  color: var(--link);
}

#time small time {
  padding: 0.7rem;
  border-radius: 0.7rem;
}

.widget .focus {
  margin-left: 1rem;
  margin-right: 1rem;
  padding-top: 1rem;
  width: auto;
  display: block;
  text-align: center;
  padding-bottom: 1rem;
  border-radius: 1rem;
  background-color: var(--background);
  color: var(--link)
}

.webring {
  text-decoration: none;
}


.webring a {
  display: inline-block;
  text-decoration: none;
  border-color: var(--link);
  border-width: 2px;
  border-style: solid;
  color: var(--link);
  width: 2rem;
  height: 2.25rem;
  text-align: center;
  vertical-align: middle;
  border-radius: 0.5rem;
  font-weight: 300;
  font-size: 30px;
}

@keyframes rollingdice {
  0% {content: "⚀";}
  16% {content: "⚁";}
  33% {content: "⚂";}
  50% {content: "⚃";}
  66% {content: "⚄";}
  83% {content: "⚅";}
  100% {content: "⚀";}
}

.webring a.random::after {
  display: inline-block;
  transform: translateY(-3px);
  content: "";
  font-size: 70%;
  font-weight: 500;
  animation-name: rollingdice;
  animation-duration: 0.75s;
  animation-iteration-count: infinite;
  animation-delay: 0s;
  animation-fill-mode: forwards;
  font-family: "Noto Sans Symbols 2";
}

.webring a.previous::after {
  display: inline-block;
  content: "‹";
}

.webring a.next::after {
  display: inline-block;
  content: "›";
}

.webring a.site::after {
  display: inline-block;
  content: "🛈";
  font-size: 60%;
  transform: translateY(-2px);
  padding: 2px;
  border-width: 2px;
  border-color: var(--link);
  border-radius: 100%;
  font-family: "Noto Sans Symbols 2";
}

.widget h1 {
  font-size: 1.17em;
  margin-block-start: 1em;
  margin-block-end: 1em;
}

.widget h2 {
  font-size: 1em;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.widget {
  position: relative;
}

#hello .pfp {
  border-radius: 100%;
  float: right;
  margin-top: 2rem;
  margin-left: 0.75rem;
  width: 20rem;
  shape-outside: margin-box;
}

#maincontent > #nlContainer > p {
  text-align: center;
}

#newsletterBox {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--background-hover);
  padding: 2rem 2rem 2rem 2rem;
  margin: 2rem 1rem 2rem 1rem;
  border-radius: 1rem;

  p {
    padding: 0;
    margin: 0;
  }

  .inputContainer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .inputContainer:has(input[type=checkbox]:checked) > label::before {
    content: '✓';
    color: var(--link);
  }

  .inputContainer:has(input[type=checkbox]) > label::before {
    /* the layout gets weird with empty content */
    content: '✗';
    color: transparent;

    background-color: var(--background);
    text-align: center;
    display: inline-block;
    width: 2rem;
    height: 2rem;
    margin-right: 0.5rem;
    border-radius: 20%;
  }

  .inputContainer:has(input[type=checkbox]) > label {
    cursor: pointer;
  }

  /* add this once it's baseline https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing */
  input[type=email], input[type=text] {
    padding: 0.5rem;
    border: none;
    display: inline;
    text-align: left;
    border-radius: 1rem;
    background-color: var(--background);
    color: var(--link);
    width: 30rem;
    max-width: calc(100vw - 12rem);
    font-size: 1.5rem;
  }

  #robot {
    width: 15rem;
    max-width: calc(100vw - 15rem);
  }

  input[type=checkbox] {
    display: none;
  }

  .submit {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  input[type=submit], input[type=button] {
    padding: 0.4rem;
    background: var(--background-hover);
    border-color: var(--link);
    border-width: 2px;
    border-style: solid;
    color: var(--link);
    border-radius: 0.5rem;
    font-size: 1.75rem;
    cursor: pointer;
  }
}

.info {
  position: relative;
  font-size: 85%;
  cursor: help;
  font-family: "Noto Sans Symbols 2";
}



.info[aria-label]::after {
  content: attr(aria-label);
  display: none;

  position: absolute;

  background-color: var(--background);
  border-width: 4px;
  border-color: var(--background-hover);
  border-style: solid;
  padding: 1rem;
  border-radius: 0.5rem;

  z-index: 10;

  width: min(30rem, 60vw);
  float: left;
  left: max(-20vw, calc(50% - min(30rem, 90vw) / 2));
  bottom: 2rem;
}

.info[aria-label]:hover::after {
  display: inline;
}


@container maincontent (max-width: 900px) {
  .project {
    flex-direction: column;
    overflow: hidden;
    height: auto;
  }
  .project .name {
    font-size: 2rem;
    margin-right: 0;
    padding-right: 1rem;
    padding-left: 1rem;
    white-space: wrap;
    text-align: center;
  }
  .project .description {
    padding-top: 1rem;
    text-align: center;
    margin: 0;
  }
  .project .tag {
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 1rem 1rem;
    white-space: nowrap;
  }
  .project:has(.tag) .name {
    padding-top: 1rem;
  }
}

@container maincontent (max-width: 600px) {
  .contact-src {
    flex-direction: column;
    height: auto;
    font-size: 5cqw;
  }
  .contact-src img {
    margin-right: 0;
    margin-bottom: 1rem;
    max-width: 3.5rem;
    max-height: 3.5rem;
  }
  .contact-src .tag {
    right: 50%;
    transform: translateX(50%);
    border-radius: 0 0 1rem 1rem;
    white-space: nowrap;
    font-size: 1.2rem;
  }
  .contact-src:has(.tag) img {
    margin-top: 1rem;
  }


  #textcontent, #maincontent > #nlContainer > #newsletterBox {
    font-size: 66%;
  }

  #newsletterBox {
    input[type=email] {
      font-size: 1.2rem;
    }
  }
}

@container maincontent (max-width: 1100px) {
  button.link {
    box-sizing: content-box;
    margin-bottom: 3rem;
  }

  .link {
    height: 2.5rem;
    padding: 1rem;
    margin: 0.5rem;
  }

  .link .name {
    font-size: 1.5rem;
  }
}

@container maincontent (max-width: 90rem) {
  /* a lot of !important but everywhere else it uses the id and here the element with the id is the container so i cant reference it */
  .widgetcontainer {
    width: 100% !important;
    grid-template-columns: 100% !important;
  }

  /* On desktop, the most important widgets are the widest and in the middle.
   * On mobile, the most imporant widgets should be the same size but before all others
   */
  .widgetcontainer > :first-child {
    grid-area: 3/1;
  }

  .widget {
    margin: 2rem !important;
  }

  .widgetsubcontainer > :last-child {
    margin-bottom: 0 !important;
  }

  #hello .pfp {
    width: calc(9rem + 10vw);
  }
}

@container maincontent (max-width: 500px) {
  .widgetcontainer {
    font-size: 1rem !important;
  }

  #hello .pfp {
    width: calc(70vw - 10rem);
  }
}
