/* General styles */
:root {
  --transition-default: all 0.1s ease-in-out;
}

html {
  background: var(--color-blue-50);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  padding: var(--size-2) var(--size-4) var(--size-16);
  font-family: var(--font-sans);
  color: black;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  line-height: var(--line-lg);
  font-feature-settings:
    'kern' 1,
    'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  width: var(--size-full);
  background-color: rgb(255 255 255 / 80%);
  backdrop-filter: var(--blur-sm) saturate(200%);
  border-top: var(--size-px) solid var(--color-grey-200);
  position: fixed;
  z-index: 1;
  bottom: 0;
  display: flex;
  justify-content: center;
}

main {
  margin-top: var(--size-4);
  width: var(--size-full);
}

h1 {
  font-size: var(--scale-fluid-5);
  line-height: var(--line-xs);
  text-wrap: balance;
}

h2 {
  font-size: var(--scale-fluid-4);
  line-height: var(--line-sm);
}

h3 {
  font-size: var(--scale-fluid-3);
  line-height: var(--line-md);
}

p,
li {
  max-width: 75ch;
  line-height: var(--line-lg);
  margin-block: 1lh;
  text-wrap: pretty;
}

strong,
b {
  color: var(--color-blue-500);
}

a {
  color: var(--color-blue-500);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:visited {
  color: var(--color-blue-700);
}

footer {
  text-align: center;
  padding: var(--size-1);
  font-size: var(--scale-fluid-00);
}

.nav-header {
  width: var(--size-full);
  display: flex;
  justify-content: space-around;
  padding: var(--size-3) var(--size-5);
}

.nav-header-link {
  text-decoration: none;
  color: black;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--scale-fluid-000);
}

.nav-header-link:visited {
  color: black;
}

.nav-header-link-active {
  color: var(--color-blue-500);
}

.nav-header-link-active:visited {
  color: var(--color-blue-500);
}

/* Index styles */
.profile-img {
  width: var(--size-32);
  height: var(--size-32);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: var(--size-1) solid var(--color-grey-50);
}

.profile-desc {
  max-width: 70ch;
  font-size: var(--scale-fluid-1);
  line-height: var(--line-lg);
  margin: var(--size-4) 0;
}

.profile-social {
  display: flex;
  gap: var(--size-5);
}

.profile-social-link {
  color: var(--color-grey-500);
}

/* Project styles */
.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--size-7);
}

.project-list-card {
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
  padding: var(--size-6);
  color: var(--color-grey-950);
  border: var(--size-px) solid var(--color-grey-200);
}

.project-list-card:visited {
  color: var(--color-grey-950);
}

.project-list-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-list-card-title svg,
.project-list-card-title-accent {
  color: var(--color-blue-500);
}

.project-list-card h3 {
  margin: 0;
  font-size: var(--scale-fluid-1);
}

.project-list-card p {
  margin: 0;
  line-height: var(--line-lg);
}

/* About me styles */

/* How to make a CSS timeline:
  https://www.jonashietala.se/blog/2024/08/25/a_simple_timeline_using_css_flexbox/
*/
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  height: var(--size-full);
  width: var(--size-px);
  background: var(--color-grey-950);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-left: var(--size-4);
}

.timeline-event {
  display: flex;
  align-items: baseline;
}

.timeline-event-marker {
  fill: var(--color-blue-500);
  position: relative;
  left: -6px;
  top: 6px;
  min-width: 12px;
}

.timeline-event-content {
  padding-left: var(--size-4);
}

@media (prefers-color-scheme: dark) {
  /* General styles */
  html {
    background: var(--color-grey-950);
  }

  body {
    color: white;
  }

  header {
    background-color: rgb(0 0 0 / 80%);
    border-top: var(--size-px) solid var(--color-grey-800);
  }

  strong,
  b,
  a {
    color: var(--color-blue-400);
  }

  a:visited {
    color: var(--color-blue-300);
  }

  .nav-header-link {
    color: white;
  }

  .nav-header-link:visited {
    color: white;
  }

  .nav-header-link-active {
    color: var(--color-blue-400);
  }

  .nav-header-link-active:visited {
    color: var(--color-blue-400);
  }

  /* Index styles */
  .profile-img {
    border: var(--size-1) solid var(--color-grey-800);
  }

  .profile-social-link {
    color: var(--color-grey-400);
  }

  /* Project styles */
  .project-list-card {
    background: var(--color-grey-900);
    color: white;
    border: var(--size-px) solid var(--color-grey-800);
  }

  .project-list-card:visited {
    color: white;
  }

  .project-list-card-title svg,
  .project-list-card-title-accent {
    color: var(--color-blue-400);
  }

  /* About me styles */
  .timeline::before {
    background: white;
  }

  .timeline-event-marker {
    fill: var(--color-blue-400);
  }
}

@media (width >= 768px) {
  /* General styles */
  body {
    max-width: var(--width-lg);
    padding: var(--size-3) var(--size-32) 0;
    margin-left: auto;
    margin-right: auto;
  }

  main {
    margin-top: var(--size-20);
  }

  header {
    top: 0;
    bottom: auto;
    border-top: 0;
    border-bottom: var(--size-px) solid var(--color-grey-200);
  }

  a {
    position: relative;
  }

  a:hover {
    text-decoration: none;
  }

  a:focus {
    outline: 0;
  }

  a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-blue-500);
    border-radius: var(--size-px);
    transition: var(--transition-default);
  }

  a:hover::after,
  a:focus::after {
    width: var(--size-full);
  }

  a:visited::after {
    background: var(--color-blue-700);
  }

  .nav-header {
    max-width: min(100dvw, var(--width-lg));
    justify-content: space-evenly;
    padding: var(--size-4) var(--size-24);
  }

  .nav-header-link {
    font-size: inherit;
    overflow: inherit;
  }

  .nav-header-link::after {
    height: 2px;
  }

  .nav-header-link:hover,
  .nav-header-link:focus {
    color: var(--color-blue-500);
  }

  .nav-header-link svg {
    display: none;
  }

  .nav-header-link-active:focus {
    outline: auto;
  }

  .nav-header-link-active::after {
    width: var(--size-full);
  }

  .nav-header-link:visited::after {
    background: var(--color-blue-500);
  }

  .nav-header-link:first-child {
    margin-right: var(--size-72);
  }

  /* Index styles */
  .profile-img {
    transition: var(--transition-default);
  }

  .profile-img:hover {
    transform: scale(1.05) translateY(-4px);
    box-shadow: var(--shadow-xl);
  }

  .profile-social-link {
    transition: var(--transition-default);
  }

  .profile-social-link::after {
    content: initial;
  }

  .profile-social-link:hover,
  .profile-social-link:focus {
    color: var(--color-grey-950);
  }

  /* Project styles */
  .project-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--size-5);
  }

  .project-list-card {
    transition: var(--transition-default);
  }

  .project-list-card::after {
    content: initial;
  }

  .project-list-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px) scale(1.02);
  }

  .project-list-card-title svg {
    transition: var(--transition-default);
  }

  .project-list-card:hover .project-list-card-title svg {
    transform: scale(1.1) rotate(5deg);
  }

  /* About me styles */
  .timeline::before {
    left: 50%;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline-event:nth-child(even) {
    flex-direction: row-reverse;
  }

  .timeline-event-marker {
    order: 1;
  }

  .timeline-event-content {
    width: 50%;
    text-align: right;
    padding-left: 0;
    padding-right: var(--size-8);
  }

  .timeline-event:nth-child(odd) .timeline-event-marker {
    left: -6px;
  }

  .timeline-event:nth-child(even) .timeline-event-content {
    text-align: left;
    padding-left: var(--size-8);
    padding-right: 0;
  }

  .timeline-event:nth-child(even) .timeline-event-marker {
    left: 6px;
  }
}

@media (width >= 768px) and (prefers-color-scheme: dark) {
  /* General styles */
  header {
    border-bottom: var(--size-px) solid var(--color-grey-800);
  }

  a::after {
    background: var(--color-blue-400);
  }

  a:visited::after {
    background: var(--color-blue-300);
  }

  .nav-header-link:hover,
  .nav-header-link:focus,
  .nav-header-link:visited::after {
    color: var(--color-blue-400);
  }

  /* Index styles */
  .profile-social-link:hover,
  .profile-social-link:focus {
    color: white;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
