/* a62 app kit — the a62 Design page's scroll scenes and glass, for the apps'
   own sites (mara.a62.store, cobloc.a62.store). Owner, 10 Oct 2026.

   THE SOURCE IS a62 Store/a62-store/assets/app-kit/. Each site carries a copy
   in its /kit/ folder (Mara-App/site/kit, Cobloc apps/cobloc_site/kit):
   edit here, then run `node a62-store/assets/app-kit/copy.js`.

   Borrowed from a62-store/assets/site.css: the topo ground, the floating
   rail, tinted glass with a sheen, chapters in big type with a drifting
   collage, the "swap" scene held on screen while the page moves, and the
   rise into place. Each page sets its own colours and fonts:
     --ground --ground-2 --rail --rail-solid --topo --accent --on-accent --text
     --muted --head --sans, and --btn --on-btn when buttons differ from --accent */

:root {
  --edge: 16px; --r: 16px; --r-lg: 24px; --gap: 8px;
  --pad: clamp(20px, 5vw, 72px);
  --shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 22px 44px -26px rgba(0, 0, 0, .65);
  --ease: cubic-bezier(.3, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--ground); scroll-behavior: smooth; scroll-padding-top: 84px; }
body::before { /* the a62 topographic lines, in the app's colour, fixed behind everything */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--topo);
  -webkit-mask: url("topo.svg") center / cover no-repeat; mask: url("topo.svg") center / cover no-repeat;
}
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: transparent; color: var(--text);
  font: 400 17px/1.55 var(--sans); padding-inline: var(--edge); padding-bottom: var(--edge);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3, p, ol, figure { margin: 0; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; letter-spacing: -.015em; text-wrap: balance; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .m-quote { letter-spacing: 0; text-transform: none; }
a { color: inherit; }
img { max-width: 100%; display: block; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Line icons from Lucide, brand marks from Simple Icons (icons/LICENSE.txt), painted in currentColor. */
.ic { display: inline-block; flex: none; width: 1.15em; height: 1.15em; background: currentColor;
      -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.i-android { --i: url("icons/android.svg"); } .i-apple { --i: url("icons/apple.svg"); }
.i-play { --i: url("icons/googleplay.svg"); } .i-down { --i: url("icons/download.svg"); }
.i-zap { --i: url("icons/zap.svg"); } .i-users { --i: url("icons/users.svg"); }
.i-bell { --i: url("icons/bell.svg"); } .i-offline { --i: url("icons/wifi-off.svg"); }
.i-receipt { --i: url("icons/receipt.svg"); } .i-book { --i: url("icons/book-open.svg"); }
.i-grid { --i: url("icons/layout-grid.svg"); } .i-wrench { --i: url("icons/wrench.svg"); }
.i-megaphone { --i: url("icons/megaphone.svg"); } .i-cash { --i: url("icons/banknote.svg"); }
.i-ruler { --i: url("icons/ruler.svg"); } .i-hand { --i: url("icons/hand.svg"); }

/* ---------- rail ---------- */
.rail {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 10;
  margin: calc(env(safe-area-inset-top, 0px) + 12px) auto 0; max-width: 1240px;
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 10px 0 16px; border-radius: var(--r);
  background: var(--rail); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
.rail .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 22px/1 var(--head); letter-spacing: -.02em; }
.rail .brand img { height: 32px; width: auto; }
.rail .get-sm { margin-inline-start: auto; padding: 10px 16px; font-size: 14px; }
.rail .get-sm.off { display: none; }
.langs { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.rail .get-sm.off + .langs { margin-inline-start: auto; }
.langs button { font: 600 13px/1 var(--sans); padding: 9px 11px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--btn, var(--accent)); color: var(--on-btn, var(--on-accent)); }
@media (max-width: 640px) { .rail { height: 54px; padding-inline: 12px 6px; } .rail .get-sm { display: none; } .langs { margin-inline-start: auto; } }

/* ---------- glass ---------- */
.glass {
  --tint: color-mix(in srgb, var(--ground-2) 55%, transparent);
  background: linear-gradient(140deg, rgba(255, 255, 255, .12), transparent 38%), var(--tint);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .2), var(--shadow);
  border-radius: var(--r-lg);
}
/* Phones and touch screens: no blur (too slow while scrolling); a thicker tint keeps the lines quiet. */
@media (hover: none), (max-width: 640px) {
  .glass { --tint: color-mix(in srgb, var(--ground-2) 86%, transparent); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .rail { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--rail-solid, var(--rail)); }
}
@supports not (color: color-mix(in srgb, red, red)) { .glass { background: var(--ground-2); } }

/* ---------- buttons ---------- */
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 16px 24px; border-radius: 999px; border: 0;
        background: var(--btn, var(--accent)); color: var(--on-btn, var(--on-accent)); font: 700 17px/1 var(--sans); text-decoration: none; cursor: pointer; }
.pill .ic { font-size: 20px; }
.pill.off { background: rgba(255, 255, 255, .1); color: var(--muted); pointer-events: none; }
.meta { font-size: 14px; color: var(--muted); }
.meta[hidden] { display: none; }
.stores { display: flex; flex-wrap: wrap; gap: var(--gap); }
.store { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 14px; border-radius: var(--r); }
.store .ic { font-size: 24px; color: var(--text); }
.store small { display: block; font: 600 11px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .store small { letter-spacing: 0; }
.store b { display: block; font: 700 16px/1.2 var(--head); direction: ltr; unicode-bidi: isolate; }

/* ---------- chapters (the Design page's Highlights) ---------- */
main { max-width: 1240px; margin-inline: auto; display: flex; flex-direction: column; }
.ch { position: relative; padding-top: clamp(56px, 12vh, 140px); }
.ch::before { /* a glow in the app's colour */
  content: ""; position: absolute; inset: 0 calc(-1 * var(--edge)); z-index: -1; pointer-events: none;
  background: radial-gradient(60% 40% at 20% 12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
[dir="rtl"] .ch::before { background: radial-gradient(60% 40% at 80% 12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.ch-open { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 72px); padding-inline: var(--pad); align-items: start; }
.ch-txt { position: sticky; top: 18vh; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding-bottom: 40px; }
.ch-n { font: 600 14px/1 var(--sans); letter-spacing: .1em; color: var(--accent); text-transform: uppercase; }
.ch .big { font-size: clamp(40px, 5.4vw, 84px); line-height: .92; letter-spacing: -.035em; text-transform: uppercase; }
[dir="rtl"] .ch .big { line-height: 1.15; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 30em; }
.ch .get { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 8px; }

/* Phone screens, framed. */
.phone { padding: 6px; border-radius: clamp(22px, 2.6vw, 34px); background: #000; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08); }
.phone img { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: clamp(17px, 2.1vw, 28px); background: var(--ground-2); }

/* The drifting collage: four screens at their own speeds. */
.collage { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); padding-block: 2vh 10vh; }
.collage figure > * { will-change: transform; }
.collage figure:nth-child(1) { grid-column: 1 / 6; }
.collage figure:nth-child(2) { grid-column: 7 / 12; margin-top: 30%; }
.collage figure:nth-child(3) { grid-column: 2 / 7; margin-top: -8%; }
.collage figure:nth-child(4) { grid-column: 8 / 13; margin-top: 14%; }

/* The big line. */
.m-quote { font: 800 clamp(36px, 6vw, 96px)/.95 var(--head); letter-spacing: -.035em; text-transform: uppercase; color: var(--text); text-wrap: balance; }
[dir="rtl"] .m-quote { line-height: 1.2; }

/* swap: the screens change in place while the page moves. */
.m-swap { margin-inline: calc(-1 * var(--edge)); position: relative; }
.m-stick { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.fx .m-stick { position: sticky; top: 0; }
.fx .m-swap { height: calc(var(--n, 5) * 70vh + 100vh); }
.m-swap .m-stick { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(24px, 6vw, 96px); padding: 80px var(--pad) 24px; }
.m-stage { position: relative; height: min(76vh, 780px); aspect-ratio: 9 / 16; }
.m-stage > .phone { position: absolute; inset: 0; opacity: 0; transform: scale(1.06); transition: opacity .5s var(--ease), transform .8s var(--ease); }
.m-stage > .phone img { height: 100%; }
.m-stage > .phone.on { opacity: 1; transform: none; }
.m-side { display: flex; flex-direction: column; gap: 24px; }
.m-count { font: 600 14px/1 var(--sans); letter-spacing: .1em; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.m-count b { color: var(--text); }
.m-caps { display: grid; }
.m-caps > * { grid-area: 1 / 1; color: var(--accent); opacity: 0; transform: translateY(24px); transition: opacity .4s var(--ease), transform .6s var(--ease); }
.m-caps > .on { opacity: 1; transform: none; }
html:not(.fx) .m-swap .m-stick { height: auto; grid-template-columns: 1fr; padding-block: 48px; }
html:not(.fx) .m-stage { display: flex; gap: 16px; height: auto; aspect-ratio: auto; overflow-x: auto; }
html:not(.fx) .m-stage > .phone { position: static; opacity: 1; transform: none; flex: 0 0 220px; }
html:not(.fx) .m-caps, html:not(.fx) .m-count { display: none; }

/* Features: glass cards. */
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: var(--gap); padding: 0 var(--pad) 8vh; }
.feat { padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.feat .ic { font-size: 26px; color: var(--accent); margin-bottom: 8px; }
.feat h3 { font-size: 20px; color: var(--text); }
.feat p { color: var(--muted); font-size: 16px; }
.sec-head { display: flex; flex-direction: column; gap: 14px; padding: clamp(64px, 14vh, 160px) var(--pad) 32px; }

/* The end: the download again, with how to install. */
.h-end { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding: clamp(80px, 16vh, 180px) var(--pad); }
.h-end .get { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.install { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; }
.install h3 { font-size: 22px; }
.install ol { padding-inline-start: 22px; display: grid; gap: 8px; color: var(--text); }
.install .note { color: var(--muted); font-size: 15px; }

footer.foot { max-width: 1240px; margin: 0 auto; padding: 24px var(--pad) 32px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
footer.foot a { color: var(--muted); text-underline-offset: 3px; }
footer.foot .by { margin-inline-start: auto; }

/* First sight: rise into place. */
.fx .rv { opacity: 0; transform: translateY(48px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.fx .rv.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .ch-open { grid-template-columns: 1fr; }
  .ch-txt { position: static; padding-bottom: 0; }
  .collage { padding-block: 4vh 4vh; }
  .collage figure:nth-child(n+3) { display: none; }
  .collage figure:nth-child(1) { grid-column: 1 / 7; }
  .collage figure:nth-child(2) { grid-column: 7 / 13; margin-top: 22%; }
  .m-swap .m-stick { grid-template-columns: 1fr; align-content: center; justify-items: center; gap: 20px; padding-top: 76px; text-align: center; }
  .m-side { align-items: center; order: -1; gap: 12px; }
  .m-stage { height: min(62vh, 600px); }
  .m-quote { font-size: clamp(30px, 9vw, 48px); }
  .h-end { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
