@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@100..900&family=Roboto:wght@100..900&display=swap');

:root {
  /* Colors */
  --dark-green: #45ae6c;
  --light-green: #77c995;
  --red: #e83f6f;
  --black: #212121;
  --white: #fff;
  --gray: #808080;
  --light-gray: #f0f0f0;
  --off-white: #f8f8f8;
  --background-color: var(--off-white);
  --primary-color: var(--dark-green);
  --primary-color-rgb: 69, 174, 108; /* RGB value of dark-green */
  --accent-color: var(--red);
  --text-color: var(--black);
  /* Sizes */
  --padding: 1.5rem;
  --small-padding: 0.5rem;
  --border-radius: 1rem;
  --icon-size: 1.5rem;
  --text-size: 1rem;
  /* Other */
  --animation: 0.3s ease-in-out;
  --small-shadow: 0 2px 4px rgba(0, 0, 0, 10%);
  --medium-shadow: 0 4px 8px rgba(0, 0, 0, 10%);
  --large-shadow: 0 8px 16px rgba(0, 0, 0, 10%);
  --gradient: linear-gradient(
    135deg,
    var(--black) 0%,
    var(--dark-green) 50%,
    var(--light-green) 90%
  );
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slide-in {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(0);
  }
}

/* CSS reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: Quicksand, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

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

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 100;
  text-align: left;
  text-transform: uppercase;
}

p {
  margin-top: var(--padding);
}

table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

th,
td {
  padding: var(--padding);
  text-align: left;
  border-bottom: 1px solid var(--light-gray);
}

/* No bottom border on last row */
tr:last-child td {
  border-bottom: none;
}

/* Selection style (not supported in safari) */
/* stylelint-disable-next-line */
::selection {
  background-color: var(--light-green);
  color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--dark-green);
}

/* Typical layout has header, main and footer. Ensure the footer is at the bottom of the page */
html,
body {
  height: 100%;
  width: 100%;
}

main {
  min-height: 100%;
  /* Adjust based on header height */
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color);
  position: relative;
  z-index: 0;
  overflow-y: hidden;
}

main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1250vh; /* Ensures background details are not too small */
  background: url('/assets/images/bacteria-2.svg');
  background-size: cover;
  opacity: 0.05;
  z-index: -1;
}

/* Common classes */
.card {
  border-radius: var(--border-radius);
  padding: var(--padding);
  width: 100%;
}

.card.fill,
.image-card.fill {
  background-color: var(--white);
  box-shadow: var(--medium-shadow);
}

.image-card {
  border-radius: var(--border-radius);
  overflow-x: hidden;
  overflow-y: hidden;
}

.image-card img {
  width: 100%;
  height: auto;
  display: block;
}

.image-card .image-title {
  z-index: 2;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--padding);
  color: var(--white);
}

.track {
  max-width: 750px;
}

.hero {
  position: relative;
  background: var(--gradient);
  color: var(--white);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.hero.full {
  /* Full height hero */
  min-height: calc(100vh - 4 * var(--padding));
  padding: calc(2 * var(--padding)) 0; /* Account for jaggedness for content */
}

.hero.top {
  /* At the top of the page with subtle waves */
  clip-path: polygon(0 0, 100% 0, 100% 85%, 75% 92%, 50% 89%, 25% 92%, 0 95%);
  padding-bottom: calc(
    4 * var(--padding)
  ); /* Account for jaggedness for content */

  padding-top: calc(2 * var(--padding));
}

.hero.middle {
  /* In the middle of the page with subtle waves on both sides */
  clip-path: polygon(
    0 15%,
    25% 10%,
    50% 13%,
    75% 10%,
    100% 5%,
    100% 85%,
    75% 92%,
    50% 89%,
    25% 92%,
    0 95%
  );
  padding: calc(4 * var(--padding)) 0; /* Account for jaggedness for content */
}

.hero.bottom {
  /* At the bottom of the page with subtle wave at top */
  clip-path: polygon(
    0 15%,
    25% 10%,
    50% 13%,
    75% 10%,
    100% 5%,
    100% 100%,
    0 100%
  );
  padding-top: calc(
    4 * var(--padding)
  ); /* Account for jaggedness for content */

  padding-bottom: calc(2 * var(--padding));
}

.hero.half {
  /* Fixed height */
  height: 50vh;
}

.hero.half + * {
  /* Overlap next item with hero */
  position: relative;
  top: -35vh;
  /* Adjust based on padding */
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/assets/images/bacteria.svg') no-repeat center center;
  background-size: cover;
  opacity: 0.1;
}

.hero .cta {
  background-color: var(--accent-color);
}

.hero .socials a {
  color: var(--white);
}

.hero h1 {
  font-size: 2.5rem;
}

.hero .logo {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero .video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 75%;
  height: 100%;
  object-fit: cover; /* Ensures the video covers the area */
  z-index: 0; /* Behind the content */
  opacity: 0.7;
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 100%), rgba(0, 0, 0, 0%));
  filter: grayscale(100%);
}

.hero :not(.video-background) {
  position: relative;
  z-index: 1; /* Above the video */
}

.section-divider {
  margin: calc(2 * var(--padding)) 0;
  border: none;
}

.prizes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--small-padding);
  position: relative;
  width: 100%;
}

.prizes .prize {
  width: 30%;
  height: auto;
  object-fit: contain; /* Ensures the image maintains aspect ratio */
  display: flex;
  justify-content: center;
}

.prizes .prize.nomination {
  filter: grayscale(100%);
}

.prizes .grand {
  color: var(--accent-color);
  font-size: 4rem;
  font-weight: bold;
}

.cta {
  /* Call to action button */
  display: inline-block;
  padding: var(--small-padding) var(--padding);
  margin: var(--small-padding);
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: var(--border-radius);
  border: none;
  text-align: center;
  box-shadow: var(--small-shadow);
  transition: box-shadow var(--animation);
  text-transform: uppercase;
}

.cta:hover {
  cursor: pointer;
  box-shadow: var(--large-shadow);
}

.impact {
  background-color: var(--accent-color);
  color: var(--white);
  padding: var(--padding);
  border-radius: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 8.5rem;
  height: 8.5rem;
  text-transform: uppercase;
}

.impact .number {
  font-size: 2rem;
  font-weight: bold;
}

i + * {
  margin-left: var(--small-padding);
}

* + i {
  margin-left: var(--small-padding);
}

.overlay-parent {
  position: relative;
}

.overlay {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  padding: var(--padding);
  color: var(--white);
  display: flex;
  align-items: center;
  background: linear-gradient(
    115deg,
    var(--black) 15%,
    transparent 50%,
    transparent 100%
  );
}

.overlay.hidden {
  opacity: 0;
}

.overlay-content {
  width: 50%;
  padding-top: calc(var(--padding) * 2); /* Account for title */
}

.overlay-parent:hover .overlay.hidden {
  opacity: 1;
  transition: opacity var(--animation);
}

.detail-item {
  margin-top: var(--small-padding);
}

.quote {
  font-style: italic;
  padding: var(--padding);
  border-radius: var(--border-radius);
  font-size: calc(1.25 * var(--text-size));
}

.quote .quote-text {
  display: block;
}

.author {
  font-weight: bold;
}

.author::before {
  content: '— ';
}

.quote .quote-text::before {
  font-family: sans-serif;
  content: '“';
}

.quote .quote-text::after {
  font-family: sans-serif;
  content: '”';
}

.grid {
  display: grid;
  /* Default one column */
  grid-template-columns: repeat(1, 1fr);
  grid-template-rows: auto;
  gap: var(--padding);
  padding: var(--padding);
}

.grid.c2 {
  /* Two columns */
  grid-template-columns: repeat(2, 1fr);
}

.grid.c3 {
  /* Three columns */
  grid-template-columns: repeat(3, 1fr);
}

.grid .wide {
  grid-column: span 2;
  /* Spans two columns */
}

p a {
  color: var(--accent-color);
}

p a:hover,
p a:focus,
p a:active {
  text-decoration: underline;
}

.card.sponsor img {
  height: 7rem;
  width: auto;
  margin: 0 auto;
  /* Center the image */
  display: block;
  object-fit: contain;
  /* Ensures the image maintains aspect ratio */
}

.announcement {
  padding: var(--padding);
  border-radius: var(--border-radius);
  margin: var(--padding) 0;
  display: flex;
  align-items: center;
}

.announcement a {
  text-decoration: underline;
}

.announcement::before {
  font-family: 'Font Awesome 6 Free', sans-serif;
  font-weight: 900;
  margin-right: var(--padding);
}

.info {
  background-color: #e0f7fa;
  color: #00796b;
  border: 1px solid #00796b;
}

.info::before {
  content: '\f05a';
  /* fa-info-circle */
}

.warning {
  background-color: #fff3e0;
  color: #f57c00;
  border: 1px solid #f57c00;
}

.warning::before {
  content: '\f071';
  /* fa-triangle-exclamation */
}

.error {
  background-color: #ffebee;
  color: #d32f2f;
  border: 1px solid #d32f2f;
}

.error::before {
  content: '\f057';
  /* fa-circle-xmark */
}

.person {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: var(--padding);
}

.socials {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.socials a {
  color: var(--gray);
  font-size: 1.1rem;
  margin-right: var(--small-padding);
  margin-top: var(--small-padding);
}

.person img {
  width: 45%;
  aspect-ratio: 1 / 1;
  border-radius: 100%;
  margin-right: var(--padding);
  object-fit: cover;
  /* Ensures the image maintains aspect ratio */
  flex-shrink: 0;
  /* Prevents image from shrinking */
}

.map {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}

.timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Timeline line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: #ccc;
}

.event {
  width: 45%;
  margin: var(--padding) 0;
  padding: var(--padding);
  position: relative;
}

/* Dot on timeline */
.timeline > .event::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  top: calc(var(--padding) * 2 + 0.5rem);
  background-color: var(--primary-color);
  border-radius: 100%;
}

.event .title {
  font-weight: bold;
  color: var(--primary-color);
  position: relative;
  text-transform: uppercase;
}

/* Add line coming from title */
.event .title::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  width: 45px;
  height: 2px;
  background-color: var(--primary-color);
}

.dates {
  font-size: 0.9em;
  color: var(--gray);
}

.event .description {
  font-size: 1em;
  margin-top: 10px;
}

/* Alternate left and right */
.timeline > div:nth-child(odd) {
  align-self: flex-start;
  /* Left alignment */
  text-align: right;
}

.timeline > div:nth-child(even) {
  align-self: flex-end;
  /* Right alignment */
  text-align: left;
}

.timeline > .event:nth-child(odd)::before {
  left: calc(100% * (50 / 45) - 5px + 1px);
  /* Center the dot */
}

.timeline > .event:nth-child(even)::before {
  left: calc(-10% * (50 / 45) - 5px + 1px);
  /* Center the dot */
}

.event:nth-child(odd) .title::before {
  left: calc(100% + 10px);
}

.event:nth-child(even) .title::before {
  left: calc(-50px - 5px);
}

/* Phone */
@media screen and (max-width: 768px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .overlay-content {
    width: 100%;
  }

  /* Increase height of the event cards and make the image cover */
  .image-card img {
    min-height: 325px;
    object-fit: cover;
    /* Ensures the image covers the area */
  }

  .grid.c2 {
    /* Two columns on small screens */
    grid-template-columns: repeat(1, 1fr);
  }

  .grid.c3 {
    /* Three columns on small screens */
    grid-template-columns: repeat(2, 1fr);
  }

  .grid .wide {
    grid-column: span 1;
    /* Spans one column */
  }

  .person {
    flex-direction: column;
    align-items: center;
  }

  .person img {
    margin-bottom: var(--padding);
    width: 90%;
  }

  .timeline::before {
    left: 0;
  }

  .timeline > .event,
  .timeline > .milestone {
    width: 100%;
  }

  .timeline > div:nth-child(odd) {
    align-self: flex-end;
    text-align: left;
  }

  .timeline > .event:nth-child(odd)::before,
  .timeline > .milestone:nth-child(odd)::before,
  .timeline > .event:nth-child(even)::before,
  .timeline > .milestone:nth-child(even)::before {
    left: calc(-5% * (50 / 45) - 10px + 1px);
    /* Center the dot */
  }

  .event:nth-child(odd) .title::before,
  .milestone:nth-child(odd) .title::before,
  .event:nth-child(even) .title::before,
  .milestone:nth-child(even) .title::before {
    width: 40px;
    left: -45px;
  }

  .timeline {
    max-height: none;
    /* Remove height limit on timeline */
  }

  .timeline > .event {
    /* TODO more specific selector */
    transform: translateY(0) !important;
  }
}
