@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/inter-v7-latin-regular.woff2') format('woff2'),
       url('../fonts/inter-v7-latin-regular.woff') format('woff'),
       url('../fonts/inter-v7-latin-regular.ttf') format('ttf');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/inter-v7-latin-600.woff2') format('woff2'),
       url('../fonts/inter-v7-latin-600.woff') format('woff'),
       url('../fonts/inter-v7-latin-600.ttf') format('ttf');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/inter-v7-latin-700.woff2') format('woff2'),
       url('../fonts/inter-v7-latin-700.woff') format('woff'),
       url('../fonts/inter-v7-latin-700.ttf') format('ttf');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/inter-v7-latin-900.woff2') format('woff2'),
       url('../fonts/inter-v7-latin-900.woff') format('woff'),
       url('../fonts/inter-v7-latin-900.ttf') format('ttf');
}

body {
  font-family: Inter, system, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Lucida Grande", Arial, sans-serif;
  max-width: 32em;
  margin: 0 auto;
  padding: 0 1em;
}

h1 > a:link {
  text-decoration: none;
}

h1 > a:hover,
h1 > a:focus {
  text-decoration: underline;
}

code, pre {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
}

a:link, a:visited {
  color: #893ff4;
}

time {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

#reference,
#converter {
  max-width: 18em;
  border: 1px solid rgba(128, 128, 128, 0.2);
  box-shadow: rgba(0, 0, 0, 0.2) 0 .25em 1em;
  margin: 0 -1em;
  padding: 1em;
  position: relative;
  overflow: hidden;
}

@media (min-width: 400px) {
  #reference,
  #converter {
    margin: 0 auto;
    border-radius: .5em;
  }
}

#reference:before,
#converter:before {
  content: '@' attr(data-beats);
  font-size: 7.5em;
  font-weight: bold;
  color: rgba(128, 128, 128, 0.2);
  display: flex;
  align-items: center;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

@media (min-width: 370px) {
  #reference, #converter { font-size: 1.2em }
}

@media (min-width: 400px) {
  #reference, #converter { font-size: 1.3em }
}

@media (min-width: 500px) {
  #reference, #converter { font-size: 1.6em }
}

#heading {
  display: flex;
  margin-bottom: .5em;
}

#heading > h2 {
  font-size: 2.5em;
  font-weight: 900;
  margin: 0;
  margin-top: -.1em;
  margin-right: .25em;
  flex-grow: 1;
}

#heading > a:link {
  font-weight: bold;
  font-size: .7em;
  text-align: right;
  text-decoration: none;
  flex-shrink: 0;
}

#heading > a:hover,
#heading > a:focus {
  text-decoration: underline;
}

@media (max-width: 400px) {
  #heading > a:link {
    font-size: 0.2em;
  }

  #heading > a:link > span.beats {
    font-size: 3.5em;
    vertical-align: middle;
  }
}

#time-zones {
  font-weight: 600;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8em, 1fr));
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-left: 1.4em;
}

#local-zone {
  grid-column-start: 1;
  grid-column-end: span 2;
  margin-bottom: .25em;
}

#time-zones time[data-zone="local"]:after {
  content: 'Local';
  font-size: .5em;
  border-radius: .2em;
  text-transform: uppercase;
  background: rgba(128, 128, 128, 0.3);
  vertical-align: .4em;
  padding: 0 .25em;
}

#time-zones time {
  position: relative;
}

#time-zones time[data-zone="local"]:before,
#time-zones time[data-zone="US/Pacific"]:before,
#time-zones time[data-zone="Etc/UTC"]:before,
#time-zones time[data-zone="Asia/Tokyo"]:before {
  position: absolute;
  right: 100%;
  text-align: center;
  width: 1.4em;
  line-height: 1.3em;
}

#time-zones time[data-zone="local"]:before { content: '📍' }
#time-zones time[data-zone="US/Pacific"]:before { content: '🌎' }
#time-zones time[data-zone="Etc/UTC"]:before { content: '🌍' }
#time-zones time[data-zone="Asia/Tokyo"]:before { content: '🌏' }

#beats-input {
  position: relative;
  display: flex;
  align-items: center;
}

#beats-input,
#time-zones input[type="time"] {
  color: #893ff4;
}

#beats-input > select,
#beats-input > input,
#time-zones input[type="time"] {
  font: inherit;
  border: none;
  margin: 0;
  padding: 0;
  background: none;
  line-height: inherit;
}

#beats-input > input {
  z-index: 1;
  width: 100%;
  color: inherit;
}

#beats-input > select {
  font-size: .5em;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  appearance: none;
  -webkit-appearance: none;
  text-indent: -9999px;
}
