/* ============================================================
   Random Apps — app info page
   Shared styling for the per-app marketing pages. Clean, Apple-style,
   consistent with the homepage (Inter, scarlet accent, light + airy).
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --accent: #e0392b;
  --accent-press: #b92c20;
  --hairline: rgba(0, 0, 0, 0.10);
  --hairline-soft: rgba(0, 0, 0, 0.06);
  --radius: 22px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.10);
  --maxw: 1040px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 17px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
::selection { background: rgba(224, 57, 43, 0.16); }
a { color: inherit; text-decoration: none; }
svg { display: block; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 16px; font-weight: 500;
  border-radius: 980px; cursor: pointer; border: 1px solid transparent;
  padding: 13px 26px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.btn span { transition: transform 0.25s var(--ease); }
.btn-apple { height: 1.15em; width: auto; display: block; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 16px rgba(224, 57, 43, 0.25); }
.btn-primary:hover { background: var(--accent-press); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(224, 57, 43, 0.32); }
.btn-primary:hover span { transform: translateX(3px); }
.btn-ghost { color: var(--ink); border-color: var(--hairline); background: var(--bg); }
.btn-ghost:hover { border-color: var(--ink-faint); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
/* "Coming soon" pill: reads as status, not an active CTA — muted, no hover, not clickable */
.btn-soon { background: var(--bg-soft); color: var(--ink-soft); border-color: var(--hairline); box-shadow: none; cursor: default; }

/* ============================================================
   NAV
   ============================================================ */
.app-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline-soft);
}
.app-nav-inner {
  position: relative;
  max-width: var(--maxw); margin: 0 auto; height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 500; color: var(--ink-soft); transition: color 0.2s; }
.back-link:hover { color: var(--accent); }
.back-link span { transition: transform 0.25s var(--ease); }
.back-link:hover span { transform: translateX(-3px); }
.app-nav-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.app-nav-brand .mark {
  width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(224, 57, 43, 0.3);
  view-transition-name: brand-mark;
}
.app-nav-brand .mark svg { width: 14px; height: 14px; }

/* home icon (replaces the "All apps" link on app pages) */
.nav-home {
  display: inline-flex; align-items: center; color: var(--ink-soft);
  padding: 11px; margin: -11px; /* ~44px tap target without shifting the icon */
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-home:hover { color: var(--accent); transform: translateY(-1px); }
.nav-home svg { width: 22px; height: 22px; }

/* centered app switcher: small icons of the other apps */
.nav-apps {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 0;
}
.nav-app { display: inline-flex; opacity: 0.85; padding: 7px; transition: transform 0.25s var(--ease), opacity 0.2s; }
.nav-app:hover { opacity: 1; transform: translateY(-2px) scale(1.07); }
.nav-app img { width: 30px; height: 30px; border-radius: 23%; display: block; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16); }

@media (max-width: 600px) { .app-nav-brand .brand-text { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.app-hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(56px, 10vh, 96px) 24px clamp(40px, 6vh, 64px);
  text-align: center;
}
.app-hero-icon {
  width: 128px; height: auto; margin: 0 auto 26px;
  border-radius: 22.37%;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}
.app-hero h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -0.035em; margin-bottom: 14px; }
.app-tagline { font-size: clamp(19px, 2.4vw, 26px); color: var(--ink-soft); font-weight: 400; max-width: 620px; margin: 0 auto 22px; line-height: 1.35; }
.app-platforms { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 30px; }
.platform {
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  background: var(--bg-soft); border: 1px solid var(--hairline-soft);
  padding: 6px 14px; border-radius: 980px;
}
.app-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   SECTIONS
   ============================================================ */
.app-section { max-width: var(--maxw); margin: 0 auto; padding: clamp(48px, 8vh, 88px) 24px; }
.app-section.tight { padding-top: 0; }
.app-section h2 { font-size: clamp(26px, 3.4vw, 38px); text-align: center; margin-bottom: 16px; }
.section-intro { text-align: center; max-width: 660px; margin: 0 auto clamp(36px, 5vh, 56px); color: var(--ink-soft); font-size: clamp(17px, 1.8vw, 20px); font-weight: 400; }

.lead {
  max-width: 760px; margin: 0 auto; text-align: center;
  font-size: clamp(20px, 2.6vw, 28px); line-height: 1.45; font-weight: 400; letter-spacing: -0.02em;
}
.lead strong { font-weight: 600; color: var(--ink); }

/* ---------- feature grid ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.feature {
  background: var(--bg-soft); border: 1px solid var(--hairline-soft);
  border-radius: var(--radius); padding: 28px 26px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-ico {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px;
  background: #fff; color: var(--accent); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--hairline-soft);
}
.feature-ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.02em; }
.feature p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; font-weight: 400; }

/* ---------- highlight band ---------- */
.highlight {
  background: var(--bg-soft); border-top: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft);
}
.highlight .app-section { text-align: center; }

/* ---------- screenshots: portrait (phone) ---------- */
.shots { display: flex; gap: clamp(16px, 3vw, 30px); justify-content: center; flex-wrap: wrap; max-width: 600px; margin: 0 auto; }
.shots img {
  width: clamp(200px, 26vw, 270px); height: auto; border-radius: 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); border: 1px solid var(--hairline-soft);
}

/* ---------- screenshots: wide (desktop window) ---------- */
.shots-wide { display: flex; flex-direction: column; gap: clamp(34px, 6vh, 64px); max-width: 940px; margin: 0 auto; }
.shot-wide { margin: 0; }
.shot-wide img {
  width: 100%; height: auto; display: block; border-radius: 14px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.20); border: 1px solid var(--hairline-soft);
}
.shot-wide figcaption { text-align: center; margin-top: 16px; color: var(--ink-soft); font-size: 15px; font-weight: 400; }

/* ---------- chips (libraries etc.) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 760px; margin: 0 auto; }
.chip {
  font-size: 14px; font-weight: 500; color: var(--ink); background: var(--bg);
  border: 1px solid var(--hairline); padding: 8px 16px; border-radius: 980px;
}

/* ---------- CTA ---------- */
.app-cta { text-align: center; }
.app-cta-inner {
  max-width: 720px; margin: 0 auto;
  background: linear-gradient(160deg, #fff, var(--bg-soft));
  border: 1px solid var(--hairline-soft); border-radius: 32px;
  padding: clamp(44px, 7vw, 72px) 32px; box-shadow: var(--shadow-sm);
}
.app-cta-inner h2 { font-size: clamp(26px, 3.6vw, 40px); margin-bottom: 14px; }
.app-cta-inner p { color: var(--ink-soft); margin-bottom: 28px; font-size: 18px; font-weight: 400; }

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer { border-top: 1px solid var(--hairline-soft); background: var(--bg-soft); }
.app-footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.app-footer p { font-size: 13px; color: var(--ink-soft); }
.app-footer a { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.app-footer a:hover { color: var(--accent); }
.app-footer-links { display: flex; gap: 22px; }

/* ============================================================
   LEGAL / PROSE (privacy policy, terms, etc.)
   ============================================================ */
.legal { max-width: 740px; margin: 0 auto; padding: clamp(48px, 8vh, 80px) 24px clamp(64px, 10vh, 96px); }
.legal-header { border-bottom: 1px solid var(--hairline-soft); padding-bottom: 28px; margin-bottom: 36px; }
.legal-badge {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.legal h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -0.03em; margin-bottom: 10px; }
.legal-eff { color: var(--ink-soft); font-size: 15px; }
.legal h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 46px 0 14px; }
.legal p { margin: 0 0 16px; font-size: 17px; line-height: 1.65; font-weight: 400; }
.legal ul { margin: 0 0 18px; padding-left: 22px; }
.legal li { margin: 0 0 9px; line-height: 1.6; font-weight: 400; }
.legal a { color: var(--accent); font-weight: 500; }
.legal a:hover { text-decoration: underline; }
.legal strong { font-weight: 600; }
.legal-tldr {
  background: var(--bg-soft); border: 1px solid var(--hairline-soft);
  border-radius: var(--radius); padding: 24px 26px; margin: 0 0 8px;
}
.legal-tldr ul { margin-bottom: 0; }
.legal-tldr li:last-child { margin-bottom: 0; }
.legal-foot {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--hairline-soft);
  color: var(--ink-soft); font-size: 15px; font-style: italic;
}
.legal-contact { font-style: normal; }
.legal-tldr p { margin-bottom: 0; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em; background: var(--bg-soft);
  border: 1px solid var(--hairline-soft); border-radius: 6px; padding: 1px 6px;
}

/* ---------- reveal ---------- */
/* Entrance fade intentionally disabled: it played a second fade on top of the
   view transition and caused a flash on settle. Content is shown immediately. */
.reveal { opacity: 1; }
/* Sleek scroll reveals: script.js tags below-fold .reveal elements with .will-reveal
   (hidden), then .is-in once they scroll into view. On-screen content stays visible. */
.reveal.will-reveal { opacity: 0; transform: translateY(26px); }
.reveal.will-reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--rd, 0s);
}
/* pics rise a touch further with a gentle scale */
.shots img.reveal.will-reveal, .shot-wide.reveal.will-reveal { transform: translateY(34px) scale(0.965); }
.shots img.reveal.will-reveal.is-in, .shot-wide.reveal.will-reveal.is-in { transform: none; }
/* cascade the grids */
.features .feature:nth-child(2), .shots img:nth-child(2) { --rd: 0.06s; }
.features .feature:nth-child(3), .shots img:nth-child(3) { --rd: 0.12s; }
.features .feature:nth-child(4), .shots img:nth-child(4) { --rd: 0.18s; }
.features .feature:nth-child(5) { --rd: 0.24s; }
.features .feature:nth-child(6) { --rd: 0.30s; }

/* ---------- cross-page shared-element transition (icons fly to their new spots) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(*) {
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
/* the leaving page recedes (slight scale + fade) as the new one rises in */
@keyframes page-recede { to { opacity: 0; transform: scale(0.965); } }
::view-transition-old(root) { animation: page-recede 0.55s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* page-open: the page lifts + fades while the hero content cascades in. Each hero element
   has its own view-transition-name, so the stagger runs entirely inside the view transition
   (nothing animates on the live DOM afterward — that's what keeps it flicker-free). */
@keyframes page-in { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
::view-transition-new(root) { animation: page-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }

.app-hero h1             { view-transition-name: hero-title; }
.app-hero .app-tagline   { view-transition-name: hero-tagline; }
.app-hero .app-platforms { view-transition-name: hero-platforms; }
.app-hero .app-actions   { view-transition-name: hero-actions; }

@keyframes hero-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
::view-transition-new(hero-title)     { animation: hero-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
::view-transition-new(hero-tagline)   { animation: hero-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both; }
::view-transition-new(hero-platforms) { animation: hero-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both; }
::view-transition-new(hero-actions)   { animation: hero-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both; }

/* keep the flying app icon stacked above the hero text, so the cascading text rises behind
   the logo instead of passing over it */
::view-transition-group(app-mcm),
::view-transition-group(app-pt),
::view-transition-group(app-lumen),
::view-transition-group(app-1500),
::view-transition-group(app-receipts) { z-index: 20; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
