/* ---------- the landing (Nov 2026): the deck's opening over the home page (includes/landing.php, assets/js/landing.js) ----------
   The rules here are the deck's own, ported: the opening (parts/02-intro.html, "who"), its photograph (.vp-photo there, .ld-photo here), the
   landing's arrival (#ld, parts/01-head.html), the buttons' row (home/home.css .home-cta). Selectors are renamed and scoped under #landing;
   the numbers are not changed, so at 16:9 the layer is joshuasortino.com's opening to the pixel. The variables (--d-*, --ease-*, --t-*, the
   colours) come from deck3/assets/landing/tokens.css on <html class="landing-tokens web">; the glass from glass.css.
   Design: docs/superpowers/specs/2026-11-23-landing-home-design.md, sections 2 to 4. */

/* ---------- the layer ---------- */
#landing{position:fixed;inset:0;z-index:5000;overflow:hidden;background:var(--ink);color:#fff;font-family:var(--sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none}
#landing *,#landing *::before,#landing *::after{box-sizing:border-box}
#landing .ld-ground{position:absolute;inset:0;background:var(--ink)}
/* while the layer is up the page under it does not scroll (the site scrolls #page-content, not the window) */
html.landing-lock,html.landing-lock body{overflow:hidden}
html.landing-lock #page-content{overflow:hidden!important}
/* the stage: 1920 x 1080, scaled to the window as the deck's #stage is (landing.js fit sets --sx, --sl, --st on the layer) */
#landing .ld-stage{position:absolute;left:50%;top:50%;width:1920px;height:1080px;transform:translate(-50%,-50%) scale(var(--sx,1));transform-origin:50% 50%}
/* nothing moves while .snap is on: the hold state is put up at once (landing.js hold) */
#landing.snap,#landing.snap *,#landing.snap *::before,#landing.snap *::after{transition:none!important}   /* on the layer itself (a descendant selector here never matched, and the hold state replayed the camera; the review, Nov 23) */

/* ---------- the photograph (.vp-photo in the deck, parts/02-intro.html) ----------
   Full window, in window space. Close on the signature until the pull back: the very same camera move as the signature's (same point, same shift,
   same scale, same clock), from the numbers landing.js place() sets (--zcx/--ztx/--zc/--zt/--zk, in stage px, scaled by --sx). On arrival the
   blurred copy (.ld-blr, the file blurred ahead of time) lies over the sharp picture and fades away on the camera's clock (the focus coming in);
   the blurred copy over the left side (.ld-vlb) is what the old veils left behind at rest */
#landing .ld-photo{position:absolute;inset:0;margin:0;overflow:hidden;background:var(--ink);opacity:0;
  transition:opacity calc(var(--d-6)*1.6*var(--cs,1)) cubic-bezier(.4,0,.6,1);   /* the arrival: a slow, even fade of the blurred picture (#ld .ph.in in the deck) */
  transform-origin:calc(var(--sl,0px) + var(--zcx,452)*var(--sx,1)*1px) calc(var(--st,0px) + var(--zc,387)*var(--sx,1)*1px);
  transform:translate(calc(var(--ztx,508)*var(--sx,1)*1px),calc(var(--zt,153)*var(--sx,1)*1px)) scale(var(--zk,1.785))}
#landing .ld-photo.in{opacity:1}
#landing .ld-photo.out{transform:none;transition:opacity calc(var(--d-5)*var(--cs,1)) var(--ease-out) calc(.05s*var(--k)*var(--cs,1)),transform calc(var(--d-6)*1.25) var(--ease-io)}
/* while it is close in, the photo's left edge melts into the ink, so no edge shows */
#landing .ld-photo::before{content:"";position:absolute;top:0;bottom:0;left:0;width:17%;z-index:1;pointer-events:none;background:linear-gradient(90deg,var(--ink) 0,rgba(20,21,24,.6) 38%,rgba(20,21,24,0) 100%);transition:opacity 0s linear calc(.5s*var(--k)*var(--cs,1))}
#landing .ld-photo.out::before{opacity:0;transition:opacity calc(var(--d-6)*1.25) var(--ease-io)}
/* the fade to ink under the words, from the window's left edge (so a window wider than 16:9 holds the first shade in its margin). A div in the clip (it was .ld-photo::after, Nov 24): it rides the picture through the move, and the band crop has the same fade baked in, so the handoff changes nothing */
#landing .ld-fade{position:absolute;top:0;bottom:0;left:0;width:calc(var(--sl,0px) + 1920px*var(--sx,1));pointer-events:none;background:linear-gradient(90deg,rgba(20,21,24,.8) 0,rgba(20,21,24,.8) var(--sl,0px),rgba(20,21,24,.7) calc(var(--sl,0px) + 1920px*var(--sx,1)*.22),rgba(20,21,24,.45) calc(var(--sl,0px) + 1920px*var(--sx,1)*.42),rgba(20,21,24,.15) calc(var(--sl,0px) + 1920px*var(--sx,1)*.56),rgba(20,21,24,0) calc(var(--sl,0px) + 1920px*var(--sx,1)*.64))}
#landing .ld-photo picture{display:contents}
#landing .ld-photo img{display:block;width:100%;height:100%;max-width:none;object-fit:cover;object-position:100% 30%;-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 1.5%,#000 5%);mask-image:linear-gradient(90deg,transparent 0,transparent 1.5%,#000 5%)}   /* the picture stops short of its frame's left edge, with a soft edge of its own */
#landing .ld-photo .ld-img.b{position:absolute;inset:0;opacity:0}   /* the next photograph of the cross-fade (photos.js) */
#landing .ld-photo .ld-vlb{position:absolute;top:0;left:0;filter:blur(18px);-webkit-mask-image:linear-gradient(90deg,transparent 0,transparent 1.5%,#000 5%,#000 30%,rgba(0,0,0,.7) 50%,transparent 68%);mask-image:linear-gradient(90deg,transparent 0,transparent 1.5%,#000 5%,#000 30%,rgba(0,0,0,.7) 50%,transparent 68%)}
#landing .ld-photo .ld-blr{position:absolute;top:0;left:0;will-change:opacity}
#landing .ld-photo.out .ld-blr{opacity:0;visibility:hidden;transition:opacity calc(var(--d-6)*1.25) var(--ease-focus),visibility 0s linear calc(var(--d-6)*1.25)}   /* the unblur runs the length of the signature's move, on a curve that eases in, so it is still coming into focus as the camera settles and is sharp as it stops */

/* ---------- the opening (s-who in the deck: the signature where the name stood, the two lines, the buttons, the meta line) ---------- */
#landing .who3-copy{position:absolute;left:120px;top:0;bottom:0;width:980px;display:flex;flex-direction:column;justify-content:center;padding-bottom:40px}
#landing .who3-lede{margin:40px 0 0;max-width:880px;font-family:var(--sans);font-size:var(--t-lede);font-weight:400;line-height:1.28;letter-spacing:0;color:#fff}
#landing .who3-sub{margin:28px 0 0;max-width:980px;font-family:var(--sans);font-size:var(--t-sub);font-weight:400;line-height:1.4;letter-spacing:0;color:var(--haze)}
#landing .who3-sub .nw{white-space:nowrap}   /* each sentence keeps to one line, so a line only breaks between sentences */
#landing .who3-lede,#landing .who3-sub,#landing .who3-meta{opacity:0}
/* on arrival the camera is close on the signature (it fills the frame, the photo behind is all blur) and the pen draws it; the pull back takes
   the camera home, the photo comes into focus and the lines fade in. landing.js place() measures where the signature sits and sets --zx/--zy/--zk */
#landing .who3-sig{display:block;width:680px;height:168px;margin-left:-8px;transform-origin:50% 50%;transform:translate(var(--zx,408px),var(--zy,153px)) scale(var(--zk,1.785))}
/* the opening's camera: one clock for everything in the pull back, a quarter longer than a scene move since it is the first thing anyone sees, on the
   in-out curve: it eases off the close-up and settles into the frame */
#landing .ld-stage.on1 .who3-sig{transform:none;transition:transform calc(var(--d-6)*1.25) var(--ease-io)}
/* the words and the buttons ride the camera too: until the step they sit where the zoomed scene puts them (scaled about the signature's centre, given in
   each one's own box as --zo), and they come home with the photo on the same clock, fading in as they do */
#landing .ld-stage :is(.who3-lede,.who3-sub,.who3-meta,.home-cta){transform-origin:var(--zo,50% 50%);transform:translate(var(--zx,0px),var(--zy,0px)) scale(var(--zk,1))}
#landing .ld-stage.on1 :is(.who3-lede,.who3-sub,.who3-meta,.home-cta){transform:none}
/* the words come into focus with the camera: there from its first moment, blurred right out, the blur coming off on the camera's own clock and curve so
   they are sharp as it stops; they fade up in its first third */
#landing .ld-stage :is(.who3-lede,.who3-sub,.who3-meta){filter:blur(var(--wb,44px))}
#landing .ld-stage.on1 :is(.who3-lede,.who3-sub,.who3-meta){opacity:1;filter:blur(0px);transition:opacity calc(var(--d-6)*.45) var(--ease-out) 0s,transform calc(var(--d-6)*1.25) var(--ease-io) 0s,filter calc(var(--d-6)*1.25) var(--ease-io) 0s}
#landing .ld-stage.on1 .home-cta{transition:opacity var(--d-4) var(--ease-out),transform calc(var(--d-6)*1.25) var(--ease-io)}
#landing .ld-stage.on1 .who3-sub{transition-delay:calc(.08s*var(--k)),0s,0s}
#landing .ld-stage.on1 .who3-meta{transition:opacity calc(var(--d-6)*.9) cubic-bezier(.33,0,.2,1) calc(.16s*var(--k)),transform calc(var(--d-6)*1.25) var(--ease-io) 0s,filter calc(var(--d-6)*1.25) var(--ease-io) 0s}   /* Miami & New York and the address fade in on a soft curve of their own (Nov 25, Joshua: "make sure miami and new york/email fade in and dont just pop in"): the lines' quick-out curve did nine tenths of it in the first 30 ms, which read as a pop, at the end of the opening and of the move back */
/* the meta line: the place and the address, as they are written, without the labels' tracking */
#landing .who3-meta{position:absolute;left:120px;bottom:64px;display:flex;gap:44px}
#landing .who3-meta .lbl{font-family:var(--mono);font-size:var(--t-eyebrow,20px);font-weight:400;line-height:normal;letter-spacing:0;text-transform:none;color:var(--fog)}
#landing .who3-meta .lbl:last-child{color:var(--gray)}
#landing .who3-meta a.lbl{border:0;text-decoration:none;cursor:pointer;transition:color var(--d-hover) var(--ease-hover)}
#landing .who3-meta a.lbl:hover{color:#fff}
#landing .who3-meta a.lbl:focus-visible{outline:2px solid #fff;outline-offset:4px}
/* the buttons' row (home/home.css): under the lines, up once the camera has nearly settled (.cta on the layer). Their look is glass.css's */
#landing .home-cta{display:flex;align-items:center;margin-top:56px;opacity:0;pointer-events:none;transition:opacity calc(var(--d-4)*var(--cs,1)) var(--ease-out)}
#landing.cta .home-cta{opacity:1;pointer-events:auto}
/* each button carries its next label and its next arrow, for the move (below): the two labels share one box, the wider sets its width.
   On the way into the page View deck becomes Open deck and Open portfolio becomes Work with me, and back again on the way back (Nov 25) */
#landing .gx .t{display:inline-grid;clip-path:inset(-6px 0)}
#landing .gx .t>span{grid-area:1/1;white-space:nowrap}
#landing .gx .t .l2{opacity:0;transform:translateY(110%)}
#landing .gx .bi{position:relative}
#landing .gx .bi .a2{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);opacity:0}
#landing[data-state="done"]{display:none}   /* the page first (?from=deck, or after the move): the layer waits for the band's View deck (landing.js back) */

/* ---------- the move (landing.js go): View portfolio turns the landing into the page ----------
   Every piece is carried to where it lives on the page (the Web Animations API, from measurements), so the rules here are only the states
   around them: the clip the photograph shrinks in, the veils going, the ground going, the page under the layer before the move */
#landing .ld-clip{position:absolute;inset:0;overflow:hidden}
#landing .ld-clip.moving{-webkit-mask-image:none;mask-image:none}   /* no mask on the move (Nov 24): the band's picture carries its own fade and soft edges, baked in its crop, and the clip shows the very same picture */
#landing.moving{background:transparent}
/* the photo behind the nav and the projects (Joshua, Nov 24: "the photo should feel like it's BEHIND the projects and navbar when it scrolls down
   into place. like basically they come in on top and then it transitions into place WHILE the nav and projects are on top"). A fixed layer is a
   stacking context of its own, so nothing on the page can come between its pieces; for the move (html.landing-under, landing.js under) it is
   laid absolute at the scroll's top instead, with no z-index, and its pieces take their places among the page's: the ground and the photo over
   the band's ground (#intro-background, 25), the projects over the photo (40), the nav over them (3000), and the words, the signature and the
   pills over everything (5000), so the signature still lands in the nav's logo and the words in the band */
html.landing-under #landing{position:absolute;z-index:auto;background:transparent}
html.landing-under #landing .ld-ground{z-index:28}
html.landing-under #landing .ld-photo{z-index:30}
html.landing-under #landing .ld-scrim{z-index:31}
html.landing-under #landing .ld-stage{z-index:5000}
html.landing-under #portfolio{position:relative;z-index:40;background:#141518}   /* the page's ink under the tiles, so no photo shows between them */
#landing.moving .ld-photo{background:transparent}   /* the figure's ink went the whole window and hid the nav and the grid behind it while they moved (Joshua, Nov 24: "they just appear"); the clip keeps its own ink, so the picture's box reads the same */
#landing .ld-clip{background:var(--ink)}
#landing .ld-clip .ld-edge{position:absolute;left:0;right:0;bottom:0;height:72px;background:linear-gradient(to bottom,rgba(20,21,24,0),rgb(20,21,24));pointer-events:none;z-index:4}   /* the reverse (Nov 24): the box's bottom edge, softened into the ink as it grows over the ink (Joshua: "that way I don't see the bottom edge of the photo"); landing.js puts it in and takes it out */
#landing.m .ld-clip.moving{-webkit-mask-image:none;mask-image:none}   /* on a phone the band's photo has no soft edge: the picture carries its own (the phone plan, Nov 23) */
#landing.moving .ld-photo::before{opacity:0;transition:opacity var(--ld-half,.4s) var(--ease-out)}
#landing.moving .ld-stage.on1 .who3-meta{opacity:0;transition:opacity calc(var(--d-3)*var(--cs,1)) var(--ease-out) 0s,transform 0s,filter 0s}   /* written past the on1 rule's weight, which kept it at 1 (Nov 23) */
#landing.moving .home-cta{pointer-events:none}

/* ---------- a phone (or any window taller than it is wide, or narrower than 760px) ----------
   The stage would be a 16:9 strip a few hundred pixels wide, so the opening is a screen of its own, the old portfolio band's composition turned
   for a phone (the phone plan, Nov 23): the phone picture filling the window (him on the left, more photo around him, the right side taken down
   to the ink in the picture itself: _source/landing/phone.py), the signature and the two lines in the empty right, the two buttons across the
   foot, the address under them. No close-up and no pull back: the picture fades in, the pen writes the signature where it sits, then the lines,
   the buttons and the address come up on the deck's phone clock. No cross-fade. The move into the band is the same code (landing.js go) */
#landing.m{--tx:38%}   /* where the words' column starts, as a share of the width */
#landing.m .ld-stage{left:0;top:0;width:auto;height:auto;inset:0;transform:none}
#landing.m .ld-photo{transform:none;transition:opacity calc(var(--d-5)*var(--cs,1)) var(--ease-out) calc(.062s*var(--k)*var(--cs,1))}
#landing.m .ld-photo::before,#landing.m .ld-fade{display:none}
#landing.m .ld-photo img{object-fit:contain;object-position:0 0;-webkit-mask-image:none;mask-image:none}   /* the whole picture from the top left corner, at the window's height: on a wider window (the SE, a tablet held upright) the ink of the picture's right side runs on into the box's own, and he stays clear of the words (the review, Nov 24; it was cover from the top) */
#landing.m .ld-photo .ld-vlb,#landing.m .ld-photo .ld-blr{display:none}
#landing.m .ld-scrim{position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,rgba(20,21,24,.92) 0,rgba(20,21,24,.75) 20%,rgba(20,21,24,0) 42%)}   /* the foot only: the picture carries the right side */
#landing:not(.m) .ld-scrim{display:none}
#landing.m .who3-copy{left:0;right:0;top:0;bottom:0;width:auto;justify-content:flex-start;padding:17vh 22px calc(max(34px,env(safe-area-inset-bottom)) + 40px)}   /* the words at his head's height; the room under the buttons is the address's */
#landing.m .who3-sig{width:min(calc(100% - var(--tx)),260px);height:auto;margin:0 0 14px var(--tx);transform:none;transition:none}   /* at the column's left, about the column's width, no wider than 260 on a tablet (the review, Nov 24) */
#landing.m .ld-stage :is(.who3-lede,.who3-sub,.who3-meta,.home-cta){transform:none;filter:none;transition:opacity calc(var(--d-4)*var(--cs,1)) var(--ease-out)}   /* no !important here: it outranked the move's own animations, and the signature and the lines never travelled on a phone (the review, Nov 24) */
#landing.m .who3-lede{margin:0 0 0 var(--tx);max-width:none;font-size:21px;line-height:1.25;letter-spacing:-.01em}
#landing.m .who3-sub{margin:10px 0 16px var(--tx);max-width:none;font-size:15px;line-height:1.4;color:var(--fog)}   /* 16px: the least room between the sub and the buttons on a short window */
#landing.m .who3-sub .nw{white-space:normal}
#landing.m.lines .who3-lede,#landing.m.lines .who3-sub{opacity:1}
#landing.m .home-cta{margin:auto 0 0;flex-direction:column;align-items:stretch;gap:12px}   /* in the column's flow, pushed to the foot: on a short window (a landscape phone, Safari with its bars up) they follow the sub instead of covering it (the review, Nov 24) */
#landing.m.cta .home-cta{opacity:1;pointer-events:auto}
#landing.m .who3-meta{position:absolute;left:0;right:0;bottom:max(22px,env(safe-area-inset-bottom));justify-content:center;gap:0;margin:0;padding:0}   /* the address under the buttons, centred, as the deck's phone opening has it */
#landing.m .who3-meta .lbl:first-child{display:none}
#landing.m .who3-meta .lbl{font-size:12px;line-height:1}
#landing.m.meta .who3-meta{opacity:1}
#landing.m .ld-stage .who3-meta{transition:opacity calc(var(--d-6)*.9) cubic-bezier(.33,0,.2,1)}   /* the same soft fade on a phone (Nov 25) */
@media (max-height:700px){ #landing.m .who3-copy{padding-top:13vh} #landing.m .who3-lede{font-size:20px} }   /* the SE: the sub must clear the buttons (landing-band.less carries the same 20px, so the lines keep their breaks in the band) */
@media (max-height:520px){ #landing.m .who3-copy{padding:5vh 22px 28px} #landing.m .who3-sig{width:min(calc(100% - var(--tx)),200px);margin-bottom:8px} #landing.m .who3-lede{font-size:19px} #landing.m .who3-sub{font-size:14px;margin:6px 0 10px var(--tx)} #landing.m .who3-meta{display:none} html.btn-glass2 #landing.m .home-cta{gap:8px} html.btn-glass2 #landing.m .home-cta .gx{height:44px;font-size:16px} html.btn-glass2 #landing.m .home-cta .gx .bi{width:30px;height:30px} }   /* a phone on its side: everything a size down, no address */
/* the pills at the phone's size (glass.css has these for the deck's #home-m) */
html.btn-glass2 #landing.m .home-cta{gap:14px}
html.btn-glass2 #landing.m .home-cta .gx{display:flex;width:100%;height:60px;padding:0 10px 0 26px;font-size:19px;justify-content:space-between}
html.btn-glass2 #landing.m .home-cta .gx .bi{width:38px;height:38px}
html.btn-glass2 #landing.m .home-cta .gx.s{justify-content:center;gap:8px;padding:0 22px}
html.btn-glass2 #landing.m .home-cta .gx.s .bi{width:auto;height:auto}
/* a tablet held upright (Nov 24, Joshua: "tablet is very broken"): the phone composition with the phone's sizes left the words small in a
   wide column and the two buttons stretched right across the foot. Here the words are a size up in a column a little further right, and the
   buttons sit side by side under them at their own width. landing-band.less has the band's matching tier */
@media (min-width:600px) and (min-height:600px){   /* the iPad mini upright is 744 wide: from 600 (the largest phones are under 450) */
#landing.m{--tx:42%}
#landing.m .who3-copy{padding-top:22vh}
#landing.m .who3-sig{width:min(calc(100% - var(--tx)),340px);margin-bottom:18px}
#landing.m .who3-lede{font-size:clamp(26px,3.66vw,32px);line-height:1.25}   /* 30 at 820 wide; the second line keeps to one line down to the iPad mini */
#landing.m .who3-sub{font-size:clamp(17px,2.32vw,20px);margin:14px 0 0 var(--tx)}
#landing.m .home-cta{margin:30px 0 0 var(--tx);flex-direction:row;align-items:center}
html.btn-glass2 #landing.m .home-cta{gap:16px}
html.btn-glass2 #landing.m .home-cta .gx{display:inline-flex;width:auto;height:54px;padding:0 10px 0 24px;gap:14px;font-size:18px;justify-content:flex-start}
html.btn-glass2 #landing.m .home-cta .gx .bi{width:34px;height:34px}
html.btn-glass2 #landing.m .home-cta .gx.s{padding:0 22px;gap:8px;justify-content:center}
}

/* the deck, ready behind the landing (landing.js warmUp, Nov 25): a frame over everything, unseen and taking no clicks until View deck's move
   ends and shows it (.on). It loads once the hold has settled, on a computer only */
html body iframe#ld-deck{position:fixed;inset:0;width:100%;height:100%;max-width:none;margin:0;padding:0;border:0;display:block;z-index:2147483600;opacity:0;pointer-events:none;background:transparent}
html body iframe#ld-deck.on{opacity:1;pointer-events:auto}
