@font-face {
  font-family: "AdobeMyungjo";
  src: url(public/AdobeMyungjoStdM.otf) format("opentype");
}

:root {
  --body-width: calc(2.5 * var(--project-width));
  --project-width: 300px;
  --project-overlap: 100px;
}
::selection {
  background: #271657;
}
::-webkit-scrollbar {
  width: 1px;
  height: 1px;
}
::-webkit-scrollbar-thumb {
  background-color: #f2f2f2;
  border-radius: 12px;
}
body {
  font-family: "AdobeMyungjo", sans-serif;
  max-width: var(--body-width);
  margin: 0 auto;
  padding: 0 16px 24px; /* 24px = webring's fixed offset from the bottom */
  min-height: 100dvh;
  box-sizing: border-box; /* keep padding inside 100dvh so there's no overflow */
  display: flex;
  flex-direction: column;
  background-color: #080404;
  color: #f2f2f2;
  overflow-x: hidden;
  /* border-style: solid; */
}
p {
  font-size: small;
  margin: 0;
}
.intro {
  margin-bottom: 16px;
}

.hidden {
  opacity: 0;
  filter: blur(5px);
  transform: translateX(-100%);
  transition: all 1s;
}
.show {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
}

/* header section */
#header {
  display: flex;
  margin-top: 32px;
  margin-bottom: 16px;
}
#header h1 {
  margin: 0;
}
#header a,
#interests-section a,
#webring a {
  color: #d8e9a8;
  transition: color 0.2s ease-out;
}
#header a:hover,
#interests-section a:hover,
#webring a:hover {
  color: #a2af7e;
}
#avocado {
  width: 200px;
  height: 200px;
}
#aboutme {
  flex: 1;
  margin-top: 12px;
}

/* navbar */
.navbar {
  position: relative;
  white-space: nowrap;
  transition-delay: 100ms;
}
.underline {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 20%;
  height: 1px;
  pointer-events: none;
  background: #f2f2f2;
  border-radius: 12px;
  transition: transform 0.5s ease-in-out;
}
.navbar button {
  display: inline-block;
  width: 20%;
  text-align: center;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
}

#sections {
  position: relative;
  flex: 1 1 auto; /* grow to fill leftover viewport height */
  min-height: 450px;
  /* border-style: solid; */
}
/* projects section */
#projects-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  visibility: visible;
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
  transition: all 1.5s ease;
}
.projects-viewport {
  position: relative;
}
.projects-wrapper {
  overflow: auto;
  transition: all 1s ease-out;
}
.projects {
  display: flex;
  width: calc(
    (var(--project-width) - var(--project-overlap)) * 11
  ); /* (project_width - overlap)*(num_projects+1) */
}
.project {
  position: relative;
  transition: all 1s;
  left: calc(-1 * var(--project-overlap) * var(--i)); /* overlap */
}
.project:nth-child(2) {
  transition-delay: 400ms;
}
.project:nth-child(3) {
  transition-delay: 700ms;
}
.project:nth-child(4) {
  transition-delay: 750ms;
}
.project:nth-child(5) {
  transition-delay: 900ms;
}
.project:hover .overlay {
  opacity: 0.4;
}
.project:hover .arrow {
  opacity: 1;
}
.project:hover ~ .project {
  left: calc(var(--project-overlap) * (1 - var(--i)));
  /* fix transition delay in events.js */
}
.project img {
  width: var(--project-width);
}
.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  transition: 0.5s ease;
  background-color: #000;
}
.arrow {
  color: #f2f2f2;
  font-size: 32px;
  position: absolute;
  top: calc(50% - 6px);
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  transition: 0.5s ease;
}
#leftarrow,
#rightarrow {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
}
#leftarrow {
  position: absolute;
  top: calc(50% - 6px);
  left: -32px;
  transform: translate(0, -50%);
  opacity: 0;
  transition: all 1s;
  transition-delay: 1.5s;
}
#rightarrow {
  position: absolute;
  top: calc(50% - 6px);
  right: -32px;
  transform: translate(0, -50%);
  opacity: 0;
  transition: all 1s;
  transition-delay: 1.5s;
}
#leftarrow:hover,
#rightarrow:hover {
  cursor: pointer;
}

/* music section — top tracks */
#music-section {
  position: absolute;
  top: 0;
  bottom: 0; /* fill #sections so the list can grow with the viewport */
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  filter: blur(5px);
  transform: translateX(100vw);
  transition: all 1.5s ease;
}
#music-section h3 {
  margin-bottom: 16px;
}
#music-section .subtitle {
  color: #a2af7e;
  font-size: small;
}
.tracks-wrapper {
  display: flex;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-height: 0; /* allow the scroll area to shrink/grow within the flex column */
}
#top-tracks {
  width: 100%;
  max-height: 100%; /* fills the section; scrolls when the list is longer */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 6px;
}
.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease-out;
  opacity: 0; /* hidden until the music tab opens; revealed by the cascade below */
}
#music-section.show-tracks .track {
  animation: trackIn 0.5s ease-out both;
  animation-delay: calc(0.6s + var(--i) * 0.12s);
}
@keyframes trackIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .track {
    opacity: 1;
  }
  #music-section.show-tracks .track {
    animation: none;
  }
}
.track:hover {
  background-color: #ffffff14;
}
.track-rank {
  flex: 0 0 22px;
  text-align: right;
  font-size: small;
  color: #a2af7e;
  font-variant-numeric: tabular-nums;
}
.track-art {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  background-color: #1a1414; /* placeholder if a cover is missing */
}
.track-meta {
  display: flex;
  flex-direction: column;
  min-width: 0; /* let long titles/artists ellipsize instead of overflowing */
  line-height: 1.35;
}
.track-name {
  font-size: small;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist {
  font-size: x-small;
  color: #a2af7e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tracks-empty {
  text-align: center;
  color: #a2af7e;
}

/* interests section */
#interests-section {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  opacity: 0;
  filter: blur(5px);
  transform: translateX(100vw);
  transition: all 1.5s ease;
}
#interests-section h3 {
  margin-bottom: 0;
}

/* webring section */
#webring {
  text-align: center;
  opacity: 0;
  transition: all 1s;
  transition-delay: 2s;
}
#webring a {
  text-decoration: none;
}

@media only screen and (max-width: 500px) {
  :root {
    --project-overlap: 180px;
  }
  #header {
    margin-bottom: 32px;
  }
  #avocado {
    width: 100px;
    height: 100px;
  }
  .underline {
    width: 30%;
  }
  .navbar button {
    width: 30%;
  }
  #leftarrow {
    display: none;
  }
  #rightarrow {
    display: none;
  }

  #top-tracks {
    max-height: 100%;
  }
}

@media (pointer: coarse) {
  html {
    max-width: 100%;
    overflow-x: hidden;
  }
}
