/* App-store inspired install page — shared shell.
 * Per-app pages override --primary / --hero-grad-* CSS variables to retheme. */

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-elev: #1e293b;
  --bg-card: #182238;
  --border: rgba(255, 255, 255, 0.06);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #22c55e;
  --primary-press: #16a34a;
  --primary-on: #052a12;
  --accent: #f59e0b;
  --star: #fbbf24;
  --hero-grad-a: #7c3aed;
  --hero-grad-b: #ec4899;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 18px 120px;
}

/* hero */
.hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 18px;
}
.hero .icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--hero-grad-a), var(--hero-grad-b));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  font-size: 48px;
  flex-shrink: 0;
  overflow: hidden;
}
.hero .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero .meta {
  flex: 1;
  min-width: 0;
}
.hero .name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0;
}
.hero .tagline {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 12px;
}
.hero .developer {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
.hero .developer a {
  color: var(--primary);
  text-decoration: none;
}

/* CTAs */
.cta-row {
  display: flex;
  gap: 10px;
  margin: 14px 0 6px;
  align-items: center;
}
.install-btn {
  padding: 9px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-on);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
  min-width: 80px;
}
.install-btn:active {
  transform: scale(0.97);
  background: var(--primary-press);
}
.install-btn[data-state="installed"] {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: none;
}
.share-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
}

/* sticky pill (mobile) */
.sticky-pill {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(140%);
  transition: transform 0.22s ease;
  z-index: 50;
}
.sticky-pill.show {
  transform: translateX(-50%) translateY(0);
}
.sticky-pill .install-btn {
  padding: 13px 28px;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.45);
}

/* quick stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 14px 0;
}
.stats .stat {
  text-align: center;
  padding: 0 6px;
  border-right: 1px solid var(--border);
}
.stats .stat:last-child {
  border-right: 0;
}
.stats .stat .v {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.stats .stat .l {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.stats .stat .star {
  color: var(--star);
}

/* screenshots */
.shots {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 70%;
  gap: 10px;
  padding: 4px 18px 14px;
  margin: 0 -18px;
  scrollbar-width: none;
}
.shots::-webkit-scrollbar {
  display: none;
}
.shots .shot {
  aspect-ratio: 9/16;
  border-radius: 14px;
  scroll-snap-align: start;
  background: var(--bg-card);
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.shots .shot .shot-emoji {
  font-size: 60px;
  margin-bottom: 8px;
}
.shots .shot .shot-caption {
  font-weight: 600;
}
.shots .shot .shot-sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

/* sections */
.section {
  margin: 22px 0;
}
.section h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

/* about */
.about .body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  max-height: 5.5em;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}
.about .body.open {
  max-height: 1200px;
}
.about .body:not(.open)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.about .toggle {
  color: var(--primary);
  background: 0;
  border: 0;
  padding: 6px 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

/* chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips .chip {
  background: var(--bg-elev);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}
.chips .chip::before {
  content: "✓ ";
  color: var(--primary);
  margin-right: 2px;
}

/* what's new */
.whatsnew {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.whatsnew .version {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.whatsnew ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
}

/* developer card */
.dev {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
}
.dev .badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bg-elev), #334155);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.dev .who {
  font-weight: 700;
}
.dev .links {
  color: var(--muted);
  font-size: 13px;
}
.dev .links a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 10px;
}
.dev .links a:hover {
  color: var(--text);
}

/* guidance */
.guidance {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  display: none;
  margin-top: 10px;
}
.guidance.show {
  display: block;
}
.guidance .head {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent);
}
.guidance .dismiss {
  color: var(--muted);
  background: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  margin-top: 8px;
}

#debug {
  color: var(--muted);
  font-size: 11px;
  margin-top: 10px;
  min-height: 14px;
}
