/* Home: the two phone stages (Smart Signals, Bills before payday) set in real photographs instead of the fluted colour
   field, and the auto-categorize stage after them on a photograph of a desk at blue hour (the last block in this file). Linked after
   public-skin.css. The phone scenes are scoped to .hm-scene-stage and the desk to .aic.is-scene, so taking those classes
   and the photo layers back out of HomeShowcase.razor restores the field.

   A scene, back to front:
     .hm-scene-photo            the photograph, with a phone in it, face-on
     .hm-flow                   the cards, sliding across in front of the picture. They fade out as they reach the phone,
                                so a card never runs into a finger or the phone's edge
     .hm-phone                  the app screenshot, laid exactly over the photographed phone's display
     .hm-flow.is-screen         a second copy of the cards, clipped to the display: the cards as the app draws them
     .hm-sn                     Smart Signals only: the app's indicator line under the cards (home-story.css)
     .hm-scene-glass            the glass over the display: a faint reflection and a little grain
   The two card rows are the same markup with the same animation, so they stay in step: a card fades at the phone's edge
   and the same card is already there on the screen.

   Geometry. home-story.css places the phone with --hm-pw / --hm-pl / --hm-pt (cqw) and draws the screenshot .9795 phone
   widths wide (--sc-s), .01025 phone widths in (--sc-l) and --hm-it down. Each photograph is scaled so its display is
   exactly that wide and shifted so the display's corner lands there, which leaves the card band (--hm-st / --hm-sh,
   fractions of the screenshot) where it already was at every breakpoint. Per photograph, in display widths: --sc-w the
   frame's width, --sc-x / --sc-y the display's offset inside the frame, --sc-r the display's corner radius, --sc-bl / --sc-br
   how far the cards keep clear of the display's left and right edges (the phone's body, plus any fingers that come
   round it at the height of the cards); --sc-a is the display's aspect. A new photograph needs those seven numbers
   and nothing else. */
.hm-scene-stage { --sc-s: calc(var(--hm-pw) * .9795); --sc-l: calc(var(--hm-pl) + var(--hm-pw) * .01025); --sc-grain: .05; --sc-fade: calc(var(--sc-s) * .12); --sc-edge-l: calc(var(--sc-l) - var(--sc-s) * var(--sc-bl)); --sc-edge-r: calc(var(--sc-l) + var(--sc-s) * (1 + var(--sc-br))); border: 0; background: var(--sc-tone, #8d8f8c); }
.hm-scene-stage.is-outdoor { --sc-w: 2.89631; --sc-x: .94756; --sc-y: .22646; --sc-r: .14; --sc-a: 839 / 1819; --sc-bl: .08; --sc-br: .25; --sc-tone: #9a969b; }
.hm-scene-stage.is-desk { --sc-w: 2.87143; --sc-x: .86143; --sc-y: .10714; --sc-r: .121; --sc-a: 700 / 1520.9; --sc-bl: .05; --sc-br: .05; --sc-tone: #d8d4cf; }
/* The desk photograph has less room to the phone's left than the stage wants, so on wide screens the phone sits 2.5 to the left of centre. */
@media (min-width: 768px) { .hm-scene-stage.is-desk { --hm-pl: 29.5; } }
.hm-scene-stage::before, .hm-scene-stage::after { content: none; }

.hm-scene-photo { position: absolute; z-index: 0; left: calc((var(--sc-l) - var(--sc-s) * var(--sc-x)) * 1cqw); top: calc((var(--hm-it) - var(--sc-s) * var(--sc-y)) * 1cqw); width: calc(var(--sc-s) * var(--sc-w) * 1cqw); max-width: none; height: auto; pointer-events: none; -webkit-user-select: none; user-select: none; }

/* The cards in front of the picture: soft at the stage's edges (as before) and gone by the time they reach the phone. */
.hm-scene-stage .hm-flow { z-index: 1; --sc-mask: linear-gradient(90deg, transparent 0, #000 5%, #000 calc((var(--sc-edge-l) - var(--sc-fade)) * 1cqw), transparent calc(var(--sc-edge-l) * 1cqw), transparent calc(var(--sc-edge-r) * 1cqw), #000 calc((var(--sc-edge-r) + var(--sc-fade)) * 1cqw), #000 95%, transparent 100%); -webkit-mask-image: var(--sc-mask); mask-image: var(--sc-mask); }
/* On phones the handset fills the stage; there is no room beside it for a card to read, so only the screen's row runs. */
@media (max-width: 767.98px) { .hm-scene-stage .hm-flow:not(.is-screen) { display: none; } }

/* The display. The drawn bezel goes: the photographed phone is the frame. */
.hm-scene-stage .hm-phone { --w: calc(var(--sc-s) * 1cqw); z-index: 3; left: calc(var(--sc-l) * 1cqw); top: calc(var(--hm-it) * 1cqw); aspect-ratio: var(--sc-a); border: 0; border-radius: calc(var(--w) * var(--sc-r)); background: #000; box-shadow: none; filter: none; }
.hm-scene-stage .hm-phone img { border-radius: 0; }
.hm-scene-stage .hm-phone::after { top: calc(var(--w) * .0357); width: calc(var(--w) * .306); height: calc(var(--w) * .0715); }

/* On the display the cards are the app's own: opaque, no blur. Outside it they stay glass (public-skin.css). */
.hm-scene-stage .hm-flow.is-screen { z-index: 4; -webkit-mask-image: none; mask-image: none; clip-path: inset(0 calc((100 - var(--sc-l) - var(--sc-s)) * 1cqw) 0 calc(var(--sc-l) * 1cqw)); }
.hm-scene-stage .hm-flow.is-screen .hm-sig { background: linear-gradient(135deg, color-mix(in srgb, var(--hm-tone) var(--hm-sig-tint), var(--hm-sig-card)), var(--hm-sig-card) 62%); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
/* The Smart Signals cards scroll inside the app's panel, which sits 2.5% of the display in from each edge. */
.hm-scene-stage .hm-flow-signals.is-screen { clip-path: inset(0 calc((100 - var(--sc-l) - var(--sc-s) * .975) * 1cqw) 0 calc((var(--sc-l) + var(--sc-s) * .025) * 1cqw)); }
.hm-scene-stage .hm-flow.is-screen .hm-bgrp-head { -webkit-backdrop-filter: none; backdrop-filter: none; background: transparent; }

/* The glass: one soft reflection across the top corner and a little grain, so the display sits in the picture
   instead of on it. */
.hm-scene-glass { position: absolute; z-index: 5; left: calc(var(--sc-l) * 1cqw); top: calc(var(--hm-it) * 1cqw); width: calc(var(--sc-s) * 1cqw); aspect-ratio: var(--sc-a); border-radius: calc(var(--sc-s) * var(--sc-r) * 1cqw); overflow: hidden; pointer-events: none; background: linear-gradient(118deg, rgba(255, 255, 255, .11) 0, rgba(255, 255, 255, .03) 26%, transparent 42%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55); }
.hm-scene-glass::after { content: ""; position: absolute; inset: 0; opacity: var(--sc-grain); mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 220px 220px; }

/* Dark theme: the same photographs, a stop down, so the stage sits in the dark page. */
[data-bs-theme="dark"] .hm-scene-photo { filter: brightness(.8) saturate(.94); }
[data-bs-theme="dark"] .hm-scene-stage.is-desk .hm-scene-photo { filter: brightness(.66) saturate(.9); }

/* The third stage, auto-categorize on the web: the same idea without a device in the picture. A photograph of a desk by
   a window at blue hour fills the stage (PublicAutoCategorizeDemo's Backdrop, the stage's first child): indigo curtains
   and a few warm lights, close to the page's own colours. The browser window and the picker stay the glass panels they
   were, so the room shows through them, blurred. The stage shows the photograph from its top edge, which puts the lights
   above the panels and the tablet and book on the desk under the browser window, where the saved note lands;
   the plant and the clock sit behind the picker. Under 992px the picker fills the stage and the photograph is the rim
   around it. */
.hm-categorize .aic.is-wide.is-scene { background: #2e3549; }
[data-bs-theme="dark"] .hm-categorize .aic.is-wide.is-scene { background: #272d3e; }
.hm-categorize .aic.is-wide.is-scene::before, .hm-categorize .aic.is-wide.is-scene::after { content: none; }
.hm-categorize .aic.is-scene .hm-scene-photo { z-index: -1; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
[data-bs-theme="dark"] .hm-categorize .aic.is-scene .hm-scene-photo { filter: brightness(.86) saturate(.95); }
