/* BountyScope site styles. Fonts are self-hosted (no requests to Google). They are cached for a year without a
   ?v= query, so their file names carry the Google Fonts version: give a changed font a new file name. */

@font-face {
  font-family: "Alfa Slab One";
  src: url("../fonts/alfa-slab-one-v21-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-v20-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-italic-v20-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Colours come from the app icon: royal-blue sea, glowing scanner brackets, parchment, the wheel's dark wood and
   the red bandana. */
:root {
  --sea: #012c7a;
  --sea-light: #0a3f9a;
  --sea-deep: #001647;
  --paper: #eadcb0;
  --paper-edge: #d4bf86;
  --ink: #271c15;
  --stamp: #d71f24;
  --glow: #ffc93c;
  --glow-core: #fef179;
  --foam: #f1f4f9;
  --text: #0f1d3a;
  --muted: #4a5878;
  --line: #d5dcea;

  --slab: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif;
  --sans: "Libre Franklin", "Franklin Gothic", "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--foam);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--sea); text-underline-offset: .15em; }
a:hover { color: var(--stamp); }

:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  padding: .5rem 1rem;
  background: var(--glow);
  color: var(--ink);
  z-index: 10;
}
.skip:focus { left: 1rem; }

/* ---------- Header and footer ---------- */

.top { background: var(--sea); color: #fff; }

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--slab);
  font-size: 1.3rem;
  letter-spacing: .01em;
}
.wordmark:hover { color: inherit; }
.wordmark .app-icon { width: 36px; height: 36px; flex: none; }

/* The image files carry the iPhone's rounded icon shape; the shadow follows it. */
.app-icon { display: block; filter: drop-shadow(0 .15rem .3rem rgba(0, 10, 40, .35)); }

.top nav { display: flex; gap: 1.25rem; }
.top nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
}
.top nav a:hover,
.top nav a[aria-current="page"] { color: var(--glow); }

.foot {
  background: var(--sea-deep);
  color: #c3cde6;
  padding: 3rem 0 2.5rem;
  font-size: .9rem;
}
.foot .wordmark { color: #fff; font-size: 1.15rem; }
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 1.25rem 0 1.5rem;
}
.foot nav a { color: #fff; }
.foot nav a:hover { color: var(--glow); }
.foot__note { max-width: 60ch; margin: .5rem 0 0; color: #94a3c7; }

/* ---------- Store badges ---------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.badges img { display: block; height: 48px; width: auto; }
.badges a { display: block; border-radius: 9px; }
.badge-soon { display: flex; flex-direction: column; gap: .3rem; }
.badge-soon img { opacity: .45; filter: grayscale(1); }
.badge-soon span { font-size: .8rem; font-weight: 600; color: inherit; opacity: .8; }

/* ---------- Home: hero ---------- */

/* On the home page the header sits on the hero, so both share the hero's sea gradient. */
.home .top { position: absolute; left: 0; right: 0; z-index: 2; background: transparent; }

.hero {
  background: radial-gradient(110% 90% at 75% 35%, var(--sea-light) 0%, var(--sea) 45%, var(--sea-deep) 100%);
  color: #fff;
  padding: calc(4rem + clamp(2.5rem, 6vw, 5rem)) 0 clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.hero h1 {
  font-family: var(--slab);
  font-weight: 400;
  font-size: clamp(2.3rem, 5.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.005em;
  margin: 0 0 1.25rem;
  max-width: 14ch;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: #d9e2f5;
  max-width: 34rem;
  margin: 0 0 2rem;
}

.hero__small { margin: 1rem 0 0; font-size: .9rem; color: #9fb0d6; }

/* The bounty poster */

.poster {
  justify-self: center;
  width: min(100%, 22rem);
  margin: 0;
  padding: 1.4rem 1.5rem 1.3rem;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(120, 82, 30, .22) 100%),
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .35), transparent 40%),
    var(--paper);
  color: var(--ink);
  text-align: center;
  border: 1px solid var(--paper-edge);
  box-shadow: 0 1.5rem 3rem rgba(0, 10, 40, .5);
  transform: rotate(-2deg);
}

.poster__head {
  margin: 0 0 .9rem;
  font-family: var(--slab);
  font-size: clamp(2.6rem, 6vw, 3.4rem);
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* The poster's picture is the app icon's scene: the scanner over a card at sea. */
.poster__frame {
  padding: 1.3rem 0;
  border: 3px solid var(--ink);
  /* Darkest navy so the card stands out (a purple or blue card blends into the brighter royal blue). */
  background: var(--sea-deep);
}

.scan {
  position: relative;
  width: 66%;
  margin: 0 auto;
  aspect-ratio: 63 / 88;
}

/* The featured card (a real card image from assets.bountyscope.app, see inc/featured.php). */
.card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 4.5% / 3.2%;
  background: var(--sea-deep);
  /* Lit up by the scanner: an amber glow that follows the card's edge. */
  box-shadow: 0 0 1.1rem rgba(255, 201, 60, .45), 0 .3rem .8rem rgba(0, 0, 0, .5);
  transform: rotate(3deg);
}

/* Scanner corner brackets, glowing like the icon's. They close in on the card once, on page load. */
.corner {
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  border: 0 solid var(--glow-core);
  filter: drop-shadow(0 0 3px var(--glow)) drop-shadow(0 0 8px rgba(255, 170, 30, .7));
  animation: lock 0.9s cubic-bezier(.2, .8, .2, 1) .35s both;
}
.corner--tl { left: -12%; top: -9%; border-width: 5px 0 0 5px; border-top-left-radius: 40%; --dx: -18%; --dy: -18%; }
.corner--tr { right: -12%; top: -9%; border-width: 5px 5px 0 0; border-top-right-radius: 40%; --dx: 18%; --dy: -18%; }
.corner--bl { left: -12%; bottom: -9%; border-width: 0 0 5px 5px; border-bottom-left-radius: 40%; --dx: -18%; --dy: 18%; }
.corner--br { right: -12%; bottom: -9%; border-width: 0 5px 5px 0; border-bottom-right-radius: 40%; --dx: 18%; --dy: 18%; }

@keyframes lock {
  from { opacity: 0; translate: var(--dx) var(--dy); }
  to { opacity: 1; translate: 0 0; }
}

/* Under the picture, wanted-poster style: the name, then the bounty. */
.poster__name {
  margin: 1rem 0 .35rem;
  font-family: var(--slab);
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.poster__price {
  margin: 0 0 .5rem;
  font-family: var(--slab);
  font-size: clamp(2.4rem, 5.5vw, 3.1rem);
  line-height: 1;
  color: var(--stamp);
  font-variant-numeric: lining-nums;
  animation: stamp .35s cubic-bezier(.3, 1.4, .5, 1) 1.15s both;
}
.poster__currency { font-size: .6em; vertical-align: .45em; margin-right: .05em; }

@keyframes stamp {
  from { opacity: 0; scale: 1.5; }
  to { opacity: 1; scale: 1; }
}

.poster__note {
  max-width: 30ch;
  margin: 0 auto;
  font-size: .8rem;
  line-height: 1.4;
  color: #5b4a37;
}

@media (prefers-reduced-motion: reduce) {
  .corner, .poster__price { animation: none; }
}

/* ---------- Home: features ---------- */

.features { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.features__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.features h2,
.closing h2 {
  font-family: var(--slab);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  color: var(--sea);
  margin: 0;
}

.features h2 { position: sticky; top: 2rem; }
.features dl { margin: 0; }
.features dl > div {
  padding: 1.4rem 0;
  border-top: 2px solid var(--line);
}
.features dl > div:first-child { border-top: 0; padding-top: 0; }
.features dt {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: .35rem;
}
.features dd { margin: 0; color: var(--muted); max-width: 52ch; }

/* ---------- Home: closing call to action ---------- */

.closing {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.closing__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.closing h2 { color: var(--ink); }
.closing__app { display: flex; align-items: center; gap: 1.25rem; }
.app-icon--large { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 .4rem .8rem rgba(0, 10, 40, .35)); }

/* ---------- Legal and other text pages ---------- */

.doc { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem); }

.doc__body { max-width: 44rem; }

.doc h1 {
  font-family: var(--slab);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  line-height: 1.1;
  color: var(--sea);
  margin: 0 0 .5rem;
}
.doc__updated { margin: 0 0 2.25rem; color: var(--muted); font-size: .95rem; }

.doc h2 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 2.5rem 0 .6rem;
}
.doc h3 { font-size: 1.05rem; font-weight: 700; margin: 1.6rem 0 .4rem; }
.doc p, .doc ul, .doc ol { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin-bottom: .45rem; }
.doc li::marker { color: var(--muted); }

.summary {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-left: 4px solid var(--sea);
}
.summary ul { margin: 0; }
.summary li:last-child { margin-bottom: 0; }

.notfound { text-align: left; }
.notfound p { max-width: 40ch; }

/* ---------- Small screens ---------- */

@media (max-width: 52rem) {
  .hero__inner,
  .features__inner { grid-template-columns: minmax(0, 1fr); }
  .features h2 { position: static; }
  .poster { width: min(100%, 19rem); }
}

@media (max-width: 26rem) {
  .top nav { gap: .9rem; }
  .wordmark { font-size: 1.15rem; }
  .badges img { height: 44px; }
}
