@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,700;1,400&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lobster+Two&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap");
@import url("./prism.css");

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: left;
  background-color: #fff;
}

/* common */
section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #e6e6e6;
}

/* exclude first section */
section:first-child {
  border-top: none;
}

@media (max-width: 700px) {
  section:first-child {
    margin-top: 25px;
    padding-top: 25px;
  }
}

h1 {
  /* font-family: "Lobster", sans-serif; */
  margin: 0;
  font-size: 2rem;
  /* font-weight: 400; */
}

h2 {
  font-size: 1.2rem;
  /* font-weight: 400; */
  margin: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.bold {
  font-weight: 700;
}

/* header, main, footer */
header {
  position: fixed;
  top: 0;
  background-color: #f2f2f2;
  width: 100%;
  height: 300px;
  padding: 0;
  color: #666;
  clip-path: inset(0);
  z-index: 2;
}

header .cover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  opacity: 0.6;
  transition: 0.3s ease-in-out;
}

header .title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family: "Lobster", sans-serif;
  font-size: 4rem;
  font-weight: 400;
  white-space: nowrap;
  text-align: center;
  transition: 0.3s ease-in-out;
}

header .title a {
  color: #212529;
  text-decoration: none;
}

header .nav {
  position: absolute;
  bottom: 5%;
  right: 10%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 20px;
  align-items: center;
  transition: 0.3s ease-in-out;
}

header .nav a {
  font-size: 1rem;
  color: #212529;
  text-decoration: none;
}

header .nav-toggle {
  display: none;
}

header.shrink .cover {
  width: 0;
  height: 0;
}

header.shrink .title {
  left: 10%;
  transform: translate(0, -50%);
  font-size: 2rem;
}

header.shrink .nav {
  top: 50%;
  transform: translate(0, -50%);
}

@media (max-width: 1400px) {
  header .nav a {
    display: none;
  }
  header .nav-toggle {
    display: block;
    font-size: 1.5rem;
    color: #212529;
    cursor: pointer;
  }
}

@media (max-width: 700px) {
  /* shrink */
  header {
    /* added important to override javascript height setting */
    height: 70px !important;
  }
  header .cover {
    width: 0;
    height: 0;
  }
  header .title {
    left: 10%;
    transform: translate(0, -50%);
    font-size: 2rem !important;
  }
  header .nav {
    top: 50%;
    transform: translate(0, -50%);
  }
}

#nav-modal-bg {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1;
}

#nav-modal {
  position: absolute;
  top: 300px;
  width: 100%;
  display: none;
  background-color: rgba(220, 220, 220, 0.95);
  flex-direction: column;
  text-align: center;
  z-index: 2;
}

#nav-modal a {
  font-size: 1rem;
  color: #212529;
  text-decoration: none;
  padding: 10px;
}

#nav-modal a:not(:first-child) {
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

#nav-modal a:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

main {
  padding-top: 300px;
  margin: 0 10%;
}

@media (max-width: 700px) {
  /* shrink */
  main {
    padding-top: 70px;
    margin: 0 10%;
  }
}

footer {
  background-color: #f2f2f2;
  margin-top: 100px;
  padding: 5px;
  text-align: center;
  font-size: 12px;
  color: #666;
}

/* each element customize */
#bio .flex {
  display: flex;
  justify-content: space-between;
  gap: 50px;
  align-items: center;
  margin-top: 24px;
}

#bio .flex .left p {
  margin-top: 0;
}

#bio .flex .left .email {
  position: relative;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 5px;
  background-color: #eaeaea;
  font-family: monospace;
  font-size: 14px;
  cursor: pointer;
}

/* 툴팁 본체 */
#bio .flex .left .email .copied{
  position: absolute;
  left: 0;              /* 필요하면 50%로 바꾸고 translateX(-50%) 쓰면 가운데 정렬 */
  top: 0;
  transform: translateY(-100%);
  padding: 4px 8px;
  border-radius: 6px;
  background: #666;
  color: #e6e6e6;
  font-size: 12px;
  line-height: 1;

  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 10;
}

/* 살짝 떠오르는 애니메이션 */
#bio .flex .left .email.is-copied .copied{
  opacity: 1;
  transform: translateY(calc(-100% - 6px));
}

/* (선택) 꼬리 */
#bio .flex .left .email .copied::after{
  content: "";
  position: absolute;
  left: 12px;
  top: 100%;
  border: 6px solid transparent;
  border-top-color: #666;
}

@media (max-width: 700px) {
  #bio .flex {
    flex-direction: column-reverse;
    gap: 0;
  }
  #bio .flex .profile {
    margin: 20px auto 0;
  }
}

#bio .flex .left p a {
  color: #007bff;
  text-decoration: none;
}

#bio .flex .profile {
  height: 240px;
}

#bio .link a {
  color: #007bff;
  text-decoration: none;
  font-weight: 700;
}

#education .uni {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  align-items: center;
}

#education .uni:first-of-type {
  margin-top: 24px;
}

#education .uni .logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  object-position: center;
  display: block;
}

#education .uni .right p {
  margin-top: 5px;
  margin-bottom: 0;
}

#home-publications .item-card:first-of-type {
  margin-top: 24px;
  padding-top: 0;
  border-top: None;
}

/* Projects Page */
#projects .year {
  color: #666;
  font-size: 1.5rem;
  margin-top: 50px;
  padding-top: 50px;
  border-top: 1px solid #e6e6e6;
}

#projects .grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  row-gap: 30px;
  column-gap: 30px;
  margin-top: 16px;
  margin-bottom: 16px;
}

#projects .grid a {
  color: #212529;
}

#projects .grid .cell .preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  /* center */
  display: block;
  margin: 0 auto;
}

#projects .grid .cell .title {
  margin: 10px 0 0;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 800px) {
  #projects .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  #projects .grid {
    grid-template-columns: 1fr;
  }
  #projects .grid .cell .preview {
    width: 200px;
    height: 200px;
  }
}

/* Category Tag */
.category-tag {
  font-size: 0.9rem;
  font-weight: 400;
  color: #666;
  padding: 0;
  background-color: #f2f2f2;
  border-radius: 5px;
  padding: 5px 10px;
  display: inline-block;
  text-decoration: none;
}

.category-tag:hover {
  color: #212529;
  background-color: #e6e6e6;
}

/* Study Page */
#articles .tab {
  display: flex;
  gap: 30px;
  height: 50px;
  align-items: end;
}

#articles .tab p {
  margin-bottom: 0;
  cursor: pointer;
}

#articles .tab p:hover {
  color: #007bff;
}

#articles .tab p.active {
  color: #007bff;
  border-bottom: 1px solid #007bff;
}

#articles article-item:first-child .item-card {
  margin-top: 0;
  padding-top: 50px;
}

#articles .categories {
  border-top: 1px solid #e6e6e6;
}

#articles .categories h2 {
  margin-top: 50px;
}

#articles .categories div {
  margin-top: 10px;
}

/* series page */
#series a.back {
  display: inline-block;
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
  margin-bottom: 20px;
}

#series a.back:hover {
  color: #212529;
  text-decoration: underline;
}

#series > .detail {
  color: #212529;
  margin-top: 20px;
  margin-bottom: 20px;
}

#series .post {
  margin-top: 50px;
}

#series article-item:first-child .item-card {
  margin-top: 0;
}

/* item card */
.item-card {
  margin-top: 50px;
  padding-top: 50px;
  border-top: 1px solid #e6e6e6;
}

.item-card .grid {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 50px;
  justify-content: space-between;
  color: #212529;
  text-decoration: none;
}

.item-card .category-tag {
  margin-bottom: 10px;
}

.item-card .grid .date {
  font-size: 0.9rem;
  font-weight: 400;
  color: #666;
  margin-top: 5px;
  margin-bottom: 20px;
}

.item-card .grid .preview {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center;
  grid-row: 1 / 4;
  grid-column: 2 / 3;
}

.item-card .grid .detail {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

@media (max-width: 700px) {
  .item-card {
    margin-top: 30px;
    padding-top: 30px;
  }
  .item-card .grid h2 {
    font-size: 1rem;
  }
  .item-card .grid .date {
    font-size: 0.8rem;
  }
  .item-card .grid .detail {
    display: none;
  }
  .item-card:first-child {
    padding-top: 30px;
  }
}

/* ArXiv card */
.arxiv-card {
  width: 100%;
  max-width: 800px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
  background-color: #fff;
  overflow: hidden;
  margin: 0 0 50px;
}

.arxiv-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.arxiv-card a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
}

.arxiv-card .logo-wrapper {
  flex: 0 0 20%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.arxiv-card .logo {
  width: 100%;
  max-width: 80px;
  height: auto;
  object-fit: contain;
}

.arxiv-card .detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
}

.arxiv-card .detail strong {
  color: #212529;
  margin: 10px 0;
}

.arxiv-card .detail p.venue {
  font-size: 0.95rem;
  color: #212529;
  line-height: 1.4;
  margin: 0 !important;
}

.arxiv-card .detail p.authors {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  margin: 0 !important;
}

.arxiv-card .detail span {
  font-size: 0.9rem;
  color: #007bff;
  margin: 10px 0;
}

@media (max-width: 700px) {
  .arxiv-card a {
    flex-direction: column;
  }
}

/* post page */
#post .category-tag {
  margin-bottom: 20px;
}

#post .date {
  font-size: 0.9rem;
  color: #666;
  margin-top: 20px; /* Adjust spacing above the date */
  margin-bottom: 20px; /* Adjust spacing below the date */
}

#post .post-body {
  margin-top: 50px;
  padding-top: 50px;
  border-top: 1px solid #e6e6e6;
}

#post .post-body h2 {
  font-size: 1.7rem;
}

#post .post-body h2:not(:first-child) {
  margin-top: 50px;
  margin-bottom: 20px;
}

#post .post-body h3 {
  font-size: 1.4rem;
  margin-top: 50px;
}

#post .post-body h4 {
  font-size: 1rem;
}

#post .post-body p,
#post .post-body ul,
#post .post-body ol {
  margin-top: 20px;
  margin-bottom: 20px;
}

#post .post-body p.math-center {
  text-align: center;
}

#post .post-body a {
  color: #007bff;
  text-decoration: none;
}

#post .post-body img {
  width: 100%;
  margin-top: 40px;
  margin-bottom: 40px;
  display: block;
}

#post .post-body img.half {
  width: 50%;
  margin: 40px auto;
}

@media (max-width: 700px) {
  #post .post-body img.half {
    width: 100%;
  }
}

#post .post-body pre {
  margin: 20px 0;
  padding: 20px;
  background-color: #f2f2f2;
  overflow-x: auto;
}

#post .post-body pre code {
  font-family: "Source Code Pro", monospace;
  font-size: 14px;
}

#post .post-body span.color-red {
  color: #dc3545;
}

#post .post-body span.color-green {
  color: #28a745;
}

#post .post-footer {
  margin-top: 150px;
  padding-top: 50px;
  border-top: 1px solid #e6e6e6;
}

#post .post-footer .post-footer-profile {
  display: flex;
  align-items: center;
  margin-bottom: 50px;
  gap: 20px;
}

#post .post-footer .post-footer-profile img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

#post .post-footer .post-footer-profile h1 {
  font-family: "Lobster", sans-serif;
  font-weight: 400;
}

@media (max-width: 700px) {
  #post .post-footer .post-footer-profile {
    flex-direction: column;
    gap: 0;
  }
  #post .post-footer .post-footer-profile img {
    width: 100px;
    height: 100px;
  }
}

#post .post-footer h2 {
  font-size: 1rem;
  padding-bottom: 13px;
  border-bottom: 1px solid #a1a1a1;
}

#post .post-footer h2 a {
  color: #212529;
  text-decoration: underline;
}

#post .post-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#post .post-footer ul li {
  padding: 10px 0;
  border-bottom: 1px solid #e6e6e6;
}

#post .post-footer ul li a {
  text-decoration: none;
  color: #212529;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

#post .post-footer ul li a:hover span {
  text-decoration: underline;
}

#post .post-footer ul li a time {
  text-align: right;
  flex: 0 0 20%;
  color: #666;
}
