/* The save-to-phone how-to (assets/howto-ui.js). A phone drawn in CSS; the scene classes s1..s4 (now) and r1..r4 (reached) on
   .ht-phone drive every layer. Only transform and opacity move. Times come from the motion tokens; a step changes by a short fade or slide.
   Reduced motion: no transitions, no pulse; the steps are still stepped through. Each step is one frozen state of the phone (s1..s4). */
.ht{--mk-ground:#F3EEE5;--mk-paper:#FFFDF8;--mk-ink:#1A1A1A;--mk-mut:#7A7268;--mk-red:#D92231;--mk-line:rgba(26,26,26,.12);--mk-tile:#DCD5C8;
  display:grid;gap:14px;justify-items:center;text-align:center;width:100%}
.ht-h{font:800 clamp(20px,.6vw + 17px,26px)/1.1 var(--display);font-stretch:106%;text-wrap:balance}
.ht-stage{--ph:clamp(300px,44svh,440px);width:calc(var(--ph) * .49);height:var(--ph);position:relative}
.ht-frame{position:relative;width:100%;height:100%;padding:calc(var(--ph) * .012);border-radius:calc(var(--ph) * .085);background:#1A1A1A;box-shadow:var(--shadow)}
.ht-phone{position:relative;width:100%;height:100%;container-type:size;overflow:hidden;border-radius:calc(var(--ph) * .073);background:var(--mk-ground);color:var(--mk-ink);font:500 4.5cqw/1.2 var(--body);isolation:isolate}
.ht-phone img{display:block}
/* status bar and page */
.ht-status{position:absolute;z-index:6;left:0;right:0;top:0;height:9cqw;display:flex;align-items:center;padding:0 8cqw;font-size:4.2cqw}
.ht-status::after,.op-status::after{content:"";position:absolute;left:50%;top:2.4cqw;width:22cqw;height:5.2cqw;margin-left:-11cqw;border-radius:9cqw;background:#1A1A1A}
.ht-page{position:absolute;inset:0;padding:9cqw 0 0}
[data-platform="and"] .ht-page{padding-top:22cqw}
.pg-head{height:12cqw;display:flex;align-items:center;padding:0 5cqw}
.pg-head img{height:5cqw;width:auto}
.pg-card{height:22cqw;margin:3cqw 5cqw 0;border-radius:4cqw;background:var(--mk-paper);box-shadow:0 .4cqw 1.6cqw rgba(60,40,20,.14)}
.pg-card.hero{height:40cqw;background:var(--mk-red)}
/* browser bars (neutral, not any real browser's) */
.ht-bar{position:absolute;z-index:5;left:0;right:0;display:none;align-items:center;gap:3cqw;padding:0 4cqw;background:var(--mk-paper)}
.ht-bar .url{flex:1;height:9cqw;border-radius:5cqw;background:var(--mk-tile);display:grid;place-items:center;font-size:3.9cqw;color:var(--mk-mut)}
.bar-ios{bottom:0;height:19cqw;padding-bottom:4cqw}
.btn-dots,.btn-kebab{flex:none;width:12cqw;height:12cqw;border-radius:50%;display:grid;place-items:center;font-size:5.0cqw;font-weight:800;letter-spacing:-.2cqw}
.btn-dots{background:var(--mk-tile)}
.bar-and{top:9cqw;height:13cqw}
.btn-kebab{font-size:7.5cqw}
[data-platform="ios"] .bar-ios,[data-platform="and"] .bar-and{display:flex}
/* menus, sheets, dialogs */
.ht-menu{position:absolute;z-index:7;display:none;flex-direction:column;border-radius:4cqw;background:var(--mk-paper);box-shadow:0 1cqw 5cqw rgba(0,0,0,.28);opacity:0;transform:translateY(3cqw) scale(.96);transition:opacity var(--m-dur-3) var(--m-out),transform var(--m-dur-3) var(--m-out)}
.mr{display:flex;align-items:center;gap:3cqw;padding:0 4cqw;height:11cqw;font-size:4.6cqw;border-bottom:1px solid var(--mk-line);text-align:left}
.mr:last-child{border-bottom:0}
.mi{flex:none;width:5cqw;height:5cqw;display:grid;place-items:center}
.mi svg{width:100%;height:100%}
.menu-ios{right:4cqw;bottom:21cqw;width:58cqw;transform-origin:100% 100%}
.menu-and{right:3cqw;top:20cqw;width:62cqw;transform-origin:100% 0;transform:translateY(-3cqw) scale(.96)}
[data-platform="ios"] .menu-ios,[data-platform="and"] .menu-and{display:flex}
.ht-share,.ht-add{position:absolute;z-index:8;left:0;right:0;bottom:0;border-radius:6cqw 6cqw 0 0;background:var(--mk-paper);box-shadow:0 -1cqw 5cqw rgba(0,0,0,.28);transform:translateY(105%);transition:transform var(--m-dur-4) var(--m-out)}
.ht-share{display:none;padding:2cqw 0 4cqw}
[data-platform="ios"] .ht-share,[data-platform="ios"] .ht-add{display:block}
.sh-grab{width:10cqw;height:1.2cqw;border-radius:1cqw;background:var(--mk-tile);margin:0 auto 2cqw}
.sh-top{display:flex;align-items:center;gap:3cqw;padding:2cqw 4cqw 3cqw;border-bottom:1px solid var(--mk-line);font-weight:700;text-align:left}
.sh-ic{width:9cqw;height:9cqw;border-radius:2.2cqw;overflow:hidden}
.sh-ic img{width:100%;height:100%}
.more-row{height:11cqw;opacity:0;transform:translateY(2cqw);transition:opacity var(--m-dur-3) var(--m-out),transform var(--m-dur-3) var(--m-out)}
.more{color:var(--mk-mut)}
.ht-add{display:none;height:56%;padding:3cqw 4cqw}
.ad-top{display:flex;justify-content:space-between;align-items:center;font-size:4.2cqw;color:var(--mk-mut)}
.ad-top b{color:var(--mk-ink);font-size:4.4cqw}
.ad-go{color:var(--mk-red);font-weight:800}
.ad-body{display:flex;align-items:center;gap:4cqw;margin-top:8cqw;padding:4cqw;border-radius:4cqw;background:var(--mk-ground);text-align:left}
.ad-ic{flex:none;width:18cqw;height:18cqw;border-radius:4cqw;overflow:hidden;box-shadow:0 .4cqw 1.6cqw rgba(0,0,0,.2)}
.ad-ic img{width:100%;height:100%}
.ad-name{font-size:6.2cqw;font-weight:700}
.ht-install{position:absolute;z-index:8;left:50%;top:50%;width:76cqw;margin:-24cqw 0 0 -38cqw;padding:6cqw 5cqw 4cqw;display:none;flex-direction:column;align-items:center;gap:1.5cqw;border-radius:6cqw;background:var(--mk-paper);box-shadow:0 1cqw 8cqw rgba(0,0,0,.4);opacity:0;transform:scale(.94);transition:opacity var(--m-dur-3) var(--m-out),transform var(--m-dur-3) var(--m-out)}
[data-platform="and"] .ht-install{display:flex}
.in-ic{width:16cqw;height:16cqw;border-radius:3.6cqw;overflow:hidden;box-shadow:0 .4cqw 1.6cqw rgba(0,0,0,.2)}
.in-ic img{width:100%;height:100%}
.ht-install b{font-size:5.8cqw}
.in-url{font-size:3.8cqw;color:var(--mk-mut)}
.in-btns{display:flex;justify-content:flex-end;gap:6cqw;width:100%;margin-top:4cqw;font-size:4.8cqw;font-weight:700;color:var(--mk-red)}
/* the home screen and the app opening */
.ht-home{position:absolute;z-index:9;inset:0;background:linear-gradient(170deg,#6F7FA8,#3E4A6E);opacity:0;transition:opacity var(--m-dur-3) var(--m-out)}
.hs-grid{position:absolute;left:6cqw;right:6cqw;top:20cqw;display:grid;grid-template-columns:repeat(4,1fr);gap:7cqw 4cqw}
.hs-grid i,.hs-icon{aspect-ratio:1;border-radius:4.4cqw;background:rgba(255,255,255,.26)}
[data-platform="and"] .hs-grid i,[data-platform="and"] .hs-icon{border-radius:50%}
.hs-icon{grid-column:2;grid-row:3;overflow:hidden;background:#fff;opacity:0;transform:scale(1.5);transition:opacity var(--m-dur-3) var(--m-out),transform var(--m-dur-4) var(--m-out)}
.hs-icon img{width:100%;height:100%}
.hs-dock{position:absolute;left:5cqw;right:5cqw;bottom:5cqw;height:19cqw;border-radius:7cqw;background:rgba(255,255,255,.22);display:flex;justify-content:space-around;align-items:center}
.hs-dock i{width:13cqw;height:13cqw;border-radius:3.6cqw;background:rgba(255,255,255,.32)}
[data-platform="and"] .hs-dock i{border-radius:50%}
.ht-open{position:absolute;z-index:10;inset:0;background:var(--mk-ground);opacity:0;transform:scale(.2);transform-origin:38.5cqw 81.5cqw;transition:transform var(--m-dur-4) var(--m-out),opacity var(--m-dur-3) var(--m-out)}
.op-status{position:relative;height:9cqw;display:flex;align-items:center;padding:0 8cqw;font-size:4.2cqw}
/* tap marks: a ring where a finger lands, shown by the scene that needs it */
.tap{position:absolute;z-index:12;width:13cqw;height:13cqw;margin:-6.5cqw 0 0 -6.5cqw;border-radius:50%;border:.9cqw solid var(--mk-red);background:rgba(217,34,49,.16);box-shadow:0 0 0 .7cqw rgba(255,255,255,.85);opacity:0;transform:scale(1.6)}
@keyframes htTap{0%{opacity:0;transform:scale(1.6)}20%{opacity:1;transform:none}74%{opacity:1;transform:none}100%{opacity:0;transform:scale(.9)}}
.t-dots{left:90%;top:calc(100% - 11.5cqw)}
.t-share{left:67%;top:calc(100% - 48.5cqw)}
.t-more{left:50%;top:calc(100% - 20.5cqw)}
.t-addhs{left:50%;top:calc(100% - 9.5cqw)}
.t-add{left:90%;top:calc(44% + 6cqw)}
.t-kebab{left:90%;top:15.5cqw}
.t-ahs{left:66%;top:47.5cqw}
.t-install{left:calc(50% + 25cqw);top:calc(50% + 17cqw)}
.t-icon{left:38.5cqw;top:81.5cqw}
[data-platform="and"] .t-dots,[data-platform="and"] .t-share,[data-platform="and"] .t-more,[data-platform="and"] .t-addhs,[data-platform="and"] .t-add{display:none}
[data-platform="ios"] .t-kebab,[data-platform="ios"] .t-ahs,[data-platform="ios"] .t-install{display:none}
/* scene choreography, iPhone: 1 the dots menu, 2 the share sheet, 3 the add dialog, 4 the home screen */
.s1 .menu-ios,.s1 .menu-and{opacity:1;transform:none;}
.r2 .menu-ios{opacity:0;}
.r2 .ht-share{transform:none;}
.r2 .more-row{opacity:1;transform:none;}
.r3 .ht-share{transform:translateY(105%);}
.r3 .ht-add{transform:none;}
.r4 .ht-add{transform:translateY(105%)}
.r4 .ht-home{opacity:1;}
.r4 .hs-icon{opacity:1;transform:none;}
/* scene choreography, Android: 1 the three-dot menu, 2 its Add to home screen row, 3 the install dialog, 4 the home screen */
[data-platform="and"].r2 .menu-and{opacity:1;transform:none;}
[data-platform="and"].r3 .menu-and{opacity:0;}
[data-platform="and"].r3 .ht-install{opacity:1;transform:none;}
[data-platform="and"].r4 .ht-install{opacity:0;}
/* the ring: the one tap this step is about. It pulses (transform and opacity only); no pulse under reduced motion. */
@keyframes htPulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.18);opacity:.7}}
.ht-phone.s1 .t-share,.ht-phone.s2 .t-addhs,.ht-phone.s3 .t-add,.ht-phone.s4 .t-icon,
.ht-phone[data-platform="and"].s1 .t-kebab,.ht-phone[data-platform="and"].s2 .t-ahs,.ht-phone[data-platform="and"].s3 .t-install{opacity:1;transform:none;animation:htPulse calc(var(--m-dur-4) * 4) ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.tap{animation:none !important}}
.rm .tap{animation:none !important}
/* captions and controls */
.ht-cap{display:grid;gap:4px;min-height:4.2em;max-width:34ch;font:500 clamp(16px,.4vw + 14px,19px)/1.4 var(--body);text-wrap:balance}
.ht-count{font:600 12px/1.2 var(--body);letter-spacing:.08em;text-transform:uppercase;color:var(--red-ink)}
.ht-ctl{display:flex;gap:6px;align-items:center;justify-content:center}
.ht-back,.ht-next{display:inline-flex;align-items:center;gap:4px;border:0;border-radius:999px;background:var(--paper);box-shadow:var(--shadow);min-width:44px;min-height:44px;padding:0 14px 0 10px;font:600 15px/1 var(--body);color:var(--ink)}
.ht-next{padding:0 10px 0 14px}
.ht-back svg,.ht-next svg{width:18px;height:18px}
.ht-back:disabled,.ht-next:disabled{opacity:.35;box-shadow:none}
.ht-copy{display:inline-block}
.ht-other,.ht-copy{border:0;background:none;min-height:44px;padding:0 10px;font:600 15px/1.2 var(--body);color:var(--red-ink);text-decoration:underline;text-underline-offset:3px}
.ht-email{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 8px;max-width:44ch;font:400 14px/1.4 var(--body);color:var(--muted)}
.ht-install-btn{justify-self:center}
/* a desktop: open it on a phone */
.ht-dp{max-width:36ch;font:400 17px/1.45 var(--body);color:var(--muted)}
.ht-qr{box-sizing:content-box;width:296px;height:296px;image-rendering:pixelated;border-radius:12px;background:#fff;padding:12px;box-shadow:var(--shadow)}
.ht-url{font:600 15px/1.2 var(--body);color:var(--ink);word-break:break-all}
/* reduced motion: no transitions, no pulse; the steps are still stepped with Back, Play and Next */
@media (prefers-reduced-motion:reduce){.ht-phone,.ht-phone *{transition:none !important}}
.rm .ht-phone,.rm .ht-phone *{transition:none !important}
