/**************
  Base
**************/

:root {
  --accent: #ed4e3a;
  --black: #222;
  --grey: #555;
  --midgrey: #bbb;
  --lightgrey: #eee;
  --silver: #f5f5f5;
  --buttonRadius: 10px;
}

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

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

body {
  color: var(--black);
  font-family: system, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
    'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  animation: fadeIn 500ms backwards;
}

a {
  color: var(--name);
  text-decoration: none;
}

.button {
  color: white;
  background: var(--black);
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-align: center;
  line-height: 1;
  cursor: pointer;
  padding: 1.5rem 3rem;
  box-shadow: 0 6px 9px rgba(150, 150, 150, 0.06),
    0 2px 5px rgba(150, 150, 150, 0.08);
  border-radius: var(--buttonRadius);
  min-width: max-content;
  margin-right: 2rem;
}

@media screen and (max-width: 800px) {
  .button {
    width: 100%;
    margin-right: 0;
  }
}

.button.disabled {
  user-select: none;
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/**************
  Header
**************/

.header {
  padding: 5%;
  color: var(--black);
  background-color: var(--accent);
}

.intro {
  font-size: 1rem;
  max-width: 45ch;
  margin-bottom: 8%;
}

@media screen and (max-width: 800px) {
  .intro {
    font-size: 14px;
    max-width: none;
  }
}

.intro-link {
  text-decoration: underline;
}

.title-svg {
  width: 100%;
  fill: var(--lightgrey);
}

.subtitle {
  margin-bottom: 5rem;
}
@media screen and (min-width: 800px) {
  .subtitle {
    font-size: 1.5rem;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media screen and (max-width: 800px) {
  .header-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
  }
}

.samples-link,
.license-link {
  white-space: nowrap;
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-decoration: underline;
}

.samples-link {
  order: 3;
}

@media screen and (min-width: 800px) {
  .samples-link {
    margin-right: 2rem;
    margin-left: auto;
    order: 1;
  }
}

.style-selector {
  border: none;
  outline: none;
  border-radius: 0;
  font-family: inherit;
  font-size: inherit;
  -webkit-appearance: none;
  order: 2;
  margin-top: 1rem;
  margin-bottom: 1rem;
  background-color: var(--lightgrey);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="11" viewBox="-469 273 8 11" enable-background="new -469 273 8 11"><path fill="gray" d="M-469 277l4-4 4 4zM-461 280l-4 4-4-4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  border-radius: var(--buttonRadius);
  box-shadow: 0 6px 9px rgba(150, 150, 150, 0.06),
    0 2px 5px rgba(150, 150, 150, 0.08);
  padding: 1.5rem;
  padding-right: 3rem !important;
  -webkit-padding-start: 1.5rem !important;
  -webkit-padding-end: 3rem !important;
}

.style-selector:focus {
  border-bottom-color: var(--accent);
}

@media screen and (max-width: 800px) {
  .style-selector {
    width: 100%;
  }
}

/**************
  Glyphs
**************/

.glyphs-container {
  display: flex;
  flex-wrap: nowrap;
  background-color: white;
}

.glyph-preview-wrap {
  position: sticky;
  top: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 600px;
  background-color: var(--black);
}

@media screen and (max-width: 1000px) {
  .glyph-preview-wrap {
    width: 50% !important;
  }
  .glyph-preview {
    width: auto !important;
    object-fit: contain !important;
  }
}

@media screen and (max-width: 800px) {
  .glyph-preview-wrap {
    display: none !important;
  }
}

.glyph-name {
  color: var(--midgrey);
  line-height: 1;
  font-size: 14px;
  padding: 0.3rem 0.5rem;
  background-color: #222;
  border-radius: 4px;
  display: inline-block;
  animation: fadeInRight 500ms 100ms backwards;
}

.glyph-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  height: 100%;
}

.glyph-preview.fadeInRight {
  animation: fadeInRight 500ms backwards;
}

.glyph-list-item {
  cursor: pointer;
  transition: background;
  min-width: 100px;
  min-height: 100px;
  object-fit: contain;
  width: 20% !important;
  transition-duration: 200ms;
  border-right: 1px solid var(--silver);
  border-bottom: 1px solid var(--silver);
}

@media screen and (min-width: 1800px) {
  .glyph-list-item {
    width: 10% !important;
  }
}

@media screen and (max-width: 1100px) {
  .glyph-list-item {
    width: 25% !important;
  }
}

@media screen and (max-width: 500px) {
  .glyph-list-item {
    width: 33.333% !important;
  }
}

.glyph-list-item:hover,
.glyph-list-item.is-selected {
  background-color: var(--silver);
}

.glyph-list-item:last-of-type {
  margin-right: auto;
}

/**************
  Sample Images
**************/

.sample-wrap {
  max-width: 100%;
  height: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sample-image {
  width: 100%;
  margin-bottom: 2rem;
  cursor: zoom-in;
}

.sample-image.is-selected {
  width: auto;
  cursor: zoom-out;
}

/**************
  License page
**************/

.license-body {
  border-top: 50px solid var(--silver);
  padding: 1rem;
}

.license-container {
  max-width: 75ch;
  margin: 0 auto;
  margin-top: 5rem;
}

.license-container h1 {
  line-height: 1.2;
  margin-bottom: 2rem;
}

.license-container h3 {
  margin-top: 2rem;
  border-top: 1px solid gainsboro;
  padding-top: 2rem;
  margin-bottom: 1rem;
}

.license-container ul {
  margin-top: 2rem;
  margin-bottom: 2rem;
  list-style-type: lower-alpha;
}

.license-container li {
  padding-left: 0.5rem;
  margin-bottom: 1rem;
}

.license-container p {
  margin-bottom: 2rem;
}

.license-container a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

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

.license-nav {
  margin-bottom: 2rem;
}

.license-nav .license-nav-link {
  margin-right: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.license-nav-link.current {
  font-weight: 700;
  text-decoration: underline;
}

/**************
  Animations
**************/

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
}

@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translateX(-1rem);
  }
}

@keyframes shake {
  15% {
    transform: translateX(0.5rem);
  }
  30% {
    transform: translateX(-0.4rem);
  }
  45% {
    transform: translateX(0.3rem);
  }
  60% {
    transform: translateX(-0.2rem);
  }
  75% {
    transform: translateX(0.1rem);
  }
  90% {
    transform: translateX(0);
  }
  90% {
    transform: translateX(0);
  }
}
