/* app-page.css — the four app detail pages (Olamim, Shuffle Date, I'm Home, Shalema).
   Each page is themed from its own app's screens: colors, type and the shape
   behind the phones come from the app, so the four pages don't look alike. */

/* ── Themes ─────────────────────────────────────────────────────────────── */
.ap-olamim {
  --ap-screen: #0f0c1c;            /* night indigo, crimson "connect" button, peach accents */
  --ap-bg: #120d24;
  --ap-bg-2: #1b1533;
  --ap-ink: #f6f0fb;
  --ap-muted: #b9add0;
  --ap-accent: #e3345c;
  --ap-accent-2: #ffa86e;
  --ap-line: rgba(255, 255, 255, .12);
  --ap-display: 'Rubik', system-ui, sans-serif;
  --ap-display-weight: 700;
  --ap-body: 'Rubik', system-ui, sans-serif;
  --ap-frame: #2a2346;
}
.ap-shuffle {
  --ap-screen: #000;           /* true black, iOS grey surfaces, coral spin button */
  --ap-bg: #000;
  --ap-bg-2: #1c1c1e;
  --ap-ink: #fff;
  --ap-muted: #a1a1a6;
  --ap-accent: #ff6b6b;
  --ap-accent-2: #ff9b8a;
  --ap-line: rgba(255, 255, 255, .14);
  --ap-display: 'Rubik', system-ui, sans-serif;
  --ap-display-weight: 800;
  --ap-body: 'Rubik', system-ui, sans-serif;
  --ap-frame: #2c2c2e;
}
.ap-imhome {
  --ap-screen: #d5a66b;            /* warm ochre screen, espresso button, yellow house */
  --ap-bg: #d8a96b;
  --ap-bg-2: #fdf6e6;
  --ap-ink: #33230f;
  --ap-muted: #5e4527;
  --ap-accent: #5b4220;
  --ap-accent-2: #ffb400;
  --ap-line: rgba(51, 35, 15, .18);
  --ap-display: 'Varela Round', 'Rubik', system-ui, sans-serif;
  --ap-display-weight: 400;
  --ap-body: 'Rubik', system-ui, sans-serif;
  --ap-frame: #3b2a14;
}
.ap-shalema {
  --ap-screen: #f6f0e8;           /* soft linen, pearl spheres in blush, sand and sage */
  --ap-bg: #f5efe7;
  --ap-bg-2: #fbf8f3;
  --ap-ink: #2b2522;
  --ap-muted: #6f625a;
  --ap-accent: #b9786a;
  --ap-accent-2: #cfd6c3;
  --ap-line: rgba(43, 37, 34, .14);
  --ap-display: 'Bellefair', 'Frank Ruhl Libre', Georgia, serif;
  --ap-display-weight: 400;
  --ap-body: 'Assistant', 'Rubik', system-ui, sans-serif;
  --ap-frame: #e7ddd2;
}

/* ── Page base ──────────────────────────────────────────────────────────── */
body.ap { background: var(--ap-bg); color: var(--ap-ink); font-family: var(--ap-body); }
.ap main { background: var(--ap-bg); color: var(--ap-ink); }
.ap main h1, .ap main h2, .ap main h3 {
  font-family: var(--ap-display); font-weight: var(--ap-display-weight);
  color: var(--ap-ink); letter-spacing: -0.01em; margin: 0;
}
.ap main p { margin: 0; }
/* Translations sometimes colour one word of the headline; the page doesn't. */
.ap main h1 span, .ap main h2 span { color: inherit !important; }
.ap-wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

.ap-shot { display: block; width: 100%; height: auto; }
.ap-shot-he { display: none; }
html[lang="he"] .ap-shot-en { display: none; }
html[lang="he"] .ap-shot-he { display: block; }

.ap-phone {
  margin: 0; overflow: hidden; aspect-ratio: 9 / 19.5;
  border-radius: 34px; border: 7px solid var(--ap-frame);
  background: var(--ap-screen, var(--ap-frame));
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45);
}

.ap-note { font-size: .9rem; color: var(--ap-muted); }
.ap main .store-cta { margin-top: 1.75rem; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.ap-hero { padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem); overflow: hidden; }
/* The site header takes each app's darkest colour. */
.ap-shuffle .header { background: rgba(0, 0, 0, .86); }
.ap-imhome .header { background: rgba(59, 42, 20, .94); }
.ap-shalema .header { background: rgba(43, 37, 34, .92); }
.ap-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.ap-back { display: inline-block; font-size: .9rem; color: var(--ap-muted); text-decoration: none; margin-bottom: 1.75rem; }
.ap-back:hover { color: var(--ap-ink); }
.ap-id { display: flex; align-items: center; gap: .75rem; font-weight: 600; font-size: 1.05rem; margin-bottom: 1.25rem !important; }
.ap-id img { border-radius: 11px; }
.ap-hero h1 { font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.1rem); line-height: 1.04; max-width: 15ch; }
.ap-lede { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); line-height: 1.6; color: var(--ap-muted); max-width: 46ch; margin-top: 1.25rem !important; }
.ap-hero .ap-note { margin-top: .75rem; }

.ap-phones { position: relative; height: clamp(440px, 52vw, 600px); }
.ap-phones .ap-phone { position: absolute; top: 50%; width: clamp(190px, 21vw, 262px); }
.ap-phone-front { inset-inline-start: 12%; transform: translateY(-50%) rotate(-6deg); z-index: 2; }
.ap-phone-back  { inset-inline-start: 46%; transform: translateY(-46%) rotate(8deg) scale(.92); z-index: 1; filter: saturate(.9) brightness(.92); }
html[dir="rtl"] .ap-phone-front { transform: translateY(-50%) rotate(6deg); }
html[dir="rtl"] .ap-phone-back  { transform: translateY(-46%) rotate(-8deg) scale(.92); }

.ap-orb { position: absolute; border-radius: 50%; pointer-events: none; display: none; }

/* Olamim: the glow of the app's crimson connect button. */
.ap-olamim .ap-orb-1 {
  display: block; width: 78%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(227, 52, 92, .55) 0%, rgba(227, 52, 92, .18) 45%, transparent 70%);
}
/* Shuffle Date: the coral spin button, with its ring. */
.ap-shuffle .ap-orb-1 {
  display: block; width: 96%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 45%, #ff7a76 0%, #e5534f 62%, #b8322f 100%);
  box-shadow: 0 0 0 18px rgba(255, 107, 107, .14), 0 0 0 36px rgba(255, 107, 107, .06);
}
/* I'm Home: the yellow house circle from the profile screen. */
.ap-imhome .ap-orb-1 {
  display: block; width: 84%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #ffb400;
}
.ap-imhome .ap-orb-2 {
  display: block; width: 104%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border: 3px dashed rgba(51, 35, 15, .35); background: none;
}
/* Shalema: the pearl spheres from the path screen. */
.ap-shalema .ap-orb { display: block; aspect-ratio: 1; box-shadow: inset -6px -10px 18px rgba(0, 0, 0, .06); }
.ap-shalema .ap-orb-1 { width: 34%; top: 4%;  inset-inline-end: 4%;  background: radial-gradient(circle at 35% 30%, #fbf1ee, #e5c4bb 70%, #d9aea2); }
.ap-shalema .ap-orb-2 { width: 26%; bottom: 6%; inset-inline-start: 0; background: radial-gradient(circle at 35% 30%, #f6f6ef, #d5dbc9 70%, #c2cab3); }
.ap-shalema .ap-orb-3 { width: 18%; bottom: 22%; inset-inline-end: 0;  background: radial-gradient(circle at 35% 30%, #fbf4e4, #ead7aa 70%, #dcc38a); }
.ap-shalema .ap-phone { box-shadow: 0 30px 60px -24px rgba(90, 60, 40, .35); }

/* One entrance: the two phones settle into place. */
@media (prefers-reduced-motion: no-preference) {
  .ap-phones .ap-phone { animation: ap-settle .9s cubic-bezier(.2, .8, .2, 1) both; }
  .ap-phones .ap-phone-back { animation-delay: .12s; }
  @keyframes ap-settle { from { opacity: 0; translate: 0 40px; rotate: 0deg; } }
}

/* ── Problem / how it goes ──────────────────────────────────────────────── */
.ap-sec { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.ap-problem { background: var(--ap-bg-2); }
.ap-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.ap-split-head h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); line-height: 1.1; }
.ap-split-head p { margin-top: 1.1rem !important; font-size: 1.08rem; line-height: 1.7; color: var(--ap-muted); max-width: 44ch; }
.ap-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.ap-list li { padding: 1.5rem 0; border-top: 1px solid var(--ap-line); }
.ap-list li:last-child { border-bottom: 1px solid var(--ap-line); }
.ap-list h3 { font-size: 1.3rem; line-height: 1.3; }
.ap-list p { margin-top: .45rem !important; line-height: 1.65; color: var(--ap-muted); max-width: 58ch; }
/* Only real sequences (Shuffle Date's spin, I'm Home's ritual) get step numbers. */
.ap-list.is-steps li { display: grid; grid-template-columns: 2.6rem 1fr; column-gap: .5rem; counter-increment: step; }
.ap-list.is-steps li::before {
  content: counter(step); grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: .95rem;
  background: var(--ap-accent); color: var(--ap-bg-2);
}
.ap-shuffle .ap-list.is-steps li::before { color: #000; }

/* The light themes put the problem on the page colour and the features on white. */
.ap-imhome .ap-problem, .ap-shalema .ap-problem { background: var(--ap-bg); }
.ap-imhome .ap-features, .ap-shalema .ap-features { background: var(--ap-bg-2); }

/* ── Features with the phone held beside them ───────────────────────────── */
.ap-title { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); line-height: 1.1; max-width: 20ch; }
.ap-feat-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: clamp(2rem, 7vw, 6rem); margin-top: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.ap-feat-phone { position: sticky; top: 6.5rem; }
.ap-feat { padding: 0 0 2.5rem; }
.ap-feat + .ap-feat { padding-top: 2.5rem; border-top: 1px solid var(--ap-line); }
.ap-feat h3 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem); line-height: 1.2; }
.ap-feat p { margin-top: .85rem !important; font-size: 1.05rem; line-height: 1.72; color: var(--ap-muted); max-width: 60ch; }
.ap-feat p strong { color: var(--ap-ink); font-weight: 600; }

/* ── Mid-page download band ─────────────────────────────────────────────── */
.ap-band { background: var(--ap-accent); color: #fff; padding: clamp(2.5rem, 5vw, 3.5rem) 0; }
.ap-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.ap-band h2 { color: #fff !important; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); line-height: 1.15; }
.ap-band p { margin-top: .5rem !important; color: rgba(255, 255, 255, .86); max-width: 52ch; line-height: 1.6; }
.ap-band .store-cta { margin-top: 0 !important; }
.ap-imhome .ap-band { background: var(--ap-accent); }
.ap-shalema .ap-band { background: #8f6f63; }
.ap-shuffle .ap-band p { color: rgba(0, 0, 0, .75); }
.ap-shuffle .ap-band h2 { color: #000 !important; }

/* ── "Also in the app" ──────────────────────────────────────────────────── */
.ap-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 6vw, 5rem); margin: clamp(2rem, 5vw, 3rem) 0 0; }
.ap-dl-row { padding: 1.25rem 0; border-top: 1px solid var(--ap-line); }
.ap-dl dt { font-family: var(--ap-display); font-weight: var(--ap-display-weight); font-size: 1.15rem; }
.ap-dl dd { margin: .4rem 0 0; line-height: 1.65; color: var(--ap-muted); }

/* ── Why it works ───────────────────────────────────────────────────────── */
.ap-why { background: var(--ap-bg-2); }
.ap-more + .ap-why { background: var(--ap-bg-2); }
.ap-imhome .ap-why { background: var(--ap-bg); }
.ap-why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.75rem, 4vw, 3rem) clamp(2rem, 6vw, 5rem); margin-top: clamp(2rem, 5vw, 3rem); }
.ap-why-item { border-inline-start: 3px solid var(--ap-accent); padding-inline-start: 1.25rem; }
.ap-why-item h3 { font-size: 1.25rem; line-height: 1.3; }
.ap-why-item p { margin-top: .5rem !important; line-height: 1.68; color: var(--ap-muted); }

/* ── Closing ────────────────────────────────────────────────────────────── */
.ap-close { padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(6rem, 10vw, 8rem); text-align: center; }
.ap-close-inner { display: flex; flex-direction: column; align-items: center; }
.ap-close-icon { border-radius: 22px; margin-bottom: 1.75rem; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); }
.ap-close h2 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.3rem); line-height: 1.08; max-width: 18ch; }
.ap-close .ap-lede { margin-inline: auto; text-align: center; }
.ap-close .ap-note { margin-top: 1.25rem; max-width: 52ch; line-height: 1.6; }

/* Store buttons pick up each app's colours. */
.ap main .store-cta-btn { background: var(--ap-accent); color: #fff; border-color: transparent; }
.ap main .store-cta-btn.is-light { background: var(--ap-ink); color: var(--ap-bg); }
.ap-shuffle main .store-cta-btn { color: #000; }
.ap-band .store-cta-btn, .ap-band .store-cta-btn.is-light { background: #fff !important; color: #1a1a1a !important; }
.ap main .store-cta-btn svg { fill: currentColor; }

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .ap-hero-grid, .ap-split, .ap-feat-grid { grid-template-columns: 1fr; }
  .ap-hero h1 { max-width: 16ch; }
  .ap-phones { height: 430px; max-width: 460px; margin-inline: auto; width: 100%; }
  .ap-phones .ap-phone { width: min(180px, 44vw); }
  .ap-phone-front { inset-inline-start: 6%; }
  .ap-phone-back { inset-inline-start: auto; inset-inline-end: 6%; }
  /* Keep the shape behind the phones inside the section on tablets. */
  .ap-phones .ap-orb-1, .ap-imhome .ap-orb-2 { max-width: 400px; }
  .ap-feat-phone { position: static; width: min(240px, 70%); margin-inline: auto; }
  .ap-dl, .ap-why-grid { grid-template-columns: 1fr; }
  .ap-band-inner { flex-direction: column; align-items: flex-start; }
}

/* Hebrew video reel (shown only in Hebrew) takes the page's own colours. */
.ap .he-video { background: var(--ap-bg-2); }
.ap .he-video h2 { color: var(--ap-ink); font-family: var(--ap-display); font-weight: var(--ap-display-weight); }
.ap .he-video p { color: var(--ap-muted); }

/* ── Features: the phone shows the screen for the feature being read ─────── */
.ap-stage { position: relative; }
.ap-stage .ap-stage-shot { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity .45s ease; }
.ap-stage .ap-stage-shot.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ap-stage .ap-stage-shot { transition: none; } }
.ap-feat-inline { display: none; }

/* ── Store screenshots gallery ──────────────────────────────────────────── */
.ap-gallery { padding-bottom: clamp(3.5rem, 7vw, 5rem); overflow: hidden; background: var(--ap-bg-2); }
.ap-gal-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.ap-gal-nav { display: flex; gap: .5rem; flex: none; }
.ap-gal-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--ap-bg); color: var(--ap-ink); border: 1px solid var(--ap-line);
  transition: background-color .2s, color .2s, opacity .2s;
}
.ap-gal-btn:hover { background: var(--ap-accent); color: #fff; border-color: transparent; }
.ap-shuffle .ap-gal-btn:hover { color: #000; }
.ap-gal-btn[disabled] { opacity: .35; cursor: default; background: var(--ap-bg); color: var(--ap-ink); }
.ap-gal-btn:focus-visible, .ap-gal-track:focus-visible { outline: 2px solid var(--ap-accent); outline-offset: 3px; }
html[dir="rtl"] .ap-gal-btn svg { transform: scaleX(-1); }
.ap-gal { margin-top: clamp(1.75rem, 3.5vw, 2.5rem); }
.ap-gal-track {
  --edge: max(1.25rem, (100% - 1120px) / 2);
  list-style: none; margin: 0; padding: .5rem var(--edge) 2.25rem;
  display: flex; align-items: flex-start; gap: clamp(1rem, 2vw, 1.75rem);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.ap-gal-track::-webkit-scrollbar { display: none; }
.ap-gal-track li { flex: none; width: clamp(220px, 21vw, 280px); scroll-snap-align: start; }
/* Every other card sits a little lower, like prints laid out on a table. */
.ap-gal-track li:nth-child(even) { margin-top: 1.75rem; }
.ap-gal-track img {
  display: block; width: 100%; height: auto; border-radius: 22px;
  box-shadow: 0 0 0 1px var(--ap-line), 0 22px 40px -22px rgba(0, 0, 0, .6);
}
.ap-gal-he { display: none !important; }
html[lang="he"] .ap-gal-en { display: none !important; }
html[lang="he"] .ap-gal-he { display: flex !important; }
.ap-gal-progress { height: 3px; border-radius: 3px; background: var(--ap-line); overflow: hidden; }
.ap-gal-progress span { display: block; height: 100%; width: 20%; border-radius: inherit; background: var(--ap-accent); }

@media (max-width: 860px) {
  .ap-feat-phone { display: none; }
  .ap-feat-inline { display: block; width: min(220px, 62%); margin: 0 auto 1.75rem; }
  .ap-feat + .ap-feat { padding-top: 2.75rem; }
  .ap-gal-nav { display: none; }
  .ap-gal-track li { width: 64vw; max-width: 270px; }
  .ap-gal-track li:nth-child(even) { margin-top: 1.25rem; }
}
