/* The computer section's picture (site/calls3d.js, from site-src/calls3d: pair.js and link.js): a laptop showing the
   code that pairs it with a phone, the code off its glass, and a phone that scans it and is linked with it a step at
   a time (Matt, 2026-11-28: "use a floating QR code and a physical 3d phone with a camera that shows the view it's
   pointed at that scans the QR code on the laptop and shows the linking process in a break out view").

   It stands on the stage calls3d.css writes (.c3, .c3-stage, .c3-screen, .c3-pane, .c3-lift, .c3-ghost, .c3-lines,
   .c3-tag), and this is only what is its own:

     .c3-screen[data-screen='desk']    the computer's screen: a page 1100 across
     .c3-screen[data-screen='phone']   the phone's: 412 across
     .c3-page[data-page]               one page of a screen; the script turns one on at a time (.is-on)
     .p3-bit                           a piece of a page, which comes with its page (.is-in) and goes with it
     .p3-wiz, .p3-app                  the computer's pages: the wizard's steps, and the app with its conversations
     .p3-ph                            a page of the phone's "Pair a computer"
     .p3-scan                          the phone's camera: what it sees is the script's, on the glass under the page

   Every page is the app's own, with the app's numbers: lib/desktop/ui/wizard.dart and lib/ui/computers.dart for the
   steps, test/shots/mac-2-code, mac-3-digits, mac-4-conversations and 10-pair-* for how they lie. */

/* The section is a night card with its picture behind everything, as the calls section is (site/index.html has
   `.desk`); the picture's box is all of the card, under the words, and it is drawn in two decks (calls3d.css): the
   laptop and its page, then the phone and its page. */
.p3-stage { height: 37rem; }
@media (max-width: 900px) { .p3-stage { height: 31rem; } }
@media (max-width: 520px) { .p3-stage { height: 25rem; } }

/* --- the two screens ------------------------------------------------------------------------------------------------- */
.gm.c3-screen[data-screen='desk'] { --gm-vw: 1100; --p3-s8: calc(clamp(32px, 29.9008px + 0.6576 * var(--v), 40px) * 1.1); }
.c3-screen[data-screen='desk'] .c3-paper, .c3-screen[data-screen='desk'] .c3-pane { border-radius: 9px; }
.c3-screen[data-screen='phone'] .c3-paper, .c3-screen[data-screen='phone'] .c3-pane { border-radius: var(--p3-round, 38px); }
.c3-screen[data-screen='phone'] .c3-paper { transition: opacity .3s ease; }

/* A page: one of a screen's is on at a time. Its pieces come a moment after it and go with it, each by itself (in
   3D nothing between the screen and a piece may fade, or the pieces would be pressed flat). */
.c3-page { position: absolute; inset: 0; box-sizing: border-box; visibility: hidden; transition: visibility 0s linear .34s; }
.c3-page.is-on { visibility: visible; transition-delay: 0s; }
.p3-bit { opacity: 0; translate: 0 7px; }
.p3-bit.is-in { opacity: 1; translate: 0 0; }
.c3-live .p3-bit { transition: opacity .3s ease, translate .34s var(--ease), scale .12s ease, filter .5s ease, box-shadow .4s ease; }
.c3-live .c3-page, .c3-live .p3-wiz__col, .c3-live .p3-wiz__body, .c3-live .p3-wiz__foot, .c3-live .p3-qrbox, .c3-live .p3-app__list, .c3-live .p3-app__rows, .c3-live .p3-app__main, .c3-live .p3-app__thread, .c3-live .p3-chat__thread, .c3-live .p3-swap { transform-style: preserve-3d; overflow: visible; }
/* With no script the first page of each is the picture. */
.c3:not(.c3-live) .c3-page.is-on .p3-bit { opacity: 1; translate: none; }

/* --- the pieces the pages share: a wide button, the six digits, a spinner (computers.dart PairButton, PairingCode) --- */
.p3-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: var(--s2) var(--s4); box-sizing: border-box; border-radius: var(--r-lg); background: var(--ink); color: var(--paper); font-size: var(--fs-md); font-weight: 600; line-height: 1.5; text-align: center; }
.p3-btn .gm-i { width: 18px; height: 18px; flex: none; --gm-wash: 0; }
.p3-btn--quiet { background: transparent; color: var(--ink); border: 1px solid var(--ink-4); }
/* Pressed: it gives a little, and a ring leaves the place it was touched. */
.p3-btn.is-pressed { scale: .97; }
.p3-btn--quiet.is-pressed { background: var(--paper-3); }
.p3-btn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; border: 2px solid var(--c3-gold); opacity: 0; pointer-events: none; }
.p3-btn.is-pressed::after { animation: p3-tap .5s ease-out both; }
@keyframes p3-tap { from { opacity: .95; scale: .35; } to { opacity: 0; scale: 1.7; } }
.p3-digits { padding: var(--s5) 0; border-radius: var(--r-lg); background: var(--paper-2); color: var(--ink); text-align: center; white-space: pre; font: 700 41.6px/1.2 var(--u-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); letter-spacing: 2px; font-variant-numeric: tabular-nums; }
/* The same on both: each is ringed in the picture's light. */
.p3-digits.is-same { box-shadow: 0 0 0 1.5px var(--c3-gold), 0 0 26px color-mix(in srgb, var(--c3-gold) 45%, transparent); }
.p3-spin { display: block; flex: none; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ink-4); border-top-color: var(--ink); animation: p3-spin .9s linear infinite; }
.p3-spin--lg { width: 22px; height: 22px; margin-top: 2px; border-width: 2.5px; }
@keyframes p3-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .p3-spin, .p3-btn.is-pressed::after { animation: none; } }

/* --- the computer: the wizard's steps (wizard.dart: a column 560 wide in the window's middle, its buttons at its foot) */
.p3-wiz { display: flex; align-items: center; justify-content: center; }
.p3-wiz__col { flex: none; width: 560px; max-width: 100%; display: flex; flex-direction: column; }
.p3-wiz__body { display: flex; flex-direction: column; gap: var(--s4); padding: var(--p3-s8) var(--s6) var(--s4); }
.p3-wiz__foot { display: flex; flex-direction: column; gap: var(--s3); padding: 0 var(--s6) var(--s6); }
.p3-say h3 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.p3-say p { margin: var(--s2) 0 0; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); }
.p3-qrbox { display: flex; justify-content: center; }
/* The code: black on white whatever the theme, 260 across, its corners 14 round (lib/desktop/ui/qr.dart). */
.p3-qr { flex: none; width: 260px; height: 260px; border-radius: 14px; overflow: hidden; background: #fff; }
.p3-qr svg { display: block; width: 100%; height: 100%; }
.c3-live .p3-qr.is-up { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9)) drop-shadow(0 26px 34px rgba(0, 0, 0, .55)); }
/* Read: it is ringed for a moment. */
.p3-qr.is-read { box-shadow: 0 0 0 3px var(--c3-gold), 0 0 38px color-mix(in srgb, var(--c3-gold) 70%, transparent); }
.p3-wait { display: flex; align-items: center; justify-content: center; gap: var(--s2); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }

/* --- the computer, paired: the app (test/shots/mac-4-conversations): the list, and the conversation beside it ------- */
.p3-app { display: flex; }
.p3-app__list { flex: none; width: 380px; position: relative; display: flex; flex-direction: column; box-sizing: border-box; border-right: 1px solid var(--rule); padding-top: 4px; }
.p3-app__row { display: flex; align-items: center; gap: 10px; margin: 0 var(--s2); }
.p3-app__row + .p3-app__row { margin-top: 10px; }
.p3-app__row > .gm-search, .p3-app__row > .gm-seg { flex: 1; min-width: 0; }
.p3-app__rows { display: flex; flex-direction: column; margin-top: 14px; }
.p3-app__dock { position: absolute; left: 0; right: 0; bottom: 16px; width: max-content; margin: 0 auto; }
.p3-app__main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; --msg-max: 465px; }
.gm-head.p3-app__head { flex: none; background: transparent; padding: 0 10px 0 12px; }
.p3-app__thread { flex: 1; min-height: 0; justify-content: flex-end; }
.p3-app__msg { display: flex; flex-direction: column; }

/* --- the phone: "Pair a computer" (computers.dart PairComputerScreen), under the status bar and the page's title ---- */
.p3-status { position: absolute; left: 0; right: 0; top: 0; z-index: 3; height: 44px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; padding: 8px 26px 0; font-size: 13px; font-weight: 600; color: var(--ink); transition: color .3s ease; }
.p3-hole { position: absolute; z-index: 4; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.gm-head.p3-bar { position: absolute; left: 0; right: 0; top: 44px; z-index: 3; background: transparent; padding: 0 6px 0 4px; transition: opacity .3s ease; }
.p3-bar .gm-head__title { margin-left: 0; }
.p3-ph { display: flex; flex-direction: column; gap: var(--s4); padding: calc(104px + var(--s2)) var(--s4) 0; }
/* A step's heading: an icon, what is happening, a sentence under it (computers.dart _Lead). */
.p3-lead { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s2); }
.p3-lead > .gm-i { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--ink); }
.p3-lead b { display: block; font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; color: var(--ink); }
.p3-lead p { margin: var(--s1) 0 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
/* How the two connect from then on (computers.dart ConnectionChoice): a card of three, one chosen. */
.p3-sec { display: flex; flex-direction: column; gap: var(--s2); }
.p3-sec .gm-set__row > .gm-i { flex: none; color: var(--ink); }
.p3-pick { flex: none; position: relative; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ink-3); }
.p3-pick.is-on { border: 0; background: var(--ink); }
.p3-pick.is-on::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--paper); }
/* "They match", and what is said in its place once it is pressed: the two lie in one place. */
.p3-swap { position: relative; }
.p3-lead--then { position: absolute; inset: 0; align-items: center; padding-top: 0; padding-bottom: 0; }
.p3-lead--then .p3-spin { margin-top: 0; }

/* Paired, the phone is at the conversation the computer has open (the app's own conversation screen, as the hero
   has it: site-src/hero3d/views/thread.html): its header, the thread, where a message is written. */
.p3-chat { display: flex; flex-direction: column; padding-top: 44px; }
.gm-head.p3-chat__head { flex: none; background: transparent; }
.p3-chat__thread { flex: 1; min-height: 0; justify-content: flex-end; }
.gm-composer.p3-chat__composer { flex: none; margin: 0 var(--s2) 16px; }
.c3-screen.is-bare .p3-bar { opacity: 0; }

/* The camera (android ScanActivity.kt): its picture fills the screen (the script draws it on the glass, under this
   page, which is clear), and one line of words lies over it near the foot. */
.p3-scan { padding: 0; }
.p3-scan__hint { position: absolute; left: 0; right: 0; bottom: 61px; padding: 12px 18px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; line-height: 1.35; text-align: center; }
.c3-screen.is-seeing .c3-paper { opacity: 0; }
.c3-screen.is-seeing .p3-status { color: #fff; }
/* With no WebGL there is no picture from the camera: its screen is black. */
.c3-flat .c3-screen.is-seeing .c3-paper { opacity: 1; background: #000; }

/* --- the lines over them: the light from the phone's lens to the code, the line between the two, the digits' ------ */
.c3-lines .p3-cone { fill: color-mix(in srgb, var(--c3-gold) 7%, transparent); stroke: none; }
.c3-lines .p3-ray { stroke: color-mix(in srgb, var(--c3-gold) 75%, transparent); stroke-width: 1; stroke-dasharray: 2 6; }
.c3-lines .p3-lock { stroke: var(--c3-hot); stroke-width: 2.2; filter: drop-shadow(0 0 4px var(--c3-gold)); }
.c3-lines .p3-link { stroke: color-mix(in srgb, var(--c3-gold) 85%, transparent); stroke-width: 1.4; stroke-dasharray: 3 9; }
.c3-lines .p3-link--sealed { stroke: var(--c3-hot); stroke-dasharray: none; filter: drop-shadow(0 0 4px var(--c3-gold)) drop-shadow(0 0 10px color-mix(in srgb, var(--c3-gold) 60%, transparent)); }
.c3-lines .p3-same { stroke: var(--c3-gold); stroke-width: 1.4; stroke-dasharray: 1 5; }
.c3-tag .p3-ti { width: .95rem; height: .95rem; --gm-wash: 0; }

/* --- before the two are drawn, and with no script: the computer's page lying flat in the picture's frame ------------ */
.p3:not(.c3-live) .c3-cam { justify-content: flex-start; padding: 0 0 0 max(1.5rem, calc((100vw - 76rem) / 2)); }
.p3:not(.c3-live) .c3-screen[data-screen='desk'] { flex: none; display: block; visibility: visible; position: relative; width: 1100px; height: 724px; margin: 0 -300px; transform: scale(.44); border-radius: 9px; box-shadow: 0 0 0 12px #060607, 0 0 0 13.5px rgba(255, 255, 255, .5), 0 40px 80px -20px rgba(0, 0, 0, .7); }
.p3:not(.c3-live) .c3-screen[data-screen='phone'] { display: none; }
@media (max-width: 900px) { .p3:not(.c3-live) .c3-cam { align-items: flex-start; justify-content: center; padding: 6rem 0 0; } }
@media (max-width: 520px) { .p3:not(.c3-live) .c3-screen[data-screen='desk'] { margin: -220px -400px; transform: scale(.28); } }
