:root {
  --background: #212121;
  --background-light: #2a2a2a;
  --background-lighter: #2c2c2c;
  --background-alt: #181818;
  --border-color: #414141;
  --text-color: #fffcf3;
  --accent: #6fffae;
  --accent-gradient: #6fffe9;

  --mac-red: #fc5753;
  --mac-yellow: #fdbc40;
  --mac-green: #36c84b;

  --box-shadow-light: 0 0 5px black, 0 0 10px black, 5px 5px 30px black;
  --box-shadow-dark: var(--box-shadow-light), 10px 10px 80px black;

  --greeting-width: 600px;
  --greeting-height: 400px;
  --up-down-distance: -6px;

  --separator-height: calc(100vw / 500 * 39);

  --font-family: "Ubuntu", sans-serif;
  --font-family-accent: "Acorn", "Ubuntu", sans-serif;
  --font-family-mono: "Cousine", monospace;
}

@font-face {
  font-family: "Acorn";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("font/Acorn-SemiBold.woff") format("woff");
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("font/Ubuntu-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("font/Ubuntu-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Cousine";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("font/Cousine-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("font/PlayfairDisplay-Italic.ttf") format("truetype");
}

@keyframes gradient {
  from { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

@keyframes up-down {
  from { translate: 0 0; }
  50% { translate: 0 var(--up-down-distance); }
  to { translate: 0 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  background-color: var(--background);
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 0;
  font-size: 18px;
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

h1 {
  font-size: 64px;
  margin: 0;
}

h2 {
  margin: 0;
  font-size: 32px;
}

.accent,
a {
  color: transparent;
  background: linear-gradient(to left, var(--accent), var(--accent-gradient));
  background-size: 400% 400%;
  background-clip: text;
  animation: 15s gradient ease-in-out;
  font-family: var(--font-family-accent);
  text-decoration-color: var(--accent);
}

#greeting-container {
  width: 100vw;
  height: 100vh;
}

#greeting-container > img,
#greeting-main {
  border-radius: 1em;
  overflow: hidden;
  display: inline-block;
}

#greeting-img-ul,
#greeting-img-ll,
#greeting-img-ur,
#greeting-img-lr {
  box-shadow: var(--box-shadow-light);
  position: absolute;
}

#greeting-img-ul {
  width: 200px;
  left: calc(50vw - var(--greeting-width) / 2 - 150px);
  top: calc(50vh - var(--greeting-height) / 2 - 75px);

  opacity: 0;
  animation: 4s ease-in-out up-down infinite -1.75s,
             1s ease-out fade-in forwards;
}

#greeting-img-ur {
  height: 200px;
  left: calc(50vw + var(--greeting-width) / 2 - 50px);
  top: calc(50vh - var(--greeting-height) / 2 - 25px);

  opacity: 0;
  animation: 4s ease-in-out up-down infinite -2.25s,
             1s ease-out fade-in forwards 0.1s;
}

#greeting-img-ll {
  height: 200px;
  left: calc(50vw - var(--greeting-width) / 2 - 300px);
  top: calc(50vh + var(--greeting-height) / 2 - 125px);

  opacity: 0;
  animation: 4s ease-in-out up-down infinite -2.75s,
             1s ease-out fade-in forwards 0.15s;
}

#greeting-img-lr {
  width: 200px;
  left: calc(50vw + var(--greeting-width) / 2 - 100px);
  top: calc(50vh + var(--greeting-height) / 2 - 175px);

  opacity: 0;
  animation: 4s ease-in-out up-down infinite -1.25s,
             1s ease-out fade-in forwards 0.25s;
}

#greeting-main {
  position: absolute;
  padding: 32px 48px;
  left: calc(50vw - var(--greeting-width) / 2);
  top: calc(50vh - var(--greeting-height) / 2);
  width: var(--greeting-width);
  height: var(--greeting-height);
  box-sizing: border-box;
  border: 4px solid var(--border-color);
  background-color: var(--background);
  box-shadow: var(--box-shadow-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#greeting-main h1 {
  font-size: 48px;
}

#greeting {
  font-size: 78px;
  font-family: var(--font-family-accent);
}

#continue-arrow {
  fill: white;
  width: 32px;
  height: 32px;
  position: absolute;
  bottom: calc(16px);
  left: calc(50vw - 16px);
  
  opacity: 0;
  --up-down-distance: -12px;
  animation: 4s ease-in-out up-down infinite, 2s ease-out fade-in forwards 2s;
}

#about-container {
  width: 100vw;
  min-height: 100vh;
  padding: 60px 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--background-alt);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

#about {
  text-align: center;
  box-sizing: border-box;
  width: calc(100vw - 40px);
  max-width: 600px;
  border-bottom: 4px solid var(--border-color);
  padding-bottom: 40px;
  margin-bottom: 40px;
}

#websites-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  max-width: 650px;
}

#websites-list > div {
  box-sizing: border-box;
  max-width: 300px;
  border-radius: 1em;
  border: 4px solid var(--border-color);
  background-color: var(--background);
  box-shadow: var(--box-shadow-light);
  padding: 18px 32px;
}

#experience {
  min-height: 100vh;
  width: 100vw;
  height: 1440px;
  box-sizing: border-box;
  padding: 40px 0;
}

#experience h1 {
  text-align: center;
}

#window-container {
  position: relative;
  width: 0;
  left: calc(50vw);
}

#lang-python {
  left: -550px;
  top: 100px;
}

#lang-typescript {
  left: -100px;
  top: 75px;
  animation-delay: -0.5s;
}

#lang-rust {
  right: -525px;
  top: 240px;
  animation-delay: -1s;
}

#lang-c {
  left: -450px;
  top: 250px;
  animation-delay: -1.5s;
}

#lang-javascript {
  right: -500px;
  top: 460px;
  animation-delay: -2s;
}

#lang-java {
  left: -525px;
  top: 550px;
  animation-delay: -2.5s;
}

#lang-css {
  right: -550px;
  top: 625px;
  animation-delay: -3s;
}

#lang-php {
  right: -350px;
  top: 925px;
  animation-delay: -3.5s; 
}

#lang-html {
  left: -400px;
  top: 825px;
}

.window {
  --up-down-distance: -2px;

  background-color: var(--background-light);
  display: inline-block;
  border-radius: 0.5em;
  overflow: hidden;
  box-shadow: var(--box-shadow-light);
  position: absolute;
  animation: 4s ease-in-out up-down infinite;
}

.window-upper {
  background-color: var(--background-alt);
  display: flex;
  flex-direction: row;
  gap: 8px;
  height: 18px;
  padding: 6px 8px;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.window-upper [data-button] {
  height: 14px;
  width: 14px;
  border-radius: 7px;
}

.window-upper [data-button="close"] { background-color: var(--mac-red); }
.window-upper [data-button="minimize"] { background-color: var(--mac-yellow); }
.window-upper [data-button="fullscreen"] { background-color: var(--mac-green); }

.window-title {
  flex: 1;
  text-align: center;
  margin-right: 66px;
}

.code-wrapper {
  font-family: var(--font-family-mono);
  white-space: nowrap;
}

.code-wrapper > div {
  padding: 4px 6px;
  padding-right: 40px;
  height: 20.5px;
  white-space: pre;
  min-width: max-content;
}

.code-wrapper > div::before {
  content: "" attr(data-line);
  background-color: var(--background);
  color: var(--border-color);
  height: 20.5px;
  padding: 4px 6px;
  padding-left: 0;
  margin: -4px -6px;
  margin-right: 6px;
  display: inline-block;
  width: 28px;
  text-align: right;
}

.code-wrapper > div:nth-child(even) {
  background-color: var(--background-lighter);
}

[data-code="paren"] { color: #a09e97; }
[data-code="builtin"] { color: #d6be75; }
[data-code="string"] { color: #a1d675; }
[data-code="func"] { color: #79aad5; }
[data-code="type"] { color: #40c7bc; }

#contact {
  background-color: var(--background-alt);
  min-height: calc(100vh + var(--separator-height));
  padding: 20px 0;
  padding-top: calc(20px + var(--separator-height));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 32px;
}

#contact-links svg {
  fill: var(--text-color);
  height: 1.5em;
}

#contact-links {
  display: flex;
  flex-direction: row;
}

#contact-links > div {
  display: flex;
  flex-direction: column;
  width: 50vw;
  box-sizing: border-box;
  padding-top: 40px;
  padding-bottom: 40px;
  gap: 30px;
  justify-content: center;
}

#contact-links > div > * {
  min-width: 1.5em;
  height: 1.5em;
}

#contact-links > div > div {
  display: flex;
  align-items: flex-end;
}

#contact-left {
  padding-right: 15px;
  border-right: 2px solid var(--border-color);
  align-items: end;
}

#contact-right {
  justify-content: left;
  padding-left: 15px;
  border-left: 2px solid var(--border-color);
}

.section-separator {
  fill: var(--background);
  width: 100vw;
  position: absolute;
  scale: 100% -100%;
}

@media (max-width: 1200px) {
  #greeting-img-ul {
    left: calc(50vw - var(--greeting-width) / 2 - 50px);
    top: calc(50vh - var(--greeting-height) / 2 - 225px);
  }

  #greeting-img-ur {
    left: calc(50vw + var(--greeting-width) / 2 - 225px);
    top: calc(50vh - var(--greeting-height) / 2 - 125px);
  }

  #greeting-img-ll {
    left: calc(50vw - var(--greeting-width) / 2 - 100px);
    top: calc(50vh + var(--greeting-height) / 2 - 75px);
  }

  #experience {
    height: auto;
  }

  #window-container {
    display: flex;
    flex-direction: column;
    width: unset;
    position: static;
    gap: 30px;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
  }

  .window {
    position: static;
    display: inline-block;
    width: min-content;
    max-width: calc(100vw - 40px);
    animation: none;
  }

  .code-wrapper {
    overflow-x: scroll;
  }
}

@media (max-width: 600px) {
  :root {
    --greeting-width: 300px;
    --greeting-height: 325px;
  }

  #greeting-img-ll,
  #greeting-img-lr {
    display: none !important;
  }

  #greeting-img-ul {
    left: calc(50vw - var(--greeting-width) / 2 - 25px);
    top: calc(50vh - var(--greeting-height) / 2 - 150px);
  }

  #greeting-img-ur {
    left: calc(50vw + var(--greeting-width) / 2 - 250px);
    top: calc(50vh + var(--greeting-height) / 2 - 50px);
  }
}

@supports (corner-shape: squircle) {
  #greeting-container > img,
  #greeting-main,
  #websites-list > div {
    corner-shape: squircle;
    border-radius: 2em;
  }

  .window {
    corner-shape: squircle;
    border-radius: 1em;
  }
}
