/* Per-app landing page. Dark tokens = asoview.org styles.css; light tokens derived for prefers-color-scheme: light. */
:root {
  --bg: #0b1020;
  --card: #141a2e;
  --line: #232b45;
  --ink: #f2f5fb;
  --muted: #9aa4bf;
  --accent: #38bdf8;
  --ok: #34d399;
  --top: rgba(52, 211, 153, .10);
  --max: 880px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fc;
    --card: #ffffff;
    --line: #dde3ee;
    --ink: #0b1020;
    --muted: #556079;
    --accent: #0369a1;
    --ok: #047857;
    --top: rgba(4, 120, 87, .08);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

header.top { border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 15px; }
nav a:hover { color: var(--ink); }

.page { padding-top: 36px; }

/* App block */
.app { display: flex; gap: 22px; align-items: center; }
.appicon {
  flex: 0 0 auto; width: 128px; height: 128px; border-radius: 22.37%;
  border: 1px solid var(--line); background: var(--card);
}
.appinfo { min-width: 0; }
.app h1 { font-size: clamp(22px, 5vw, 38px); line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.app p { margin: 0; color: var(--muted); }
.app .seller { color: var(--ink); font-weight: 600; }
.app .rating b { color: var(--ink); }

/* Screenshots: fixed boxes from width/height attributes, so nothing jumps while they load */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0 8px; }
.shots img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }

/* Rank table */
.ranks { margin-top: 36px; }
.ranks h2, .cta h2 { font-size: 22px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.01em; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
td.kw { overflow-wrap: anywhere; }
.rank { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.rank { font-weight: 700; }
.date { white-space: nowrap; color: var(--muted); text-align: right; }
tr.top10 td { background: var(--top); }
tr.top10 td.rank { color: var(--ok); }
tr.unranked td.rank { font-weight: 400; color: var(--muted); }
.depth { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.kwdate { display: none; }
.note { color: var(--muted); font-size: 15px; margin: 12px 0 0; }

/* Call to action */
.cta {
  margin: 44px 0 8px; padding: 28px 24px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.cta p { color: var(--muted); margin: 0 auto 18px; max-width: 520px; }
.store { display: inline-block; border-radius: 10px; }
.store:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.badge { display: block; width: 180px; height: 60px; }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 640px) {
  nav a { margin-left: 12px; font-size: 14px; }
  .page { padding-top: 24px; }
  .app { gap: 16px; }
  .appicon { width: 88px; height: 88px; }
  th, td { padding: 10px 10px; }
  th { font-size: 11px; letter-spacing: .04em; }
  th.depth { white-space: normal; }
  /* Four columns do not fit at 375 px: fold "Measured" under the keyword as small text. */
  th.date, td.date { display: none; }
  .kwdate { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
  th, td { padding: 10px 8px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 12px; }
  td.kw { font-size: 15px; line-height: 1.35; overflow-wrap: normal; }
  td.rank, td.depth { font-size: 15px; }
  tr.unranked td.rank { font-size: 13px; }
  th.rank, th.depth { width: 1%; }   /* shrink to content; the keyword column takes the rest */   /* "not in the top 250" stays on one line */
}
@media (max-width: 860px) {
  /* Same swipeable strip the home page uses on phones; the peeking image signals more. */
  .shots {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 22px -16px 8px; padding: 0 16px; scroll-padding-left: 16px; scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shots img { flex: 0 0 auto; width: 200px; scroll-snap-align: start; }
}

/* ---- SEO slice (docs/asoview-seo/SPEC.md B1-B5): breadcrumbs, hub, category chart sections, directories, pager ---- */
.crumbs { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li { display: inline; overflow-wrap: anywhere; }
.crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; margin: 0; font-size: inherit; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs li[aria-current] { color: var(--ink); }
.index h1 { font-size: clamp(22px, 5vw, 34px); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; }
.index h2, .charts h2, .neighbours h2 { font-size: 20px; line-height: 1.25; margin: 30px 0 10px; letter-spacing: -.01em; }
.pagemark { display: inline-block; margin: 4px 0 0; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; }
.note.when { margin: -4px 0 10px; font-size: 14px; }
ol.apps, ol.chartlist, ul.catlist { margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
ol.apps li, ol.chartlist li, ul.catlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
ol.apps li:last-child, ol.chartlist li:last-child, ul.catlist li:last-child { border-bottom: 0; }
ol.apps img { width: 40px; height: 40px; border-radius: 10px; }
ol.chartlist img { width: 32px; height: 32px; border-radius: 8px; }
ol.apps a, ol.chartlist a, ul.catlist a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
ol.apps .seller, ol.chartlist .seller { color: var(--muted); font-size: 14px; }
.best, .count { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { min-width: 42px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
ul.catlist { columns: 2; column-gap: 0; }
ul.catlist li { break-inside: avoid; }
.pager { margin: 18px 0 6px; font-size: 15px; color: var(--muted); }
.pager a { margin: 0; color: var(--accent); font-size: inherit; }
.pages { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 2; overflow-wrap: anywhere; }
.pages a, .pages span { display: inline-block; min-width: 32px; text-align: center; }
.pages span[aria-current] { color: var(--ink); font-weight: 700; }
.browse { margin: 22px 0 0; }
.neighbours ol { margin: 0; padding-left: 20px; }
.neighbours li { margin: 4px 0; }
.charts td.days { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.charts .sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
@media (max-width: 640px) {
  ul.catlist { columns: 1; }
  ol.apps li, ol.chartlist li, ul.catlist li { padding: 10px 12px; }
  .best { margin-left: 0; width: 100%; }
  .charts th.days, .charts td.days { white-space: normal; }
}
