/* ---------- Functions view (#functions): Nick's circuit-board picture with the copy centred in the chip's red square, one
   testimonial in the home testimonials card rising over it (as on home), then the homepage feature cards (features.css),
   each with a live scene from the fn-scenes folder ---------- */

/* hero (Nick, 2026-10-24): the whole board, the chip's red square redrawn bigger so the copy fits (tools/art/fn_chip.py).
   --s is the square on screen. The desktop picture is 3.571s x 2.241s: the square is 28% of its width, its centre 50.1%
   across and .893s from the top; the bottom .455s is board mirrored on for the testimonials card, which covers the hero's
   bottom 130px (--tc), as on home. The picture starts under the header, its top fading into the board's blue */
#functions .fnp-hero{--hd:64px;--tc:130px;--s:clamp(390px,28vw,538px);display:flex;align-items:center;justify-content:center;height:calc(var(--hd) + var(--s) * 1.786 + var(--tc));padding:var(--hd) var(--gut) var(--tc)}
#functions .wfp-sky{bottom:0;height:auto;background:#0871FB}
#functions .fnp-hero .wfp-sky img{left:calc(50% - var(--s) * 1.789);top:var(--hd);bottom:auto;width:calc(var(--s) * 3.571);height:calc(var(--s) * 2.241);min-height:0;transform:none;object-fit:fill;-webkit-mask-image:linear-gradient(to bottom,transparent,#000 56px);mask-image:linear-gradient(to bottom,transparent,#000 56px)}
/* past 1920 the square stops growing: the board holds its 1920 size, its sides fading into the blue */
@media (min-width:1921px){#functions .fnp-hero .wfp-sky img{-webkit-mask-image:linear-gradient(to bottom,transparent,#000 56px),linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(to bottom,transparent,#000 56px),linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);mask-composite:intersect}}
/* the page's paper over the picture, multiplied in (as on Loopgents) */
#functions .fnp-hero .wfp-sky::after{content:"";position:absolute;inset:0;background:var(--paper);mix-blend-mode:multiply;pointer-events:none}
/* the copy is the square: headline, subtitle, button in dark ink (an orange button would vanish on the red). The .fnp-die
   wrapper only matters on phones, where the subtitle leaves the square */
.fnp-hero-copy{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--s) * .036);width:var(--s);height:var(--s);padding:calc(var(--s) * .085);text-align:center}
.fnp-die{display:contents}
/* the chip's red a bit lighter so the copy reads (Nick 2026-10-27): a pale wash screened over the square only, the crayon
   grain kept, desktop only. No z-index on the copy, so the wash sits in the hero's stacking context above the painting and under the text */
@media (min-width:721px){   /* phones lay the copy out off the square, so it gets no wash */
  #functions .fnp-hero-copy{position:relative}
  #functions .fnp-hero-copy::before{content:"";position:absolute;inset:-1%;z-index:-1;background:#FFE3D6;mix-blend-mode:screen;opacity:.5;pointer-events:none;-webkit-mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent),linear-gradient(transparent,#000 7%,#000 93%,transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent),linear-gradient(transparent,#000 7%,#000 93%,transparent);mask-composite:intersect}
}
#functions .fnp-hero h1{order:1;max-width:none;margin:0;font:500 calc(var(--s) * .09)/1.05 var(--sans);letter-spacing:-.025em;color:#141414;text-wrap:balance}
.fnp-lede{order:2;font:450 clamp(14px,calc(var(--s) * .036),18px)/1.45 var(--sans);color:rgba(20,20,20,.8);text-wrap:pretty}
#functions .fnp-hero .ctas{order:3;margin-top:calc(var(--s) * .012)}
#functions .fnp-hero .btn-brand{height:48px;background:#141414;border-color:#141414;color:#fff}
#functions .fnp-hero .btn-brand:hover{background:#2A2A2A}
/* phones: the picture is cropped to the chip (board-ph, 840 x 1000: 1.5s x 1.786s, the square's centre .75s from its left),
   so the square is small; it keeps the headline and the button, the subtitle goes under the picture on the paper */
@media (max-width:720px){
  #functions .fnp-hero{--hd:52px;--s:70vw;display:block;height:auto;padding:var(--hd) var(--gut) 4px}
  #functions .wfp-sky{bottom:auto;height:calc(var(--hd) + var(--s) * 1.786)}
  #functions .fnp-hero .wfp-sky img{left:calc(50% - var(--s) * .75);width:calc(var(--s) * 1.5);height:calc(var(--s) * 1.786);-webkit-mask-image:linear-gradient(to bottom,transparent,#000 36px);mask-image:linear-gradient(to bottom,transparent,#000 36px)}
  .fnp-hero-copy{display:flex;width:auto;height:auto;padding:0;gap:0}
  .fnp-die{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;width:var(--s);height:var(--s);margin:calc(var(--s) * .393) auto;padding:calc(var(--s) * .07)}
  #functions .fnp-hero h1{font-size:calc(var(--s) * .092)}
  #functions .fnp-hero .ctas{margin:0}
  #functions .fnp-hero .btn-brand{height:44px;padding:0 20px;flex:0 0 auto}
  .fnp-lede{max-width:30em;margin:26px auto 0;font-size:16px;line-height:1.5}
}

/* the home testimonials card with one testimonial shown open (the home pop-up's face, quote and name), sized as on Loopgents.
   It keeps home's rise over the hero (.trusted: -130px) and home's air down to the cards */
#functions .fnp-tm{display:grid;grid-template-columns:112px minmax(0,1fr);gap:24px;width:min(680px,100%);margin:8px auto 0;text-align:left}
#functions .fnp-tm .tm-quote{font-size:16px}
#functions .fnp-features{padding-top:clamp(24px,2.4vw,36px)}
/* phones skip it (Nick, 2026-10-24): the hero goes straight into the feature cards, and the photo (lazy) never loads */
@media (max-width:720px){#functions .fnp-trusted{display:none}#functions .fnp-features{padding-top:44px}}

/* the home view folds away while #functions is open (as pricing.css does for the other views) */
body[data-view="functions"] #home{position:absolute;top:0;left:0;right:0;height:0;overflow:hidden;visibility:hidden}
