/* Colours, type and spacing come from tools/shared/tokens.css (shared with the tools). */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-muted);
  line-height: 1.2;
  user-select: none;
}

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

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

.page {
  min-height: 100vh;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.topbar {
  display: grid;
  grid-template-columns: 0.3fr 1fr 1fr;
  align-items: start;
  gap: 24px;
  font-size: 13px;
}

.brand {
  color: var(--color-text);
}

.intro {
  max-width: 260px;
  color: var(--color-muted);
}

.topbar-end {
  justify-self: end;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

/* Pull the theme menu up so it lines up with the first line of text */
.topbar-end .theme-switch {
  margin-top: -6px;
}

.globe-wrapper {
  position: relative;
  margin-top: -20px; /* raises the globe */
}

#globe {
  width: 128px;
  height: 128px;
  display: block;
  cursor: grab;
  user-select: auto;
  touch-action: none;
}

#globe:active {
  cursor: grabbing;
}

.marker-label {
  position: absolute;
  position-anchor: var(--label-anchor);
  bottom: anchor(top);
  left: anchor(center);
  translate: -50% 0;
  margin-bottom: 6px;
  padding: 3px 5px 2px 5px;
  background: var(--color-accent);
  color: #fff;
  font-size: 9px;
  font-family: var(--font);
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s;
}

.section {
  display: grid;
  grid-template-columns: 0.3fr 1fr 1fr;
  gap: 24px;
  padding-top: 40px;
}

.section--hero {
  padding-top: 190px;
  min-height: 260px;
}

.section-label {
  font-size: 13px;
  color: var(--color-text);
}

.section-content {
  font-size: 13px;
  color: var(--color-muted);
}

.hero-copy {
  max-width: 480px;
}

.hero-copy p {
  margin: 0 0 8px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 220px;
}

.list a {
  display: inline-block;
  padding: 3px 0;
}

/* Small arrow that slides in on hover: external-link icon, or a chevron for links within the site */
.list a::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 6px;
  vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6'/%3E%3Cpath d='m21 3-9 9'/%3E%3Cpath d='M15 3h6v6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6'/%3E%3Cpath d='m21 3-9 9'/%3E%3Cpath d='M15 3h6v6'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.list a[href^="/"]::after {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -2px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

.list a:hover::after,
.list a:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .list a::after {
    transform: none;
  }
}

@media (max-width: 800px) {
  body {
    line-height: 1.5;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px;
  }

  .topbar .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar .intro {
    grid-column: 1;
    grid-row: 2;
  }

  .topbar-end {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: start;
  }

  .globe-wrapper {
    margin-top: -13px;
  }

  #globe {
    width: 80px;
    height: 80px;
  }

  .section {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 34px;
    min-height: auto;
  }

  .section--hero {
    padding-top: 64px;
  }

  .page {
    padding: 18px;
  }
}
