/* ==========================================================================
   Services — fluted glass between the opening and the services
   One still from the brand film's glass engine (img/glass/services-glass-scene-v4-grid.py): a carton seen
   through ribbed glass, clearer at the left, more fluted toward the right, with the film's small warm light.

   Placement is set from the page grid and its 96px section unit, not by eye:
   - the carton's left edge sits on the start of column 2 (one column in from the headline), clear of the paragraphs;
   - the carton's top sits one unit (96px) below the end of the opening paragraphs;
   - the floor line of light sits one unit above the Bone, so the strip ends 96px under it;
   - the glass rises out of the Slate behind the paragraphs: the still's top rows are the page Slate
     (#2B4B5A, baked in at render time) and an eased mask keeps the ribs faint under the text.
   Image geometry (fractions of its height): carton top 0.47, floor line 0.735. Its width is 3.2 × its height,
   and the carton's left edge is at 0.312 of its width (0.998 × its height).
   ========================================================================== */

.svc-open { padding-bottom: 0; }
.svc-open h1, .svc-open__body { position: relative; z-index: 2; }

.svc-glass {
  --unit: 96px;
  --hi: max(min(50vw, 760px), calc(43vw + 8px));                  /* rendered height; wide enough to cover the width */
  position: relative; z-index: 1; overflow: hidden; pointer-events: none; background: var(--slate);
  height: calc(var(--hi) * 0.735 + var(--unit));
  margin-top: calc(var(--unit) - var(--hi) * 0.47);
}
.svc-glass img {
  position: absolute; top: 0; height: var(--hi); width: auto; max-width: none;
  left: calc(12.963vw + 3.33px - var(--hi) * 0.998);              /* carton's left edge on the start of column 2 */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.03) 10%, rgba(0,0,0,.1) 18%,
    rgba(0,0,0,.16) 26%, rgba(0,0,0,.26) 34%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.9) 45%, #000 50%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.03) 10%, rgba(0,0,0,.1) 18%,
    rgba(0,0,0,.16) 26%, rgba(0,0,0,.26) 34%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.9) 45%, #000 50%);
}

@media (prefers-reduced-motion: no-preference) {
  .svc-glass img { animation: glass-in 1.6s var(--ease) both; }
}
@keyframes glass-in { from { opacity: 0; } to { opacity: 1; } }

/* Phones: one column, so the carton is centred; the phone still is 10:9 and keeps the same vertical
   fractions, with the phone section unit (64px). */
@media (max-width: 640px) {
  .svc-glass {
    --unit: 64px; --hi: 90vw;
    height: calc(var(--hi) * 0.735 + var(--unit));
    margin-top: calc(var(--unit) - var(--hi) * 0.47);
  }
  .svc-glass img { left: 0; width: 100%; height: var(--hi); }
}
