/*
 * The one style sheet of EZ Apps.
 *
 * Idea: the blue-and-white tiles (azulejos) of Porto and Vila Nova de Gaia. The site has one cobalt ink on cool
 * porcelain white (deep navy in dark mode). The tile motif appears in the home hero, on the card art and on the
 * footer edge. Each app brings its own colours through --accent, --on-accent, --icon-bg and --on-icon-bg;
 * scripts/build.mjs appends one rule per app (.app-<id>) to the end of this file.
 *
 * Font: Bricolage Grotesque (SIL Open Font License, /fonts/OFL.txt), one variable file, Latin subset, served
 * from this site. Motion: one entrance of the hero tiles and small hover lifts; none under reduced motion.
 */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #e8edf8;
  --line: #d3dbec;
  --text: #0f1a3d;
  --dim: #46557c;
  --cobalt: #1a3fb0;
  --link: #1a3fb0;
  --focus: #1a3fb0;
  --tile-bg: #ffffff;
  --tile-ink: #1a3fb0;
  --tile-ink-2: #93a9ea;
  --foot-bg: #13308f;
  --foot-text: #ffffff;
  --foot-dim: #d4ddff;
  --live: #0f5e37;
  --live-bg: #dbf2e4;
  --test: #7a4300;
  --test-bg: #fdebc8;
  --soon: #283a80;
  --soon-bg: #e2e8fa;
  --shadow: 0 1px 2px rgb(15 26 61 / 0.06), 0 10px 30px -12px rgb(15 26 61 / 0.22);
  --shadow-up: 0 2px 4px rgb(15 26 61 / 0.08), 0 22px 44px -16px rgb(15 26 61 / 0.32);
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --accent: var(--cobalt);
  --on-accent: #ffffff;
  --icon-bg: var(--surface-2);
  --on-icon-bg: var(--text);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1029;
    --surface: #111a3d;
    --surface-2: #1b2655;
    --line: #27346b;
    --text: #edf1fc;
    --dim: #aeb9db;
    --cobalt: #9fb6ff;
    --link: #a9beff;
    --focus: #a9beff;
    --tile-bg: #111a3d;
    --tile-ink: #5f80ea;
    --tile-ink-2: #2b3f94;
    --foot-bg: #16256a;
    --foot-text: #edf1fc;
    --foot-dim: #aeb9db;
    --live: #8fe0b0;
    --live-bg: #123a29;
    --test: #f6c66e;
    --test-bg: #3b2b0c;
    --soon: #c8d2f7;
    --soon-bg: #222e62;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 30px -12px rgb(0 0 0 / 0.6);
    --shadow-up: 0 2px 4px rgb(0 0 0 / 0.4), 0 22px 44px -16px rgb(0 0 0 / 0.8);
    --icon-bg: #19244f;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  font-optical-sizing: auto;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

h1,
h2,
h3 {
  line-height: 1.1;
  margin: 0 0 0.5em;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem);
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem);
}

h3 {
  font-size: 1.4rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  width: min(100% - 2.5rem, 1200px);
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - 2.5rem, 760px);
}

.ico {
  width: 1.05em;
  height: 1.05em;
  flex: none;
}

/* ------------------------------------------------------------------------------------------------------------
 * Top bar */

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5em 1em;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
}

.skip:focus {
  top: 0.75rem;
}

.topbar {
  padding: 1.1rem 0;
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 750;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-by {
  font-size: 0.85rem;
  color: var(--dim);
}

.lang {
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
  padding: 0.45em 1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang:hover {
  border-color: var(--cobalt);
}

/* ------------------------------------------------------------------------------------------------------------
 * Buttons, chips, state labels */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.75em 1.35em;
  border-radius: 999px;
  background: var(--cobalt);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.chips {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.7em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--dim);
}

.chip-kind {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text);
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.2em 0.75em;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}

.state::before {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
}

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

.state-in-test {
  color: var(--test);
  background: var(--test-bg);
}

.state-coming-soon {
  color: var(--soon);
  background: var(--soon-bg);
}

.state-coming-soon::before {
  background: transparent;
  border: 2px solid currentColor;
}

/* ------------------------------------------------------------------------------------------------------------
 * Home: hero with the tile panel */

.hero {
  padding: clamp(1.5rem, 5vw, 4.5rem) 0 clamp(3rem, 7vw, 6rem);
}

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

.hero h1 {
  font-size: clamp(3.6rem, 1.4rem + 8vw, 8.25rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin-bottom: 0.35em;
  color: var(--cobalt);
}

.hero h1 .by {
  display: block;
  margin-top: 0.45em;
  font-size: max(0.19em, 1.15rem);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: var(--text);
}

.lead {
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin-bottom: 0.7em;
}

.intro {
  color: var(--dim);
  max-width: 44ch;
  font-size: 1.1rem;
}

.hero-go {
  margin: 1.6rem 0 0;
}

/* Nine tiles. The pattern of a tile is drawn with gradients; corner quarter circles meet across the joints. */
.tiles {
  --gap: clamp(5px, 0.8vw, 9px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  width: 100%;
  max-width: 470px;
  justify-self: end;
  padding: var(--gap);
  background: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: hidden;
  --q: var(--tile-ink);
  --r: var(--tile-ink-2);
  background-color: var(--tile-bg);
  background-image:
    radial-gradient(circle at 0 0, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 100% 0, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 0 100%, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 100% 100%, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 50% 50%, var(--q) 0 7%, transparent calc(7% + 1px) 15%, var(--r) calc(15% + 1px) 21%, transparent calc(21% + 1px));
  animation: tile-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 27%;
  border: 3px solid var(--r);
  transform: rotate(45deg);
}

.tile-p2 {
  --q: var(--tile-ink-2);
  --r: var(--tile-ink);
  background-image:
    radial-gradient(circle at 50% 0, var(--r) 0 18%, transparent calc(18% + 1px)),
    radial-gradient(circle at 50% 100%, var(--r) 0 18%, transparent calc(18% + 1px)),
    radial-gradient(circle at 0 50%, var(--r) 0 18%, transparent calc(18% + 1px)),
    radial-gradient(circle at 100% 50%, var(--r) 0 18%, transparent calc(18% + 1px)),
    radial-gradient(circle at 50% 50%, var(--q) 0 12%, transparent calc(12% + 1px));
}

.tile-p2::before {
  inset: 30%;
  border-color: var(--q);
  border-radius: 50%;
}

.tile-app {
  --q: color-mix(in srgb, var(--accent) 70%, var(--icon-bg));
  background-color: var(--icon-bg);
  background-image:
    radial-gradient(circle at 0 0, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 100% 0, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 0 100%, var(--q) 0 24%, transparent calc(24% + 1px)),
    radial-gradient(circle at 100% 100%, var(--q) 0 24%, transparent calc(24% + 1px));
  display: grid;
  place-items: center;
}

.tile-app::before {
  content: none;
}

.tile-app .icon {
  width: 58%;
  aspect-ratio: 1;
  border-radius: 23%;
  overflow: hidden;
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.45);
  transform: rotate(-2deg);
}

.tile-app .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile:nth-child(1) { animation-delay: 0.05s; }
.tile:nth-child(2) { animation-delay: 0.1s; }
.tile:nth-child(4) { animation-delay: 0.15s; }
.tile:nth-child(3) { animation-delay: 0.2s; }
.tile:nth-child(5) { animation-delay: 0.25s; }
.tile:nth-child(7) { animation-delay: 0.3s; }
.tile:nth-child(6) { animation-delay: 0.35s; }
.tile:nth-child(8) { animation-delay: 0.4s; }
.tile:nth-child(9) { animation-delay: 0.45s; }

@keyframes tile-in {
  from {
    opacity: 0;
    transform: scale(0.86) rotate(-6deg);
  }
}

/* ------------------------------------------------------------------------------------------------------------
 * Home: the list of apps */

.list {
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--text);
}

.list-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.75rem);
}

.count {
  margin: 0;
  color: var(--dim);
  font-weight: 550;
}

.empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--dim);
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 20px;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (min-width: 760px) {
  .cards[data-cols='2'],
  .cards[data-cols='3'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .cards[data-cols='3'] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-up);
}

.card:has(.card-title:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.card-in {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* The art: the app's own colours, its tile dots, the icon and one screenshot that peeks in. */
.card-art {
  position: relative;
  flex: none;
  height: 176px;
  overflow: hidden;
  background-color: var(--icon-bg);
  background-image:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--accent) 60%, var(--icon-bg)) 0 9px, transparent 9.5px),
    radial-gradient(circle at 50% 50%, transparent 0 6px, color-mix(in srgb, var(--accent) 45%, var(--icon-bg)) 6.5px 8px, transparent 8.5px);
  background-size: 44px 44px;
  background-position: -22px -22px;
}

.card-art .icon {
  position: absolute;
  z-index: 1;
  left: 1.4rem;
  top: 50%;
  width: 104px;
  height: 104px;
  margin-top: -52px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.5), 0 0 0 4px var(--icon-bg);
}

.card-art .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.peek {
  position: absolute;
  overflow: hidden;
  border-radius: 14px;
  border: 4px solid color-mix(in srgb, var(--on-icon-bg) 85%, transparent);
  box-shadow: 0 14px 30px -10px rgb(0 0 0 / 0.55);
  background: color-mix(in srgb, var(--on-icon-bg) 12%, var(--icon-bg));
  transition: transform 0.25s ease;
}

.peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.peek-port {
  width: 118px;
  height: 236px;
  right: 1.5rem;
  top: 26px;
  transform: rotate(6deg);
}

.peek-land {
  width: 260px;
  height: 130px;
  right: -36px;
  top: 30px;
  transform: rotate(-5deg);
}

.card:hover .peek-port {
  transform: rotate(3deg) translateY(-8px);
}

.card:hover .peek-land {
  transform: rotate(-2deg) translateX(-8px);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.4rem 1.4rem;
}

.card-state {
  margin: 0 0 0.6rem;
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.65rem;
}

.card-title {
  color: var(--text);
  text-decoration: none;
}

/* The title link covers the whole card; the store links sit above it. */
.card-title::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-title:focus-visible {
  outline: none;
}

.card-title:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.card-pitch {
  color: var(--dim);
  margin-bottom: 1.1rem;
  max-width: 52ch;
}

.card-links {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.95em;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--text);
  color: var(--surface);
}

.pill:hover {
  background: var(--cobalt);
  color: var(--bg);
}

.pill-plain {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.pill-plain:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

.pill-off {
  background: transparent;
  color: var(--dim);
  border: 1px dashed var(--line);
  font-weight: 550;
}

.pill-note {
  font-weight: 400;
  text-transform: lowercase;
  font-size: 0.85em;
}

.pill-note::before {
  content: '(';
}

.pill-note::after {
  content: ')';
}

/* A wide card: the art on the left, the text on the right. */
@container (min-width: 540px) {
  .card-in {
    flex-direction: row;
  }

  .card-art {
    width: 42%;
    height: auto;
    min-height: 300px;
  }

  .card-art .icon {
    top: 1.4rem;
    margin-top: 0;
  }

  .peek-port {
    right: 1.4rem;
    top: auto;
    bottom: -64px;
    width: 128px;
    height: 256px;
  }

  .peek-land {
    left: 1.4rem;
    right: -60px;
    top: auto;
    bottom: 1.4rem;
    width: auto;
    height: 130px;
  }

  .card-body {
    padding: 1.6rem 1.7rem 1.7rem;
  }

  .card h3 {
    font-size: 1.9rem;
  }
}

/* ------------------------------------------------------------------------------------------------------------
 * App page */

.app-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--icon-bg);
  color: var(--on-icon-bg);
  padding: 1rem 0 clamp(2.25rem, 5vw, 3.75rem);
}

.app-hero::after {
  content: '';
  position: absolute;
  inset: 0 0 0 45%;
  background-image:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--accent) 60%, var(--icon-bg)) 0 14px, transparent 14.5px),
    radial-gradient(circle at 50% 50%, transparent 0 10px, color-mix(in srgb, var(--accent) 45%, var(--icon-bg)) 10.5px 13px, transparent 13.5px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to left, #000 10%, transparent 85%);
  pointer-events: none;
}

.app-hero .wrap {
  position: relative;
  z-index: 1;
}

.back-line {
  margin: 0 0 1.75rem;
}

.back {
  color: inherit;
  font-weight: 550;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.back::before {
  content: '←';
}

.back:hover {
  text-decoration: underline;
}

.app-hero :focus-visible {
  outline-color: currentColor;
}

.app-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: center;
}

.app-head .icon {
  display: block;
  width: clamp(104px, 14vw, 160px);
  aspect-ratio: 1;
  border-radius: 24%;
  overflow: hidden;
  box-shadow: 0 18px 40px -14px rgb(0 0 0 / 0.55), 0 0 0 5px color-mix(in srgb, var(--on-icon-bg) 18%, transparent);
}

.app-head .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-state {
  margin: 0 0 0.6rem;
}

.app-head h1 {
  font-size: clamp(2.6rem, 1.4rem + 4.5vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0 0 0.3em;
}

.app-pitch {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  font-weight: 500;
  line-height: 1.3;
  max-width: 40ch;
  margin-bottom: 0.9rem;
}

.app-hero .chip {
  color: inherit;
  border-color: color-mix(in srgb, var(--on-icon-bg) 35%, transparent);
}

.app-hero .chip-kind {
  background: color-mix(in srgb, var(--on-icon-bg) 12%, transparent);
  border-color: transparent;
}

.app-get {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* A store button in the manner of the store badges: black, a symbol, a small line and the store name. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 56px;
  padding: 0.45rem 1.15rem 0.45rem 0.9rem;
  border-radius: 12px;
  background: #000;
  color: #fff;
  border: 1px solid #a6a6a6;
  text-decoration: none;
  transition: transform 0.15s ease;
}

a.badge:hover {
  transform: translateY(-2px);
}

.badge-ico {
  width: 28px;
  height: 28px;
  flex: none;
}

.badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.badge-line {
  font-size: 0.75rem;
  font-weight: 450;
}

.badge-name {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.badge-off {
  background: transparent;
  color: inherit;
  border: 2px dashed color-mix(in srgb, var(--on-icon-bg) 45%, transparent);
}

.badge-off .badge-name {
  font-size: 1.05rem;
}

.badge-off .badge-line {
  order: 2;
  font-size: 0.82rem;
  font-weight: 600;
}

.no-store {
  margin: 0;
  font-weight: 550;
}

.app-site {
  margin: 0;
}

.btn-site {
  background: var(--on-icon-bg);
  color: var(--icon-bg);
  min-height: 56px;
}

.app-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  align-items: start;
}

.app-text {
  font-size: 1.14rem;
  line-height: 1.65;
  max-width: 62ch;
}

.app-text p:first-child {
  font-size: 1.3rem;
  line-height: 1.5;
  font-weight: 500;
}

.app-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 18px;
  padding: 1.4rem 1.5rem 0.6rem;
  box-shadow: var(--shadow);
}

.facts-title {
  font-size: 1.2rem;
  margin-bottom: 0.9rem;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--dim);
  padding-right: 1.25rem;
}

.facts dd {
  font-weight: 550;
}

.shots-band {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.shots-scroll {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(1.25rem, (100% - 1200px) / 2);
  padding: 0.5rem 0 1.25rem;
  overscroll-behavior-x: contain;
}

.shots-scroll:focus-visible {
  outline-offset: -3px;
}

.shots {
  list-style: none;
  margin: 0;
  padding: 0 max(1.25rem, (100% - 1200px) / 2);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: max-content;
}

.shots li {
  flex: none;
  scroll-snap-align: start;
}

.shots img {
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}

.shot-port img {
  height: clamp(340px, 62vh, 580px);
  width: auto;
}

.shot-land img {
  width: min(84vw, 760px);
  height: auto;
}

/* ------------------------------------------------------------------------------------------------------------
 * Legal pages and 404 */

.doc-main {
  padding: 1rem 0 4rem;
}

.doc-main .back {
  color: var(--link);
}

.doc {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.doc h1 {
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--cobalt);
}

.doc h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
}

.doc-date {
  color: var(--dim);
}

.doc-intro {
  font-size: 1.2rem;
  font-weight: 500;
}

.doc .facts {
  margin: 1.5rem 0;
}

.doc ul {
  padding-left: 1.25rem;
}

.lost > div + div {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------------------------------------------------
 * Footer: a scalloped tile edge, then the publisher */

.foot {
  position: relative;
  margin-top: 28px;
  background: var(--foot-bg);
  color: var(--foot-text);
  padding: 2.75rem 0 2rem;
}

.foot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -27px;
  height: 28px;
  background-image: radial-gradient(circle at 50% 100%, var(--foot-bg) 0 13px, transparent 13.5px);
  background-size: 28px 28px;
}

.foot-in {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 1.5rem 3rem;
}

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

.foot :focus-visible {
  outline-color: var(--foot-text);
}

.foot-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}

.foot-name span {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.foot-brand p:last-child,
.foot-address {
  color: var(--foot-dim);
}

.foot-address {
  font-style: normal;
  line-height: 1.55;
}

.foot-address strong {
  color: var(--foot-text);
}

.foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.foot-small {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--foot-text) 22%, transparent);
  color: var(--foot-dim);
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------------------------------------------------
 * Narrow screens */

@media (max-width: 860px) {
  .hero-in {
    grid-template-columns: 1fr;
  }

  .tiles {
    grid-template-columns: repeat(4, 1fr);
    max-width: none;
    justify-self: stretch;
    transform: rotate(-1.5deg);
  }

  .tile:nth-child(9) {
    display: none;
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .foot-in {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .app-head {
    grid-template-columns: 1fr;
  }

  .app-get,
  .badges {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-site {
    justify-content: center;
  }

  .foot-in {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .brand-by {
    display: none;
  }

  .card-art .icon {
    width: 88px;
    height: 88px;
    margin-top: -44px;
  }
}

/* ------------------------------------------------------------------------------------------------------------
 * Reduced motion: no entrance, no lift */

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .card:hover,
  .btn:hover,
  a.badge:hover {
    transform: none;
  }

  .card:hover .peek-port {
    transform: rotate(6deg);
  }

  .card:hover .peek-land {
    transform: rotate(-5deg);
  }
}

/* A store that is not public but has an open test anyone can join: a link to the test page on the app's site. */
.pill-test {
  color: var(--text);
  border-style: solid;
}

.pill-test:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

.badge-test {
  border-style: solid;
  text-decoration: none;
}

.badge-test:hover .badge-line {
  text-decoration: underline;
}

/* ------------------------------------------------------------------------------------------------------------
 * Android test page (/apps/<id>/android-test/): the app banner, then three numbered step cards. */

.test-hero .app-head h1 {
  font-size: clamp(2.1rem, 1.2rem + 3.6vw, 4rem);
}

.test-hero .state {
  background: color-mix(in srgb, var(--on-icon-bg) 12%, transparent);
  color: inherit;
}

.test-why {
  max-width: 52ch;
  margin: 0;
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--on-icon-bg) 8%, var(--icon-bg));
  position: relative;
  font-weight: 550;
  line-height: 1.45;
}

.test-body {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.step {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 18px;
  padding: 1.4rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.35rem;
  font-weight: 800;
}

.step h2 {
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}

.step p {
  margin: 0 0 1.1rem;
  line-height: 1.55;
}

.step .step-go {
  margin: auto 0 0;
}

.btn-step {
  background: var(--accent);
  color: var(--on-accent);
}

.test-note {
  max-width: 62ch;
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  color: var(--dim);
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .btn-step {
    width: 100%;
    justify-content: center;
  }
}

/* App colours, written by scripts/build.mjs from apps/<id>/app.json. */
.app-backyard-bloom{--accent:#2f5a24;--on-accent:#ffffff;--icon-bg:#fbf5e3;--on-icon-bg:#000000}
.app-lunar-return{--accent:#c74f00;--on-accent:#ffffff;--icon-bg:#05060f;--on-icon-bg:#ffffff}
.app-recreio{--accent:#cb4900;--on-accent:#ffffff;--icon-bg:#e9ddff;--on-icon-bg:#000000}
.app-verissimum{--accent:#372a6b;--on-accent:#ffffff;--icon-bg:#171233;--on-icon-bg:#ffffff}
.app-tuki{--accent:#9a4a00;--on-accent:#ffffff;--icon-bg:#fff1e3;--on-icon-bg:#000000}
