/* An app's page: its icon, name and line beside the store buttons, a row of
   screenshots that open full screen, a card for each feature with a glimpse
   of the app, and on a phone a last call to get it. */

.app-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin: 0 0 34px;
}

.head { display: flex; align-items: center; gap: 18px; }
.head img { width: 88px; height: 88px; border-radius: 20px; flex: none; }

.head .name {
  margin: 0;
  color: var(--gold);
  font: 400 38px/1.1 var(--heading);
  text-transform: uppercase;
}

.head .tagline {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font: 400 20px/1.3 var(--heading);
  letter-spacing: 0.3px;
}

.stores { display: flex; flex-wrap: wrap; gap: 10px; }

.store {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #555;
  border-radius: 10px;
  background: #000;
  color: #fff;
  text-decoration: none;
}

.store svg { width: 24px; height: 24px; fill: #fff; flex: none; }
.store small { display: block; font-size: 11px; opacity: 0.8; }
.store b { display: block; font: 500 18px/1.1 var(--heading); white-space: nowrap; }
.store small { white-space: nowrap; }

.app-page h2 {
  margin: 34px 0 14px;
  font: 400 26px var(--heading);
  text-transform: uppercase;
}

/* The screenshots, in a row that scrolls, with a round arrow on each side that
   still has screenshots to scroll to, and only then. */
.gallery { position: relative; }

.shots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.shots img {
  flex: none;
  width: auto;
  height: 420px;
  border-radius: 12px;
  scroll-snap-align: start;
}

/* Each arrow is only its round button, so a swipe anywhere else on the row,
   near its edges too, scrolls the screenshots. */
.edge {
  position: absolute;
  top: calc(50% - 5px);
  display: flex;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.edge.show { opacity: 1; pointer-events: auto; }
.edge.left { left: 5px; }
.edge.right { right: 5px; }

.edge::after {
  content: "";
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8) center / 20px no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.edge.right::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4l8 8-8 8' fill='none' stroke='%23000' stroke-width='2.5'/%3E%3C/svg%3E");
}

.edge.left::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4l-8 8 8 8' fill='none' stroke='%23000' stroke-width='2.5'/%3E%3C/svg%3E");
}

/* The features: the words on the left, a part of the app on the right, turned
   like the backdrop and fading into the card under the words. */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
}

.feature {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 220px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(217, 180, 91, 0.25);
  border-radius: 12px;
  background: #0b0905;
}

.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to right, #0b0905 40%, rgba(11, 9, 5, 0.55) 58%, rgba(11, 9, 5, 0) 80%);
}

.feature .glimpse {
  position: absolute;
  top: var(--top, 50%);
  right: var(--right, -30px);
  width: 62%;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  transform: translateY(-50%) rotate(-12deg);
}

.feature .words { position: relative; z-index: 2; max-width: 48%; }

.feature h3 {
  margin: 0 0 4px;
  font: 400 19px var(--heading);
  text-transform: uppercase;
}

.feature p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* The phone layout: once the store buttons no longer fit beside the name and
   drop to a line of their own, the name, the buttons and the headings centre,
   and a last call to get the app follows the features. The page's script
   sets "stacked". */
.app-page.stacked .top,
.app-page.stacked .stores { justify-content: center; }
.app-page.stacked h2 { text-align: center; }

.get-app { display: none; margin: 34px 0 0; }
.app-page.stacked .get-app { display: block; }

/* The screenshots opened full screen: on black, side by side in a row as wide
   as the window, each as large as the window allows. The row scrolls and
   snaps one screenshot at a time, so a swipe follows the finger. A close
   button on the right like the back button, and arrows either side. */
.shots img { cursor: zoom-in; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.94);
}

.viewer[hidden] { display: none; }

.viewer-strip {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.viewer-strip::-webkit-scrollbar { display: none; }

.viewer-slide {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  padding: 16px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.viewer-slide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
}

/* No scrolling the page behind while the viewer is open. */
html.viewing { overflow: hidden; }

.viewer-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  cursor: pointer;
}

.viewer .edge { z-index: 1; top: 50%; }
.viewer .edge.left { left: 14px; }
.viewer .edge.right { right: 14px; }
.viewer .edge[hidden] { display: none; }

@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .shots img { height: 360px; }
}
