/* global styles and variables */

:root {
  --primary: #0066c0;
  --hover: #c45500;
  --white: #fff;
  --black: #111;
  --secondary: #555;
  --tertiary: #767676;
  --page-bg: #f3f3f3;
  --tabs-fade-width: 80px;
  --page-max-width: 1100px;
  --section-inline-margin: 2rem;
  --section-block-margin: 3rem;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 1.2em;
}
@media screen and (max-width: 800px) {
  html {
    font-size: 1em;
  }
}
@media screen and (max-width: 500px) {
  html {
    font-size: 0.9em;
  }
}

h1 {
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.2;
}
h2 {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.2;
}
h3 {
  font-weight: 500;
  font-size: 1.1rem;
}
h4 {
  font-size: 500;
  font-size: 1rem;
}

body {
  background-color: var(--page-bg);
  margin: 0;
  font-family: "Amazon Ember Display", "Amazon Ember", Arial;
  line-height: 1.4;
  color: var(--black);
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page {
  max-width: var(--page-max-width);
}

a,
a:link,
a:visited {
  color: var(--primary);
}

a:hover,
a:active {
  color: var(--hover);
}

*:focus {
  outline: none;
  box-shadow: 0 0 0 0.075rem var(--white), 0 0 0 0.2rem var(--primary);
}
[data-whatintent="mouse"] *:focus,
[data-whatintent="touch"] *:focus {
  box-shadow: inherit;
}

.page-header {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  color: var(--white);
  background: var(--primary);
}
.page-header:before {
  content: "";
  width: 100%;
  height: 100%;
  background-image: url(ribbons-30deg.svg);
  position: absolute;
  overflow: hidden;
  background-size: 5rem;
  background-position: center center;
  z-index: 1;
}
.page-header:after {
  content: "";
  width: 100%;
  height: 100%;
  background: linear-gradient(
    185deg,
    var(--primary) 33%,
    rgba(0, 102, 192, 0) 100%
  );
  position: absolute;
  z-index: 1;
}

.page-header .logo {
  width: 100%;
  max-width: 14rem;
  margin-bottom: 2rem;
  z-index: 4;
}
.page-header .copy {
  flex-shrink: 1;
}
.page-header .copy h1 {
  margin-bottom: 2rem;
}
.header-layout {
  z-index: 4;
  display: flex;
  align-items: center;
  max-width: var(--page-max-width);
  padding: 2.2rem var(--section-inline-margin) 1rem var(--section-inline-margin);
}
.page-header .mock {
  margin-left: 2rem;
  width: 100%;
  max-width: 260px;
  min-width: 150px;
}
.page-header .mock img {
  max-width: 100%;
  max-height: 70vh;
  min-height: 18rem;
}

@media screen and (max-width: 800px) {
}
@media screen and (max-width: 500px) {
  .header-layout {
    flex-direction: column;
    align-items: center;
  }
  .page-header .mock {
    margin-left: 0;
    margin-top: 2rem;
    width: 200px;
  }
  .page-header .logo {
    margin-top: 2rem;
  }
}

.page-header .app-store-links {
  display: flex;
  margin-top: 1rem;
  justify-content: flex-start;
}
.page-header .app-store-links a {
  margin-right: 1rem;
}
.page-header .app-store-links a img {
  display: block;
  height: 50px;
  width: auto;
}
@media (max-width: 600px) {
  .page-header .app-store-links a img {
    height: 40px;
  }
}
@media (max-width: 500px) {
  .page-header {
    text-align: center;
  }
  .page-header .app-store-links {
    justify-content: center;
  }
}

section {
  margin: var(--section-block-margin) var(--section-inline-margin);
  padding-bottom: 2rem;
  border-bottom: 2px solid #ddd;
}
section.faq {
  border: 0;
}
.page-header + section {
  margin: 0.5rem 2rem;
}
section h2 {
  margin-bottom: 1rem;
  font-weight: 500;
}
section p {
  font-size: 1rem;
  line-height: 150%;
  margin: 1rem 0;
}

section ul {
  margin-left: 1.2rem;
}
section ul li {
  padding-left: 0.4rem;
}

/* screenshots section */
/* adjust padding/margin due to no header */
section.screens {
  padding-bottom: var(--section-block-margin);
  margin-top: 0;
}
/* set up screenshot links as an unordered list */
section.screens ul {
  padding: 0;
  text-align: center;
  white-space: nowrap;
  /* trick to emulate CSS grid gap feature */
  --gap: 1rem;
  display: inline-flex;
  flex-wrap: wrap;
  margin: calc(-1 * var(--gap)) 0 0 calc(-1 * var(--gap));
  width: calc(100% + var(--gap));
}
section.screens ul li {
  list-style-type: none;
  padding: 0;
  margin: none;
  display: inline-block;
  /* 4 columns by default */
  flex-basis: calc(100% / 4 - var(--gap));
  margin: var(--gap) 0 0 var(--gap);
}
@media (max-width: 600px) {
  section.screens ul > li {
    /* 2 columns when <600px wide */
    flex-basis: calc(100% / 2 - var(--gap));
  }
}

section.screens ul li img {
  width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 20px 20px -20px rgba(0, 0, 0, 0.25);
  transition: all 0.1s ease-in-out;
}

/* small transition on screenshot images when hovered with a mouse */
@media (pointer: fine) {
  section.screens ul li:hover img {
    box-shadow: 0 20px 30px -20px rgba(0, 0, 0, 0.4);
    transform: scale(1.03) rotate(-0.5deg) translateY(-2px);
  }
}

/* override styles provided by tobii */
/* reposition zoom icons, hide by default */
.tobii-zoom__icon {
  bottom: -0.88888rem;
  left: 50%;
  top: auto;
  margin-left: -0.888888rem;
  border-radius: 0.25rem;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.1s ease-in-out;
}
.tobii-zoom:hover .tobii-zoom__icon {
  opacity: 0.5;
  transform: scale(1);
}
/* hide zoom icons from touch screens */
@media (pointer: coarse) {
  .tobii-zoom__icon {
    display: none;
  }
}

/* hide captions on zoomed-in slides */
.tobii__slide figcaption {
  display: none;
}

/* move slide counter */
.tobii__counter {
  bottom: 1.4rem;
  left: 0;
  top: auto;
  text-align: center;
  width: 100%;
  font-weight: 700;
}

/* increase button opacity for better color contrast */
.tobii__btn {
  transition: opacity 0.1s ease-in-out;
  opacity: 0.7;
}
.tobii__btn:hover,
.tobii__btn:active {
  opacity: 1;
}
/* reduce slide max height */
:root {
  --slide-max-height: 72vh;
}
.tobii__slide figure img {
  border-radius: 0.8rem;
}

/* FAQ section */
.tabbed {
  position: relative;
}
.tabs-scroll {
  overflow-x: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--section-inline-margin)) 0
    calc(-1 * var(--section-inline-margin));
  max-width: 100vw;
}
.tabs-scroll::-webkit-scrollbar {
  display: none;
}

[role="tablist"] {
  padding: 0 var(--section-inline-margin) 1rem var(--section-inline-margin);
  max-width: 100vw;
  display: flex;
  margin: 0;
}

/* add a focus indicator to the tab controls, but only for keyboard input */
[data-whatintent="keyboard"] .tabs-scroll:focus-within {
  box-shadow: 0 0 0 0.075rem var(--white), 0 0 0 0.2rem var(--primary) !important;
}

[role="tablist"] li {
  margin-right: 0.5rem;
  list-style-type: none;
  padding: 0;
  display: inline-flex;
}
[role="tablist"] li:last-child:after {
  content: "";
  width: var(--section-inline-margin);
}

[role="tablist"] a {
  text-decoration: none;
  font-size: 1rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.8rem 1.3rem;
  background-color: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  margin-right: 0.2rem;
  transition: all 0.1s ease-in-out;
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0);
}

[role="tablist"] a:hover {
  color: var(--hover);
  background-color: rgba(0, 0, 0, 0.1);
}

/* bold pseudo-elements to prevent layout shift */
[role="tablist"] a::after {
  content: attr(data-text);
  height: 0;
  visibility: hidden;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  font-weight: 700;
}
/* don't speak the pseudo-elements in a screen reader */
@media speech {
  [role="tablist"] a::after {
    display: none;
  }
}

[role="tablist"] li [aria-selected] {
  font-weight: 700;
  color: var(--white);
  background-color: var(--primary);
  border-radius: 999px;
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.3);
}

/* FAQ tab contents */

[role="tabpanel"] {
  background-color: var(--white);
  padding: 1.4rem;
  padding-right: 1.4rem;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
  border-radius: 0.4rem;
  box-shadow: 0 20px 30px -20px rgba(0, 0, 0, 0.25);
}

[role="tabpanel"] h3:not(:first-of-type) {
  margin-top: 1.4rem;
}

s {
  /* hide certain text from FAQ */
  display: none;
}

.page-legal {
  margin-top: 4rem;
  border: 0;
  text-align: center;
}
.page-legal p {
  font-size: 0.8rem;
  color: #666;
  margin: 0.25rem 0;
}
