/* In your customer's hand (2026-11-15, vertical version after Jeet's review of the first build; reference awsmd.com).
   A hand holds a current iPhone in the middle of the screen (CSS sticky) while a wall of big screen-sized cards
   scrolls up past it; inside the phone the Solenne homepage scrolls with the page until the section leaves.
   Every size is a multiple of --sw, the width of the phone's visible screen (geometry from src/hand_cutout.py). */

.hand {
  --stage-h: 100svh;                                       /* js/hand.js fixes it in px on touch screens */
  --sw: min(calc(var(--stage-h) * 0.3495), 30vw);          /* the phone's frame is 80% of the screen's height */
  --gap: calc(var(--sw) * 0.11);
  --pitch: calc(var(--sw) + var(--gap));
  --card-h: calc(var(--sw) * 2.1953);
  --row: calc(var(--card-h) + var(--gap));
  --screen-top: calc((var(--stage-h) - var(--sw) * 2.289) / 2 + var(--sw) * 0.047);
  --stage-tall: max(var(--stage-h), calc(var(--screen-top) + var(--sw) * 3.36));   /* room for the forearm's fade */
  --seam: clamp(260px, 26vw, 400px);                       /* the hero's daylight falls to dusk, then dark wine */
  --hand-travel: 6.2;                                      /* screen widths the page in the phone scrolls while held */
  position: relative;
  /* Jeet 11-16: the cut from the hero was "one solid brick". The ground starts at the colour of the hero's last row
     (its hazy city, measured #EEF3F7) and the haze darkens into wine, as evening falls (a sky blue band in between
     read as sky under the city) */
  background: linear-gradient(in oklab, #EEF3F7 0, #dfdde4 calc(var(--seam) * 0.16), #bcadb8 calc(var(--seam) * 0.34),
    #8a6d7c calc(var(--seam) * 0.52), #573444 calc(var(--seam) * 0.7), #36151f calc(var(--seam) * 0.86), var(--ink) var(--seam)) var(--ink);
  color: #F3F7FA;
}

.hand-head { padding: calc(var(--seam) * 0.72) var(--pad) var(--s8); }   /* the words start where dusk is dark enough */
.hand-head h2 {
  margin: 0; max-width: 13em;
  font: 500 clamp(36px, min(3.4vw, 6.2svh), 60px)/1 var(--sans);
  letter-spacing: -0.03em; text-wrap: balance;
}
.hand-head p { margin-top: var(--s4); font-size: var(--t-lead); line-height: 1.45; color: #A9B9C8; }   /* 8.9:1 */

/* the run: the phone is held for exactly two rows of the wall, then the section leaves with it (three rows until
   Jeet's 11-16 review: the way to the calendar was too long) */
.hand-run { position: relative; height: calc(var(--stage-tall) + var(--row) * 2); }

/* a calm light behind everything: a soft sky glow centred on the phone, drifting very slowly */
.hand-rail { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hand-glow { position: sticky; top: 0; height: var(--stage-h); overflow: hidden; }
.hand-glow::before {
  content: ""; position: absolute; left: 50%; top: calc(var(--screen-top) + var(--card-h) * 0.5);
  width: calc(var(--sw) * 5.4); aspect-ratio: 1; margin: calc(var(--sw) * -2.7) 0 0 calc(var(--sw) * -2.7);
  background: radial-gradient(closest-side, rgba(191, 217, 238, 0.13), rgba(191, 217, 238, 0.04) 50%, rgba(191, 217, 238, 0) 74%);
}

/* the wall: columns either side of the phone, rows level with its screen; it scrolls with the page */
.hand-wall { position: absolute; inset: 0; z-index: 1; overflow: clip; pointer-events: none; }
.hand-card {
  position: absolute; max-width: none;
  left: calc(50% + var(--c) * var(--pitch) - var(--sw) / 2);
  top: calc(var(--screen-top) + var(--r) * var(--row));
  width: var(--sw); height: var(--card-h);
  border-radius: calc(var(--sw) * 0.1582);
  object-fit: cover; background: #1A080D;
  box-shadow: 0 0 0 1px rgba(243, 247, 250, 0.06);
  opacity: 0.9;                     /* the wall recedes a little; the hand and phone lead (squint test) */
}

/* the held phone: the real screen sits behind the photo, whose screen is keyed out */
.hand-stage { position: sticky; top: 0; z-index: 2; height: var(--stage-tall); overflow: clip; pointer-events: none; }
.hand-rig {
  position: absolute; left: 50%; top: var(--screen-top);
  width: var(--sw); height: var(--card-h); margin-left: calc(var(--sw) * -0.5);
}
.hand-screen {
  position: absolute; left: calc(var(--sw) * -0.0059); top: calc(var(--sw) * -0.0059);
  width: calc(var(--sw) * 1.0117); height: calc(var(--sw) * 2.207);
  border-radius: calc(var(--sw) * 0.1641); overflow: hidden; isolation: isolate;
  background: #5C5363;
}
.hand-strip {                       /* the page starts under the status bar and scrolls with --t (0..1) */
  position: absolute; left: calc(var(--sw) * 0.0059); top: 0;
  width: var(--sw); height: auto; max-width: none;
  transform: translate3d(0, calc(var(--sw) * (0.1433 - var(--t, 0) * var(--hand-travel))), 0);
}
.hand-nav {                         /* Solenne's own fixed menu, 16 px under the status bar */
  position: absolute; left: calc(var(--sw) * 0.0492); top: calc(var(--sw) * 0.184);
  width: calc(var(--sw) * 0.916); height: calc(var(--sw) * 0.1145); max-width: none;
  border-radius: 999px; z-index: 2;
}
.hand-screen::before {              /* the status area: frosted and tinted by the page beneath, as Safari does */
  content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: 1;
  height: calc(var(--sw) * 0.17);
  background: rgba(30, 26, 30, 0.62);
  -webkit-backdrop-filter: blur(calc(var(--sw) * 0.05)) saturate(1.4);
  backdrop-filter: blur(calc(var(--sw) * 0.05)) saturate(1.4);
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
  transition: background-color 220ms ease;
}
.hand-screen[data-sb="l"]::before { background: rgba(248, 247, 246, 0.9); }
.hand-screen::after {               /* the glass: one soft reflection from the upper left */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 30%, rgba(255, 255, 255, 0) 42%);
}
.hand-img {
  position: absolute; left: calc(var(--sw) * -0.3008); top: calc(var(--sw) * -0.0586);
  width: calc(var(--sw) * 2.168); height: calc(var(--sw) * 3.4102); max-width: none;
  pointer-events: none; user-select: none;
}

/* a current iPhone (393 x 852 pt): status bar, Dynamic Island 126 x 37 at 11 pt, home indicator (it inverts
   against whatever scrolls beneath, as iOS does) */
.hand-sb {
  position: absolute; left: 0; right: 0; top: calc(var(--sw) * 0.034); height: calc(var(--sw) * 0.0941);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--sw) * 0.078) 0 calc(var(--sw) * 0.104);
  font: 500 calc(var(--sw) * 0.0435)/1 var(--sans); letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
  color: #fff; z-index: 3; transition: color 220ms ease;
}
.hand-screen[data-sb="l"] .hand-sb { color: #111; }
.hand-sb svg { width: calc(var(--sw) * 0.19); height: calc(var(--sw) * 0.032); fill: currentColor; }
.hand-di {
  position: absolute; left: 50%; top: calc(var(--sw) * 0.034);
  width: calc(var(--sw) * 0.3206); height: calc(var(--sw) * 0.0941); margin-left: calc(var(--sw) * -0.1603);
  border-radius: 999px; background: #000; z-index: 3;
}
.hand-home {
  position: absolute; left: 50%; bottom: calc(var(--sw) * 0.026);
  width: calc(var(--sw) * 0.34); height: calc(var(--sw) * 0.0128); margin-left: calc(var(--sw) * -0.17);
  border-radius: 999px; background: #fff; mix-blend-mode: difference; opacity: 0.9; z-index: 3;
}

@media (prefers-reduced-motion: no-preference) {
  .hand.is-near .hand-glow::before { animation: hand-drift 52s ease-in-out infinite alternate; }
  .hand-strip { will-change: transform; }
}
@keyframes hand-drift {
  from { transform: translate3d(-3%, 1%, 0); }
  to { transform: translate3d(4%, -3%, 0); }
}

/* ---------- phone: the same composition, scaled; the bar at the foot never covers the phone ---------- */
@media (max-width: 720px) {
  .hand {
    --sw: min(calc(var(--stage-h) * 0.3495), 44vw);
    --screen-top: calc((var(--stage-h) - 84px - env(safe-area-inset-bottom) - var(--sw) * 2.289) / 2 + var(--sw) * 0.047);
    --seam: clamp(200px, 48vw, 260px);
  }
  .hand-head { padding: calc(var(--seam) * 0.72) var(--pad) 40px; }
  .hand-head h2 { font-size: clamp(30px, 8.4vw, 40px); line-height: 1.02; }
  .hand-head p { margin-top: var(--s3); font-size: var(--t-body); }
}
