/* Option 13. The camera invitation belongs to the uncovered portrait: it stands
   under the face once the red is gone, never over it, leaves the page free to
   scroll and the mask free to use, and goes away with the portrait.

   The pinned opening is the travel that opens the red plus a rest in which the
   portrait stands still (intro.js reads --opening-rest). The travel values are
   the ones continuity.css and mobile-rhythm.css used as the whole height. */
.js .opening-sequence{--curtain-travel:580px;--opening-rest:clamp(200px,28svh,360px);height:calc(100svh + var(--curtain-travel) + var(--opening-rest));min-height:0}
@media(max-width:760px){.js .opening-sequence{--curtain-travel:clamp(260px,38svh,350px);--opening-rest:clamp(120px,20svh,180px)}}
@media(min-width:761px) and (max-width:980px) and (orientation:portrait){.js .opening-sequence{--curtain-travel:380px;--opening-rest:220px}}
@media(prefers-reduced-motion:reduce){.js .opening-sequence{--curtain-travel:200px}}

/* Under the red the two round buttons are invisible and out of the pointer's
   reach (the red lets clicks through); the keyboard still finds them. */
.hero[data-unveiled="false"] .hero-copy{pointer-events:none}

/* The painted face, as a box: what a sweep must cross, where the camera's
   picture is laid, and what the invitation keeps clear of. The painted face
   holds the same place in the portrait at every size; on a phone the box was
   still the one of an older crop (style.css: 36 % / 29 %, 28 % × 29 %), which
   ends at the nose and leaves out the cheeks, the mouth and the chin, so a
   thumb swiping across the lower face was outside it and the invitation stood
   on the mouth at 320 × 568 (round 2, 3 October 2026). */
@media(max-width:760px){.mask-target{left:33%;top:30%;width:34%;height:36%}}

/* A card inside the opening scene, not a modal over the page. app.js places it
   (left, top) between the chin and whatever comes below: under the face, or
   beside it where a short window has no room. No overscroll-behavior here: with
   'contain' Chrome kept a wheel or a thumb that starts on the card from moving
   the page, even though the card does not scroll (round 2, 2 October 2026).
   Its bottom stands at least --invitation-floor above the window's bottom edge
   (3 October 2026: "it has no padding to the bottom, it should show a little
   higher"; it stood 24 px above it on a laptop and on the edge of a phone). */
#camera-dialog{--invitation-floor:max(48px,7svh);position:absolute;inset:auto;left:50%;top:auto;bottom:var(--invitation-floor);margin:0;z-index:8;width:min(410px,calc(100% - 36px));max-height:calc(100svh - 48px);padding:30px 28px 22px;background:#14100df2;box-shadow:0 8px 30px #000a;overflow:auto}
#camera-dialog:not([data-placed]){transform:translateX(-50%)}
#camera-dialog[open]{animation:invitation-in .34s cubic-bezier(.2,.7,.2,1)}
@keyframes invitation-in{from{opacity:0;translate:0 12px}}
#camera-dialog h2{font-size:34px;margin:0 0 14px;padding-right:26px}
#camera-dialog #gesture-instruction{font-size:16px;line-height:1.5;margin:0 0 12px}
#camera-dialog #camera-note{margin:0 0 22px}
/* What the camera is doing is said on the line of the note, in its place, above
   the buttons: the card keeps its size while the camera starts. */
#camera-dialog .interaction-status,#camera-dialog .interaction-status:not(:empty){margin:0 0 22px;max-width:none;min-height:0}
#camera-dialog .interaction-status:empty{display:none}
#camera-dialog[data-status] #camera-note{display:none}
#camera-dialog .mode-controls{gap:10px}
#camera-dialog .camera-button{min-height:44px}
#camera-dialog .text-button{min-height:36px}
/* While it stands there it replaces the two round buttons and the hint, and the
   opening lies above the first chapter (which otherwise overlaps its last strip). */
.opening-sequence[data-invitation="open"]{z-index:2}
.opening-sequence[data-invitation="open"] .hero-copy,.opening-sequence[data-invitation="open"] .gesture-hint{visibility:hidden;pointer-events:none}
/* A phone held upright: the card spans the window between 16 px margins and
   stands on the floor above the bottom edge, under the chin (until round 1 of
   3 October 2026 it was a sheet lying on the edge itself); app.js only chooses
   its fit. It is opaque, rises from below and sinks back the moment the
   portrait moves, so the first chapter's words that come up behind it never
   show through it. */
@media(max-width:760px) and (min-height:561px){
 #camera-dialog{--invitation-layout:phone;left:16px;right:16px;bottom:var(--invitation-floor);width:auto;max-height:calc(100svh - 24px - var(--invitation-floor));padding:26px 24px 16px;background:#14100d;box-shadow:0 10px 30px #000a}
 #camera-dialog:not([data-placed]){transform:none}
 #camera-dialog[open]{animation:invitation-rise .3s cubic-bezier(.2,.7,.2,1)}
 #camera-dialog.is-leaving{translate:0 calc(100% + var(--invitation-floor) + 12px);transition:translate .18s cubic-bezier(.5,0,.9,.5)}
 /* The development selector (source only) would stand on the card's corner. */
 body:has(#camera-dialog[open]) .dev-switcher{visibility:hidden}
}
@keyframes invitation-rise{from{translate:0 calc(100% + var(--invitation-floor) + 12px)}}
/* A short window (a phone on its side): a narrower, tighter card beside the
   face, between the top and the floor (48 px): 260 px of card in a 390 px
   window. */
@media(max-height:560px){
 #camera-dialog{width:min(280px,calc(100% - 36px));padding:16px 22px 12px}
 #camera-dialog h2{font-size:26px;margin-bottom:7px}
 #camera-dialog #gesture-instruction{font-size:16px;line-height:1.45;margin-bottom:7px}
 #camera-dialog #camera-note,#camera-dialog .interaction-status,#camera-dialog .interaction-status:not(:empty){margin-bottom:9px}
 #camera-dialog .mode-controls{gap:8px}
 #camera-dialog .camera-button{min-height:40px}
 #camera-dialog .text-button{min-height:32px}
}
/* The same tighter card (data-fit="compact", set by app.js) wherever the full
   one finds no room under or beside the face that keeps the painted eyes and
   mouth clear: placeInvitation() tries the full card, then this one, at the
   width it gives it (round 2, 3 October 2026: at 800 × 800, 1024 × 768 and
   320 × 568 the card stood on the face). */
#camera-dialog:is([data-fit="compact"],[data-fit="tight"]){padding:16px 22px 12px}
#camera-dialog:is([data-fit="compact"],[data-fit="tight"]) h2{font-size:26px;margin-bottom:7px}
#camera-dialog:is([data-fit="compact"],[data-fit="tight"]) #gesture-instruction{font-size:16px;line-height:1.45;margin-bottom:7px}
#camera-dialog:is([data-fit="compact"],[data-fit="tight"]) :is(#camera-note,.interaction-status,.interaction-status:not(:empty)){margin-bottom:9px}
#camera-dialog:is([data-fit="compact"],[data-fit="tight"]) .mode-controls{gap:8px}
@media not all and (pointer:coarse){
 #camera-dialog:is([data-fit="compact"],[data-fit="tight"]) .camera-button{min-height:40px}
 #camera-dialog:is([data-fit="compact"],[data-fit="tight"]) .text-button{min-height:32px}
}
/* Less air and a heading that keeps to one line (data-fit="tight"): beside
   the face where the room is narrow and the window short (245 px wide at
   667 × 375, where the compact card would reach under the floor). */
#camera-dialog[data-fit="tight"]{padding:12px 18px 10px}
#camera-dialog[data-fit="tight"] h2{font-size:24px;margin-bottom:5px}
#camera-dialog[data-fit="tight"] #gesture-instruction{margin-bottom:5px}
#camera-dialog[data-fit="tight"] :is(#camera-note,.interaction-status:not(:empty)){margin-bottom:7px}
#camera-dialog[data-fit="tight"] .mode-controls{gap:6px}
/* The smallest phones (320 × 568): the face reaches down to 54 % of the
   window, so the card must stay under 235 px to stand on the floor below the
   lips. Closer to the edges and a little smaller, its instruction keeps to two
   lines: 224 px of card. */
@media(max-width:340px) and (min-height:561px){
 #camera-dialog,#camera-dialog[data-fit="compact"]{left:8px;right:8px;padding:14px 16px 12px}
 #camera-dialog h2,#camera-dialog[data-fit="compact"] h2{font-size:24px;margin-bottom:6px}
 #camera-dialog #gesture-instruction,#camera-dialog[data-fit="compact"] #gesture-instruction{font-size:15px;line-height:1.45;margin-bottom:6px}
 #camera-dialog #camera-note,#camera-dialog .interaction-status:not(:empty),#camera-dialog[data-fit="compact"] #camera-note,#camera-dialog[data-fit="compact"] .interaction-status:not(:empty){margin-bottom:8px}
 #camera-dialog .mode-controls,#camera-dialog[data-fit="compact"] .mode-controls{gap:6px}
}
/* On a touch screen the text button is a 44 px target drawn as before: it reaches above and below its
   line by as much as it grows (phase B, S2). */
@media(pointer:coarse){
 #camera-dialog .text-button{min-height:44px;margin-block:-4px}
}
/* On a touch screen in a short window (a phone on its side) the card's words are read at 16 px (T3). */
@media(max-height:560px) and (pointer:coarse){
 #camera-dialog #camera-note,#camera-dialog .interaction-status{font-size:16px}
 #camera-dialog .camera-button,#camera-dialog .text-button{font-size:16px}
 #camera-dialog .camera-button{min-height:44px}
 #camera-dialog .text-button{min-height:44px;margin-block:-6px}
}
@media(prefers-reduced-motion:reduce){#camera-dialog[open]{animation:none}}

/* Only the camera button under the portrait (round 6, 4 October 2026, his note: "we just need the camera icon,
   we don't need a restart button"). The change button stays for the keyboard: it shows only while it has
   keyboard focus. */
#change-button:not(:focus-visible){position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
