/*
 * Wicket Cricket Manager site. Mobile first: base rules are for phones,
 * min-width media queries add the tablet / desktop layout.
 * Colours follow the app icon and store screenshots: graphite, pitch green,
 * caption yellow.
 */

:root {
  --bg: #151515;
  --bg-raised: #1f1f1f;
  --surface: #262626;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f5f2;
  --muted: #a9aca5;
  --accent: #ffd23a;
  --pitch: #2e8b47;
  --radius: 18px;
  --display: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Footer at the foot of the screen even when the page is short */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Heavy italic capitals, as on the store screenshots */
.display {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin: 0;
}

.display em {
  color: var(--accent);
  font-style: inherit;
}

/*
 * Header
 */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-right: auto;
  text-decoration: none;
  font-weight: 650;
  font-size: 16px;
  white-space: nowrap;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand img {
  flex: none;
  border-radius: 8px;
}

.pill {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

/*
 * Store buttons
 */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px 0 16px;
  border: 1px solid #a6a6a6;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.badge:hover {
  border-color: #fff;
}

.badge:active {
  transform: scale(0.97);
}

.badge__icon {
  width: 26px;
  height: 26px;
  flex: none;
}

.badge__text {
  display: flex;
  flex-direction: column;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.badge__text small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge--android .badge__text small {
  text-transform: uppercase;
}

/* Only used on phones, for the link to the other store */
.get__note {
  display: none;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.get__alt {
  display: none;
}

.get__alt a {
  color: var(--text);
}

/* On a phone, lead with the visitor's own store and keep the other as a link */
html[data-platform="ios"] .badges .badge--android,
html[data-platform="android"] .badges .badge--ios {
  display: none;
}

html[data-platform="ios"] .badges .badge,
html[data-platform="android"] .badges .badge {
  width: 100%;
  max-width: 340px;
  justify-content: center;
  height: 60px;
}

html[data-platform] .get__note {
  display: block;
}

html[data-platform="ios"] .get__alt--android,
html[data-platform="android"] .get__alt--ios {
  display: inline;
}

/* Computers get a link under the store buttons that opens a QR code */
.qr-link {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 500 15px/1.3 var(--body);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 4px;
  cursor: pointer;
}

.qr-link:hover {
  text-decoration-color: currentColor;
}

.qr-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (min-width: 760px) and (hover: hover) and (pointer: fine) {
  html:not([data-platform]) .qr-link {
    display: inline-flex;
  }
}

/* The pop-up: dark on white so every phone camera reads the code. It's a
   popover; browsers without them get .is-open from site.js instead. */
.qr-pop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 330px;
  height: fit-content;
  margin: auto;
  padding: 32px 28px 24px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #111;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.qr-pop:popover-open {
  display: block;
}

.qr-pop.is-open {
  display: block;
}

.qr-pop::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.qr-pop img {
  width: 200px;
  height: 200px;
  margin: 0 auto 18px;
}

.qr-pop strong {
  display: block;
  font-size: 17px;
}

.qr-pop p {
  margin: 6px 0 0;
  color: #555;
  font-size: 14px;
  line-height: 1.4;
}

.qr-pop__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #555;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.qr-pop__close:hover {
  background: #eee;
}

/*
 * Hero
 */

.hero {
  position: relative;
  padding: 28px 0 40px;
  overflow: hidden;
}

/* A pitch-green glow across the top of the landing page */
body.home {
  background:
    radial-gradient(90% 600px at 50% 0%, rgba(46, 139, 71, 0.22), transparent 75%) no-repeat,
    var(--bg);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Icon, name and price, the way a store listing opens */
.app-id {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.app-id img {
  flex: none;
  border-radius: 15px;
  box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.app-id strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.app-id span {
  color: var(--muted);
  font-size: 14px;
}

.app-id .star,
.app-bar .star {
  color: var(--accent);
}

/* The headline stays on one line: the line is about 9.5em wide, so 10% of
   the copy column (10cqi) always fits it, up to 88px on big screens */
.hero__copy {
  min-width: 0;
  container-type: inline-size;
}

.hero h1 {
  white-space: nowrap;
  font-size: 8.5vw;
  font-size: min(10cqi, 88px);
}

.lead {
  margin: 16px 0 24px;
  max-width: 34em;
  color: var(--muted);
  font-size: 17px;
}

/* The phone, showing the store screenshots in turn, sits on a pitch-green glow */
.hero__phone {
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
  background: radial-gradient(closest-side, rgba(46, 139, 71, 0.45), transparent) center / 100% 80% no-repeat;
}

.phone {
  width: 270px;
  padding: 9px;
  border-radius: 42px;
  background: #080808;
  box-shadow:
    0 0 0 2px #3a3a3a,
    0 30px 60px rgba(0, 0, 0, 0.55);
}

.phone__screen {
  position: relative;
  aspect-ratio: 1320 / 2868;
  overflow: hidden;
  border-radius: 33px;
  background: #1f1f1f;
}

.phone__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.phone__screen img.is-active {
  opacity: 1;
}

/*
 * Sticky download bar (home page, phones only)
 */

.app-bar {
  position: fixed;
  z-index: 10;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(31, 31, 31, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(calc(100% + 40px));
  transition: transform 0.3s ease;
}

.app-bar.is-visible {
  transform: none;
}

.app-bar img {
  border-radius: 11px;
}

.app-bar__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
  line-height: 1.25;
}

.app-bar__text strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar__text span {
  color: var(--muted);
  font-size: 13px;
}

.app-bar__get {
  flex: none;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Keep the footer clear of the bar */
.home .site-footer {
  color: var(--muted);
  font-size: 14px;
}

/* Icon and name, filled social circles, then the small print */
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.footer-brand img {
  flex: none;
  border-radius: 10px;
}

.footer-brand strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.footer-brand small {
  font-size: 13px;
}

.socials {
  display: flex;
  gap: 10px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.socials a:hover {
  background: #333;
  color: var(--accent);
}

.socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 13px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/*
 * Tablet and desktop
 */

@media (min-width: 760px) {
  .wrap {
    padding: 0 32px;
  }

  /* The landing page is one screen: the hero sits in the middle of it */
  .home main {
    display: flex;
    align-items: center;
  }

  .hero {
    width: 100%;
    padding: 48px 0;
  }

  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: 48px;
  }

  .hero__copy {
    flex: 1;
  }

  .hero__phone {
    flex: none;
  }

  .phone {
    width: 300px;
  }

  .promo {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .app-bar {
    display: none;
  }

  .home .site-footer {
    padding-bottom: 0;
  }

  /* One row: brand on the left, small print and socials on the right */
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    gap: 28px;
  }

  .footer-brand {
    margin-right: auto;
  }

  .footer-links {
    order: 1;
  }

  .socials {
    order: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .app-bar,
  .badge {
    transition: none;
  }
}
