/* minireset */
blockquote,
body,
dd,
dl,
dt,
fieldset,
figure,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
html,
iframe,
legend,
li,
ol,
p,
pre,
textarea,
ul {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 100%;
  font-weight: 400;
}

ul {
  list-style: none;
}

button,
input,
select {
  margin: 0;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

img,
video {
  height: auto;
  max-width: 100%;
}

iframe {
  border: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  padding: 0;
}

:root {
  --body-color: #111;
  --body-bg: #fdfdfc;
  --heading-color: #111;
  --hyperlink-color: #3e9fff;
  --focus-color: rgba(0, 122, 255, .5);
  --selection-color: #111;
  --selection-bg: #ededed;
}

* {
  outline: 0;
  box-sizing: border-box;
}

::selection {
  color: var(--selection-color);
  background: var(--selection-bg);
}

html {
  background: var(--body-bg);
  color: var(--body-color);
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  overflow-y: scroll;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.basic-link {
  position: relative;
  display: inline;
  color: inherit;
  font-weight: inherit;
  transition: all .2s ease;
}

.basic-link:before {
  pointer-events: none;
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: 2px;
  background: #d9d9d9;
  opacity: 1;
  transition: inherit;
}

.basic-link:hover:before {
  background: #666;
}

.basic-link:focus-visible {
  border-radius: 2px;
  padding: 0 2px;
  margin: 0 -2px;
  transition: none;
  outline: 2px solid var(--focus-color);
}

/* Layout */
.container {
  padding: 5rem 1rem 2.5rem;
  max-width: 36.375rem;
  margin: 0 auto;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 2rem 1.5rem 2.5rem;
  }
}

/* Fade gradient at top */
.container:before {
  content: "";
  pointer-events: none;
  z-index: 9;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(180deg, var(--body-bg) 0%, rgba(253, 253, 252, .738) 19%, rgba(253, 253, 252, .541) 34%, rgba(253, 253, 252, .382) 47%, rgba(253, 253, 252, .278) 56.5%, rgba(253, 253, 252, .194) 65%, rgba(253, 253, 252, .126) 73%, rgba(253, 253, 252, .075) 80.2%, rgba(253, 253, 252, .042) 86.1%, rgba(253, 253, 252, .021) 91%, rgba(253, 253, 252, .008) 95.2%, rgba(253, 253, 252, .002) 98.2%, transparent);
}

@media screen and (max-width: 768px) {
  .container:before {
    height: 2.5rem;
  }
}

/* GitHub link button */
.github-link {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: rgba(0, 0, 0, .4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .04), inset 0 0 0 1px rgba(0, 0, 0, .06);
  transition: color .15s ease, transform .15s ease;
}

.github-link:hover {
  color: rgba(0, 0, 0, .7);
  transform: scale(1.05);
}

.github-link:active {
  transform: scale(.95);
}

.linkedin-link {
  position: fixed;
  top: 4.75rem;
  right: 1.25rem;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: rgba(0, 0, 0, .4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .04), inset 0 0 0 1px rgba(0, 0, 0, .06);
  transition: color .15s ease, transform .15s ease;
}

.linkedin-link:hover {
  color: rgba(0, 0, 0, .7);
  transform: scale(1.05);
}

.linkedin-link:active {
  transform: scale(.95);
}

/* Stagger animations */
@keyframes staggerIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.homepage>.article>* {
  animation: staggerIn .5s ease both;
}

.homepage>.article> :first-child {
  animation-delay: 0s;
}

.homepage>.article> :nth-child(2) {
  animation-delay: .05s;
}

.homepage>.article> :nth-child(3) {
  animation-delay: .1s;
}

.homepage>.article> :nth-child(4) {
  animation-delay: .15s;
}

.homepage>.article> :nth-child(5) {
  animation-delay: .2s;
}

.homepage>.article> :nth-child(6) {
  animation-delay: .25s;
}

.homepage>.article> :nth-child(7) {
  animation-delay: .3s;
}

.homepage>.article> :nth-child(8) {
  animation-delay: .35s;
}

.homepage>.article> :nth-child(n+9) {
  animation-delay: .4s;
}

.homepage>section,
.homepage>footer {
  animation: staggerIn .5s ease both;
}

.homepage>section {
  animation-delay: .45s;
}

.homepage>section:nth-of-type(2) {
  animation-delay: .5s;
}

.homepage>footer {
  animation-delay: .55s;
}

/* Article */
.article {
  max-width: 70ch;
}

.article>header {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 0 0 .5rem;
}

.article>header h1 {
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25rem;
  letter-spacing: -.00563rem;
  color: #111;
}

.article>header time {
  font-size: .875rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -.00563rem;
  color: rgba(0, 0, 0, .4);
}

.article>p {
  padding-top: 1rem;
  font-size: .875rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -.00563rem;
}

.article>p strong {
  font-weight: 600;
}

/* Post list (Projects section) */
.post-list h3.section-title {
  font-size: .6875rem;
  font-weight: 460;
  letter-spacing: .00063rem;
  text-transform: uppercase;
  color: rgba(0, 0, 0, .4);
  margin-bottom: 1.5rem;
}

.post-list {
  padding-top: 2.5rem;
}

.post-list>ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-list>ul>li {
  position: relative;
  font-size: .75rem;
  font-weight: 460;
  letter-spacing: .00063rem;
  color: rgba(0, 0, 0, .32);
}

.post-list>ul>li>ul {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.post-list>ul>li>ul>li a {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .375rem .5rem;
  margin: 0 -.5rem;
  border-radius: .375rem;
  transition: background .15s ease;
}

.post-list>ul>li>ul>li a:hover {
  background: rgba(0, 0, 0, .03);
}

.post-list>ul>li>ul>li a h2 {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 460;
  line-height: 1.25rem;
  letter-spacing: -.00563rem;
  color: #111;
}

.post-list>ul>li>ul>li a time {
  display: flex;
  flex-shrink: 0;
  font-size: .6875rem;
  font-weight: 460;
  color: rgba(0, 0, 0, .32);
  font-variant-numeric: tabular-nums;
}

.post-list>ul>li>ul>li a time span:nth-child(even) {
  opacity: .3;
  margin: 0 1px;
}

.lang-badge {
  display: inline-flex;
  align-items: center;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: rgba(0, 0, 0, .45);
  background: rgba(0, 0, 0, .05);
  padding: .0625rem .375rem;
  border-radius: .25rem;
}

.dissertation-badge {
  display: inline-flex;
  align-items: center;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: #b8860b;
  background: rgba(184, 134, 11, .12);
  padding: .0625rem .375rem;
  border-radius: .25rem;
}

/* Footer */
.footer {
  padding-top: 4rem;
}

.footer-container {
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.footer-time {
  font-size: .75rem;
  font-weight: 460;
  letter-spacing: .00063rem;
  color: rgba(0, 0, 0, .4);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0;
}

.footer-time span:empty {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --body-color: #e1e1e1;
    --body-bg: #111;
    --heading-color: #e1e1e1;
    --selection-color: #e1e1e1;
    --selection-bg: #333;
  }

  .basic-link:before {
    background: #444;
  }

  .basic-link:hover:before {
    background: #999;
  }

  .container:before {
    background: linear-gradient(180deg, #111 0%, rgba(17, 17, 17, .738) 19%, rgba(17, 17, 17, .541) 34%, rgba(17, 17, 17, .382) 47%, rgba(17, 17, 17, .278) 56.5%, rgba(17, 17, 17, .194) 65%, rgba(17, 17, 17, .126) 73%, rgba(17, 17, 17, .075) 80.2%, rgba(17, 17, 17, .042) 86.1%, rgba(17, 17, 17, .021) 91%, rgba(17, 17, 17, .008) 95.2%, rgba(17, 17, 17, .002) 98.2%, transparent);
  }

  .github-link {
    background: #1a1a1a;
    color: rgba(255, 255, 255, .4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .15), inset 0 0 0 1px rgba(255, 255, 255, .08);
  }

  .github-link:hover {
    color: rgba(255, 255, 255, .7);
  }

  .linkedin-link {
    background: #1a1a1a;
    color: rgba(255, 255, 255, .4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .15), inset 0 0 0 1px rgba(255, 255, 255, .08);
  }

  .linkedin-link:hover {
    color: rgba(255, 255, 255, .7);
  }

  .article>p,
  .article>header time,
  .post-list h3.section-title,
  .post-list>ul>li,
  .post-list>ul>li>ul>li a time,
  .footer-time {
    color: rgba(255, 255, 255, .35);
  }

  .article>header h1,
  .post-list>ul>li>ul>li a h2 {
    color: #e1e1e1;
  }

  .post-list>ul>li>ul>li a:hover {
    background: rgba(255, 255, 255, .05);
  }

  .lang-badge {
    color: rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .1);
  }

  .dissertation-badge {
    color: #d4a017;
    background: rgba(212, 160, 23, .15);
  }

  .footer-container {
    border-top-color: rgba(255, 255, 255, .06);
  }
}