:root {
  --background: #0e1211;
  --muted: #717890;
  --timeline-color: #fff;
  --border-color: #04010c;
  --border-radius: 12px;
  --card-rgb: 180, 185, 188;
  --card-border-rgb: 131, 134, 135;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--background);
  color: #fff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.main {
  display: flex;
  min-height: 100vh;
  margin: 2rem auto 6rem;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
}

.main h6 {
  padding-bottom: 0.5rem;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.header {
  display: inline;
  margin: 1rem 1rem 2rem;
  text-align: center;
}

.header h1 {
  margin-bottom: 1rem;
  color: #16a88c;
  font-size: 46px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.header h4 {
  color: var(--muted);
  font-weight: 500;
}

.inline-flag {
  display: inline-block;
  vertical-align: middle;
}

.section {
  margin: 3vw;
}

.card-grid {
  display: grid;
  width: 100%;
  max-width: 1100px;
  margin: auto;
  padding: 0 5%;
  grid-template-columns: repeat(2, 1fr);
  gap: 1%;
}

.card {
  max-width: 400px;
  margin: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(var(--card-border-rgb), 0);
  border-radius: var(--border-radius);
  background: rgba(var(--card-rgb), 0);
  text-align: left;
  transition: background 200ms, border 200ms;
}

.card h2 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

.card p {
  max-width: 100%;
  color: var(--muted);
  hyphens: auto;
}

.card span {
  display: inline-block;
  transition: transform 200ms;
}

.card-image {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  object-fit: cover;
}

.animation {
  position: relative;
  display: inline-block;
  color: #fff;
}

.animation::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: bottom right;
  background: #fff;
  content: '';
  transition: transform 250ms ease-out;
}

.animation:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.timeline-wrap {
  width: calc(100% - 6vw);
  max-width: 60rem;
}

.timeline-container {
  position: relative;
  min-width: 0;
  line-height: 1.5;
}

.timeline-container h2 {
  color: #16a88c;
  font-size: 20px;
  font-weight: 600;
}

.timeline-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.timespan {
  min-width: 6.6em;
  margin-right: 1rem;
  color: var(--timeline-color);
  font-weight: 500;
  text-align: right;
  grid-column: span 1;
}

.timeline-icon {
  position: relative;
  top: 5px;
  border-left: 2px solid var(--timeline-color);
}

.timeline-icon-fade {
  border-image: linear-gradient(to bottom, var(--timeline-color), transparent) 1 100%;
}

.entry-dot {
  position: relative;
  top: -1px;
  left: -8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--timeline-color);
}

.timeline-logo {
  display: none;
  width: 135px;
  height: 135px;
  margin-top: -13px;
  margin-left: 0.7em;
  object-fit: contain;
}

.timeline-icon-fade .timeline-logo {
  margin-left: 0.5em;
}

.description {
  margin-left: -3rem;
  padding-top: 2px;
  padding-bottom: 5vh;
  overflow-wrap: break-word;
  grid-column: span 10;
}

.resume-download {
  position: absolute;
  z-index: 10;
  top: -5px;
  right: -15px;
}

.resume-button {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.resume-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgb(0 0 0 / 15%), 0 3px 6px rgb(0 0 0 / 10%);
}

.resume-preview {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(420px, 80vw);
  height: auto;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgb(0 0 0 / 45%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  visibility: hidden;
}

.resume-download:hover .resume-preview,
.resume-download:focus-within .resume-preview {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.course-container {
  color: #fff;
}

.course-table {
  width: 100%;
  margin-top: 5px;
  padding-bottom: 0;
  border-radius: 5px;
  background: rgb(51 51 51 / 10%);
  border-collapse: separate;
  white-space: nowrap;
}

.course-table th {
  padding: 10px;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
}

.course-table th:last-child,
.course-table td:last-child {
  padding-right: 10px;
  padding-left: 10px;
  text-align: right;
}

.course-table td:first-child {
  padding-right: 10px;
  padding-bottom: 5px;
  padding-left: 10px;
}

.course-table .term-header {
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  opacity: 0.7;
}

.socials {
  display: flex;
  width: 80vw;
  max-width: 60rem;
  align-items: center;
  justify-content: center;
}

.socials a {
  display: flex;
  flex: 1;
  justify-content: center;
}

.socials img {
  width: auto;
  height: 5vh;
}

.ranks {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(2, minmax(50%, auto));
  text-align: center;
}

.rank {
  display: flex;
  margin-right: 7vw;
  margin-left: 7vw;
  flex-direction: column;
  align-items: center;
}

.rank > img {
  display: block;
  width: auto;
  height: 12vh;
  margin: 1rem auto;
}

.rank > .diamond-emblem {
  transform: translateX(-1.25rem);
}

.rank h4 {
  padding-bottom: 1rem;
}

.rank h6 {
  padding-bottom: 0.5rem;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(var(--card-border-rgb), 0.15);
    background: rgba(var(--card-rgb), 0.1);
  }

  .card:hover span {
    transform: translateX(4px);
  }

  .icon:hover {
    transform: scale(1.1);
    transition: transform 200ms ease-out;
  }
}

@media (max-width: 800px) {
  .main {
    font-size: 12px;
  }

  .main a,
  .main p {
    font-size: 11px;
    line-height: 1.4;
  }

  .header {
    margin-top: 1vw;
    margin-bottom: 5vw;
  }

  .header h1 {
    font-size: 36px;
  }

  .main h4,
  .main h6 {
    font-size: 11px;
  }

  .timeline-container h2 {
    font-size: 16px;
  }

  .timespan {
    min-width: 0;
    max-width: 0;
    margin: 0;
    font-size: 0;
  }

  .timeline-icon {
    margin-right: auto;
    margin-left: -1rem;
  }

  .timeline-logo {
    display: none;
  }

  .description {
    max-width: 100%;
    margin-left: -2rem;
  }

  .course-table {
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
  }

  .resume-download {
    right: 0;
    margin-right: 3vw;
  }

  .resume-button {
    font-size: 11px;
  }

  .resume-preview {
    width: min(360px, 86vw);
  }

  .socials {
    width: 100vw;
  }

  .rank {
    margin: 0 2vw;
  }

  .rank > .diamond-emblem {
    transform: translateX(-0.75rem);
  }

  .rank h4,
  .rank h6 {
    padding-bottom: 0.2rem;
  }
}

@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .card {
    margin: 0.5rem 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  .card:hover span,
  .icon:hover,
  .resume-button:hover {
    transform: none;
  }

  .resume-preview {
    transition: none;
  }
}
