@import url('https://fonts.googleapis.com/css?family=IBM+Plex+Mono:300,400,600&display=swap');

/* define variables of the viz */
:root {
  --viz-width-desktop: 900px;
  --viz-width-mobile: 100vw;
  --viz-height-desktop: 500px;
  --margin-top: 40px;
  --margin-right: 40px;
  --margin-bottom: 60px;
  --margin-left: 120px;
  --notes-width-desktop: calc(
    var(--viz-width-desktop) - var(--margin-left) - var(--margin-right)
  );
}

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

/* center in the viewport */
body {
  display: flex;
  min-height: 100%;
  justify-content: center;
  align-items: flex-start;
  background: hsl(230, 29%, 19%);
  color: hsl(184, 30%, 85%);
  font-family: 'IBM Plex Mono', monospace;
  padding: 20px;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1000px;
}

h1 {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 0;
  font-weight: 300;
  font-size: 1.2rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

/* cap the width of the visualization */
svg {
  width: var(--viz-width-desktop);
  max-width: var(--viz-width-desktop);
  height: var(--viz-height-desktop);
}

/* Base SVG text styles */
svg text {
  font-family: 'IBM Plex Mono', monospace;
  fill: currentColor;
  text-shadow: 0 0 1px hsla(0, 0%, 0%, 0.35);
  letter-spacing: 0.01rem;
  font-size: 1rem;
  font-weight: 300;
}

text {
  fill: hsl(184, 30%, 85%);
}

/* Data point labels */
.name {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.05rem;
}

/* Quadrant labels */
.quadrant-label {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05rem;
  fill: hsl(184, 30%, 85%);
}

.notes {
  width: var(--notes-width-desktop);
  max-width: 100%;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.03rem;
  opacity: 0.9;
  padding: 0 20px;
}

.notes p {
  margin-bottom: 6px;
}

.notes a {
  color: hsl(184, 30%, 70%);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.notes a:hover {
  color: hsl(184, 40%, 80%);
}

/* small screen */
@media (max-width: 767px) {
  body {
    padding: 20px 0;
  }

  h1 {
    margin-left: 0;
    font-size: 1rem;
  }

  svg {
    width: var(--viz-width-mobile);
    height: 300px;
  }

  /* Reduce font size for data points on mobile */
  svg text.name {
    font-size: 0.6rem !important;
    font-weight: 500;
  }

  /* Adjust position for better readability */
  .name {
    transform: translate(2px, 0);
  }

  /* Reduce quadrant label size on mobile */
  .quadrant-label {
    font-size: 0.65rem;
    font-weight: 500;
  }

  /* Reduce axis label size on mobile */
  svg text[fill="hsl(184, 30%, 65%)"] {
    font-size: 0.65rem !important;
  }

  .notes {
    margin-top: 12px;
    font-size: 0.6rem;
  }
}

.viz {
  width: 100%;
  display: flex;
  justify-content: center;
}