@font-face {
  font-family: "DM Sans Backup";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(../fonts/DMSansBackup.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "DM Sans Backup";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(../fonts/DMSansBackup2.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  --header-height: 270px;
  --header-font-size: 2.3rem;
  --max-width: 1440px;
  --decorative-element-height: 30px;
  --line-height-adjustment: 3.5;
}

body {
  font-family: "DM Sans", "DM Sans Backup", "Arial", sans-serif;
  width: 100vw;
  margin: 0;
  overflow-x: hidden;
}

.website-header {
  --animated-header-width: min(80vw, calc(var(--max-width) * 8 / 10));
  background-image: var(--animated-header);
  background-size: var(--animated-header-width) auto;
  background-position: top 0 right
    calc(50% - (min(var(--max-width), 100vw) * 1 / 12));
  background-repeat: no-repeat;
  background-color: #000;
  box-sizing: border-box;
  padding: 35px 0;
  width: 100vw;
  height: var(--header-height);
  min-height: 125px;
  max-height: var(--header-height);
  position: fixed;
  top: 0;
  z-index: 10000;
}

@keyframes header-min {
  from {
    height: var(--header-height);
  }
  to {
    height: 125px;
  }
}

@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  @media (min-width: 1276px) {
    .website-header {
      animation: header-min linear forwards;
      animation-timeline: scroll();
      animation-range: 0 135px;
    }
  }
}

.website-header::after {
  content: "";
  background-color: #000;
  height: var(--decorative-element-height);
  width: calc(
    50% + var(--decorative-element-height) -
      (min(var(--max-width), 100vw) * 2 / 12)
  );
  transform: skew(-45deg);
  transform-origin: bottom;
  position: absolute;
  bottom: calc(-1 * var(--decorative-element-height));
  right: calc(50% + (min(var(--max-width), 100vw) * 4 / 12));
}

.website-header > nav {
  display: flow-root;
  margin: 0 auto;
  padding: 0 min(8.3%, calc(var(--max-width) * 8.3 / 100));
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--max-width);
  background: transparent;
}

.website-header a {
  color: #fff;
  font-size: 1.16rem;
  text-decoration: none;
}

.website-logo {
  float: left;
}

@media (max-width: 630px) {
  .website-logo img {
    width: calc(75vw - 10px);
  }
}

.navigation-wrapper {
  --navigation-gap: 25px;
  float: right;
  display: flex;
  gap: calc(var(--navigation-gap) * 2);
  translate: 0 -4px;
}

.menu-button {
  display: none;
  position: absolute;
  top: -35px;
  right: 0;
}

.menu-button img {
  width: 50px;
  height: auto;
}

@media (max-width: 1275px) {
  .website-header {
    box-sizing: content-box;
    height: auto;
    max-height: initial;
    min-height: initial;
    padding-bottom: 20px;
  }

  .menu-button {
    display: block;
    padding: 0;
    border: none;
    background: none;
  }

  .navigation-wrapper {
    display: none;
    flex-flow: column nowrap;
    float: none;
    align-items: center;
    clear: left;
    translate: 0;
    padding-top: 20px;
    gap: 20px;
  }

  .navigation-wrapper.menu-open {
    display: flex;
  }

  .navigation-wrapper .main-navigation {
    flex-flow: column nowrap;
    align-items: center;
    gap: 10px;
  }

  .navigation-wrapper .language-selector {
    justify-content: center;
  }

  .main-navigation a {
    display: inline-block;
  }
}

.language-selector,
.main-navigation {
  display: flex;
  gap: var(--navigation-gap);
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
}

.language-selector {
  text-transform: uppercase;
  position: relative;
}

.language-selector li:first-child::before {
  content: var(--nav-slash-icon);
  position: absolute;
  left: calc(100% + (var(--navigation-gap) / 2));
  top: 50%;
  translate: -50% -50%;
}

.language-selector > li {
  position: relative;
}

.language-selector > .current,
.main-navigation > .current {
  font-weight: 800;
}

.language-selector > li::after,
.main-navigation > li::after {
  display: block;
  height: 2px;
  width: 100%;
  background-color: #fff;
  content: "";
  translate: 0 2px;
  transform-origin: left;
  transition: scale 0.5s;
}

.language-selector > :not(.current)::after,
.main-navigation > :not(.current)::after {
  scale: 0 1;
}

.language-selector > :not(.current):hover::after,
.main-navigation > :not(.current):hover::after {
  scale: 1 1;
}

.animated-header {
  position: absolute;
  width: 75%;
  max-width: var(--max-width);
  top: 0;
  right: 8.3%;
  height: 320px;
}

main {
  --top-padding: clamp(55px, var(--header-height), 270px);
  display: grid;
  grid-template-columns: 2fr 10fr;
  grid-auto-rows: min-content;
  max-width: var(--max-width);
  min-height: calc(
    100lvh - var(--top-padding) - (2 * var(--decorative-element-height))
  );
  margin: 0 auto;
  padding-top: var(--top-padding);
}

@media (max-width: 1275px) {
  main {
    --top-padding: 111px;
  }
}

@media (max-width: 690px) {
  main {
    display: block;
  }
}

.main-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-bottom: calc(50% - var(--decorative-element-height));
  padding-top: 50%;
}

@media (max-width: 690px) {
  .main-header {
    display: none;
  }
}

.main-header > h1 {
  font-size: 73.6px;
  font-weight: 800;
  margin: 0;
  writing-mode: sideways-lr;
  position: sticky;
  top: calc(125px + 2 * var(--decorative-element-height));
  translate: 22.5%;
  overflow: hidden;
  background-color: #fff;
  background-clip: content-box;
}

@media (max-height: 471px) {
  .main-header > h1 {
    position: relative;
    top: 0;
  }
}

@media (min-height: 472px) {
  .main-header > h1 {
    font-size: 45px;
  }
}

@media (min-height: 600px) {
  .main-header > h1 {
    font-size: 60px;
  }
}

@media (min-height: 660px) {
  .main-header > h1 {
    font-size: 73.6px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .main-header > h1::after {
    content: "";
    width: 100%;
    height: 200%;
    position: absolute;
    left: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(
      to top,
      rgb(255 255 255) 50%,
      rgb(255 255 255 / 0) 100%
    );
    animation: 1.2s ease-in forwards reveal-header;
  }
}

@keyframes reveal-header {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 100%;
  }
}

.main-content {
  --cap-line-offset: 0px;
  --space-between: 23px;
  padding: calc(10% - var(--cap-line-offset)) 20%
    calc(10% - var(--decorative-element-height)) 10%;
  position: relative;
  overflow: hidden;
}

.main-content:not(.portfolio) {
  background-color: #fff;
  background-clip: content-box;
}

@media (max-width: 690px) {
  main > .main-content {
    --one-module: calc((100% / 8));
    padding: var(--one-module) var(--one-module)
      calc(var(--one-module) - var(--decorative-element-height));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .main-content:not(.portfolio)::after {
    content: "";
    width: 200%;
    height: 200%;
    position: absolute;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(
      to top left,
      rgb(255 255 255) 50%,
      rgb(255 255 255 / 0) 100%
    );
    animation: 1.5s ease-in forwards reveal-main-content;
  }
}

@keyframes reveal-main-content {
  from {
    translate: 0 0;
  }
  to {
    translate: 100% 100%;
  }
}

.main-content :where(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 800;
}

.main-content b {
  font-weight: 800;
}

.achievements,
.project-details,
.portfolio {
  --cap-line-offset: calc(
    1 * var(--header-font-size) / var(--line-height-adjustment)
  );
}

.achievements h2 {
  font-size: var(--header-font-size);
  margin-bottom: var(--space-between);
}

.achievements h2:has(+ .achievement-category-subtitle) {
  margin-bottom: 0;
}

.achievement-category-subtitle {
  display: inline-block;
  font-size: calc(var(--header-font-size) - 1rem);
  margin-bottom: var(--space-between);
}

.achievements .achievement-category:not(:last-child) {
  margin-bottom: calc(
    2 * var(--space-between) - (var(--header-font-size) / 3.3)
  );
}

.achievement-category > .achievement {
  --achievement-font-size: 1rem;
  display: grid;
  grid-template-columns: 140px 1fr;
  grid-template-areas: "achievement-date achievement-title" "achievement-date achievement-description" "achievement-date achievement-place";
  margin-bottom: var(--space-between);
}

.achievement-category > .achievement:last-child {
  margin-bottom: 0;
}

@media (max-width: 690px) {
  .achievement-category > .achievement {
    grid-template-columns: 110px 1fr;
  }
}

.achievement > .achievement-date {
  grid-area: achievement-date;
  position: relative;
  padding-right: 12px;
  margin-right: 10px;
  font-weight: 800;
  text-align: right;
  translate: 0
    calc(-1 * var(--achievement-font-size) / var(--line-height-adjustment));
}

.achievement > .achievement-date::after {
  --height-adjustement: calc(
    var(--achievement-font-size) / var(--line-height-adjustment) - 1px
  );
  position: absolute;
  top: var(--height-adjustement);
  right: 0;
  width: 2px;
  height: calc(100% - var(--height-adjustement));
  background-color: #000;
  content: "";
}

.achievement > .achievement-title {
  grid-area: achievement-title;
  translate: 0
    calc(-1 * var(--achievement-font-size) / var(--line-height-adjustment));
}

.achievement > .achievement-description {
  grid-area: achievement-description;
  margin: 5px 0 10px;
}

.achievement > .achievement-description:last-child {
  margin-bottom: 0;
}

.achievement-description strong {
  display: inline-block;
  margin-top: 10px;
}

.achievement > .achievement-place {
  grid-area: achievement-place;
}

.achievement-description p,
.achievement-place p {
  margin: 0;
}

.about-me {
  display: grid;
  grid-template-columns: 240px 1fr;
}

@media (max-width: 1100px) {
  .about-me {
    padding-right: 10%;
  }
}

@media (max-width: 900px) {
  .about-me {
    display: block;
  }
}

.about-image {
  width: 100%;
  max-width: 240px;
  border-radius: 50%;
}

@media (max-width: 900px) {
  .about-image {
    display: block;
    margin: 0 auto 25px;
  }
}

.about-desciption,
.contact-text,
.achievement-description,
.project-details p {
  font-size: 1rem;
  line-height: 1.2;
}

.about-desciption,
.contact-text {
  padding-left: 10%;
  translate: 0 calc(-1rem * 0.21);
}

@media (max-width: 690px) {
  .about-desciption,
  .contact-text {
    padding: 0;
  }
}

.about-desciption p,
.contact-text p {
  margin-top: 19px;
}

.about-desciption p:first-child,
.contact-text p:first-child {
  margin-top: 0;
}

.about-desciption p:last-child {
  margin-bottom: 0;
}

.contact-text {
  padding-left: 0;
  margin-bottom: 31px;
}

.contact-info {
  display: flex;
  flex-flow: column nowrap;
  justify-content: space-between;
  gap: 15px;
}

.contact-info a {
  display: inline-block;
  box-sizing: border-box;
  width: 100%;
  color: #000;
  font-weight: 800;
  word-wrap: break-word;
  text-decoration: none;
  padding-left: 48px;
  background: center left / 24px auto no-repeat;
  line-height: 1.5;
}

.portfolio {
  --portfolio-gap: 17px;
  --number-of-columns: 3;
  --project-adjust-for-gap: calc(
    (var(--number-of-columns) - 1) / var(--number-of-columns)
  );
  --max-project-width: calc(
    (100% / var(--number-of-columns)) -
      (var(--portfolio-gap) * var(--project-adjust-for-gap))
  );
}

.portfolio h2 {
  font-size: var(--header-font-size);
  margin-bottom: var(--space-between);
}

.portfolio .project-category:not(:last-child) {
  margin-bottom: calc(
    2 * var(--space-between) - (var(--header-font-size) / 3.3)
  );
}

.portfolio .projects {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(250px, var(--max-project-width))
  );
  gap: var(--portfolio-gap);
}

@media (max-width: 1343px) {
  .portfolio {
    --number-of-columns: 2;
  }
}

@media (max-width: 886px) {
  .portfolio {
    --number-of-columns: 1;
  }
}

.portfolio .project {
  aspect-ratio: 1.78/1;
  overflow: hidden;
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .portfolio .project {
    opacity: 0;
    animation: 1.5s ease-in-out calc(0.3s * var(--project-index)) forwards
      reveal-portfolio;
  }
}

@keyframes reveal-portfolio {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.project-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  scale: 1;
  transition: scale 0.6s ease-in-out;
}

.project-overlay {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  text-decoration: none;
  background-color: rgb(0 0 0 / 0.45);
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.project-overlay::after {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 50%;
  aspect-ratio: 1;
  content: "";
  background: var(--arrow-icon-url) no-repeat bottom right / 100%;
  translate: 100% 100%;
  transition: translate 0.6s ease-in-out;
  z-index: 100;
}

.project:hover > .project-overlay {
  opacity: 1;
}

.project:hover > .project-overlay::after {
  translate: 0 0;
}

.project:hover > .project-thumbnail {
  scale: 1.2;
}

.project-overlay > h3 {
  font-size: 1.2rem;
}

.project-overlay > h4 {
  font-size: 0.8rem;
  font-weight: 300;
}

.project-details {
  --project-details-margin-adj: calc(1rem * 0.21);
}

.project-details h2 {
  font-size: var(--header-font-size);
  margin: 0;
}

.project-details p {
  margin: calc(var(--space-between) - var(--project-details-margin-adj))
    calc(1 / 7 * 100%);
}

.project-details > img:last-child,
.project-details > p:last-child {
  margin-bottom: 0;
}

.project-details-gallery,
.project-details-image {
  margin: calc(2 * var(--space-between)) 0;
  display: block;
}

.project-details-image {
  width: 100%;
  aspect-ratio: 1.78/1;
  object-fit: cover;
}

.gallery-view {
  width: 100%;
  aspect-ratio: 1.78/1;
  margin-bottom: var(--space-between);
  overflow: hidden;
  position: relative;
}

.gallery-view img,
.gallery-view video {
  display: none;
  width: 100%;
  aspect-ratio: 1.78/1;
  position: absolute;
  top: 0;
  left: 0;
  translate: 100%;
  object-fit: cover;
}

.gallery-view .gallery-view-active-image {
  display: block;
  translate: 0;
}

.gallery-view .gallery-previous,
.gallery-view .gallery-next {
  height: 91%;
  min-width: 100px;
  padding: 0 10px;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  text-align: left;
  z-index: 1000;
  border: none;
  background: transparent;
}

.gallery-previous img,
.gallery-next img {
  display: block;
  height: 10.5%;
  width: auto;
  aspect-ratio: initial;
  object-fit: contain;
  position: absolute;
  top: 55%;
  left: 10%;
  translate: 0 -50%;
  scale: 1;
  transition: scale 0.2s, translate 0.2s;
}

.gallery-next img {
  left: initial;
  right: 10%;
}

.gallery-previous img {
  transform-origin: center;
  rotate: 180deg;
}

.gallery-previous:hover img {
  scale: 1.05;
  translate: -15% -50%;
}

.gallery-next:hover img {
  scale: 1.05;
  translate: 15% -50%;
}

.gallery-view .gallery-next {
  left: initial;
  right: 0;
  text-align: right;
}

.gallery-view-loading {
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -10;
}

.gallery-view-loading > img {
  display: block;
  width: 48px;
  aspect-ratio: 1;
  position: relative;
  translate: 0;
  background-color: #000;
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2);
  }
  100% {
    box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
  }
}

.gallery-view-loading > p {
  width: min-content;
  margin: 0;
  font-size: 1.3rem;
}

.gallery-selection {
  --gallery-selection-gap: calc(var(--space-between) - 2px);
  width: 100%;
  display: flex;
  overflow: hidden;
  gap: var(--gallery-selection-gap);
}

@media (max-width: 1000px) {
  .gallery-selection {
    display: none;
  }
}

.gallery-item-thumb {
  position: relative;
  background: transparent;
  display: block;
  overflow: hidden;
  border: none;
  padding: 0;
  flex: 1 0 calc(20% - (var(--gallery-selection-gap) * 4 / 5));
}

.gallery-item-thumb::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: "";
  background: var(--plus-sign-url) center / auto 25% no-repeat,
    rgb(0 0 0 / 0.45);
  translate: 110%;
  rotate: 20deg;
  transition: rotate 0.3s;
  z-index: 10;
}

.gallery-item-thumb.gallery-thumb-activ::after {
  rotate: 0deg;
  translate: 0;
}

.gallery-item-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1.78/1;
  object-fit: cover;
}

footer {
  height: var(--decorative-element-height);
  width: 100%;
  padding-top: var(--decorative-element-height);
  background-color: #000;
  background-clip: content-box;
  position: relative;
  overflow: hidden;
}

footer::after {
  content: "";
  background-color: #000;
  height: var(--decorative-element-height);
  width: calc(
    50% + var(--decorative-element-height) -
      (min(var(--max-width), 100vw) * 5 / 12)
  );
  transform: skew(-45deg);
  transform-origin: bottom;
  position: absolute;
  top: 0;
  left: calc(
    50% - var(--decorative-element-height) +
      (min(var(--max-width), 100vw) * 5 / 12)
  );
}

.ui-dialog {
  z-index: 10000 !important;
}

.aframe {
  min-height: 100vh;
}
