/* Tracium website: the person cards, /ahsan/, /madiha/, /ben/, /arno/ and /robin/. One page a person, shown on a phone
   at an event: the code to scan on one face, the contact on the other. The page stands on the site's own parts: the
   tokens and the bundle for colour, space and the button, site.css for the page frame, the top bar and the type,
   states.css for the hovers, and demo.css with site.js for the form and its dialog, which send through /api/demo like
   the demo request.

   The picture: the charcoal stage with the dot grid (Tracium.DotGrid's step and colour), a glass folder in the middle,
   and the card, a sheet that rises out of the folder. The folder is Robin's glass folder model (poses and springs as
   measured from his reference); its neutral glass and its sheets are the model's own and the only colours here that
   are not tokens. card.js draws the grid and moves the folder and the card.
   Classes without a rule here (ec-main, ec-filedc, ec-share, ec-mail, ec-addr, ec-hint, ec-done-mail, ec-filed-name,
   ec-filed-co, ec-filed-mail) are card.js's handles on the page. */

/* ------------------------------------------------------------ the stage: one screen, nothing scrolls */
.ec { position: relative; height: 100vh; height: 100dvh; min-height: 540px; overflow: hidden; overflow: clip; background: var(--tr-color-ground); color: var(--tr-color-text); -webkit-user-select: none; user-select: none; }
/* A phone on its side is as high as it is: the card turns wide instead (below). */
@media (orientation: landscape) and (max-height: 539px) { .ec { min-height: 0; } }
.ec-grid, .ec-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.ec-grid { z-index: 0; }
.ec-fx { z-index: 7; }
/* The bundle's glow (.tr-glow) behind the scene. */
.ec-glow { position: absolute; z-index: 1; width: 720px; height: 720px; margin: -360px 0 0 -360px; opacity: 0; }

/* The top bar on the 40 line, as on every page, kept 20 high: the logo on the line, the turn button centred on the
   logo, on the content's right edge, where the menu's toggle sits on the other pages. */
.ec .wrap { position: absolute; inset: 0 0 auto; z-index: 8; pointer-events: none; }
.ec .topbar { height: 20px; }
.ec .topbar > * { pointer-events: auto; }
.ec-turn { flex: none; }
/* During the opening the card cannot turn yet: the button stays in reach of the keyboard and says so. */
.ec-turn[aria-disabled="true"] { opacity: 0.4; cursor: default; }

/* ------------------------------------------------------------ the folder, in the model's reference px times --k */
/* Hidden until card.js has laid it out and set it for the opening. */
.ec-folder { position: absolute; z-index: 2; width: calc(var(--k) * 481); height: calc(var(--k) * 406); perspective: calc(var(--k) * 1740); perspective-origin: 50% 25.1%; transform-origin: 50% 50%; visibility: hidden; }
.ec-back { position: absolute; inset: 0; z-index: 0; border-radius: calc(var(--k) * 36); background: var(--tr-color-ground); box-shadow: inset 0 0 calc(var(--k) * 6) calc(var(--k) * 5.5) rgba(255, 255, 255, 0.25); }
.ec-sheet { position: absolute; z-index: 1; left: 0; top: 0; width: calc(var(--k) * 244); height: calc(var(--k) * 320); border-radius: calc(var(--k) * 20); background: #f1f1f1; color: #d3d3d3; box-shadow: inset calc(var(--k) * 8) calc(var(--k) * 8) calc(var(--k) * 8) rgba(255, 255, 255, 0.78), 0 0 calc(var(--k) * 3) rgba(0, 0, 0, 0.16); }
.ec-sheet svg, .ec-paper svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ec-front { position: absolute; z-index: 5; left: 0; bottom: 0; width: calc(var(--k) * 481); height: calc(var(--k) * 363); transform-origin: 50% 100%; transform: rotateX(-13.1deg); pointer-events: none; }
.ec-glass { position: absolute; inset: 0; clip-path: url(#ec-front-clip); background: rgba(36, 36, 36, 0.27); -webkit-backdrop-filter: blur(calc(var(--k) * 5.5)); backdrop-filter: blur(calc(var(--k) * 5.5)); }
/* Without a blur the glass would show the sheets sharp through it: a denser glass instead (not from the model). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .ec-glass { background: rgba(28, 28, 28, 0.82); } }
.ec-edge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ec-edge path { fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ------------------------------------------------------------ the card: a sheet that travels, and turns */
.ec-carrier { position: absolute; left: 0; top: 0; z-index: 3; transform-origin: 50% 50%; perspective: 1600px; visibility: hidden; will-change: transform; }
.ec-card { position: absolute; inset: 0; transform-style: preserve-3d; touch-action: pan-y; cursor: pointer; }
.ec-filedc .ec-card { cursor: default; }
/* Each face is paper on the charcoal stage, as the bundle draws paper there (.tr-written: the paper, the stage's
   depth); the page on it is paper. The face is its own container, so site.css sets the type at its narrow sizes at
   every width, and a short screen can set it closer (below). */
.ec-face { position: absolute; inset: 0; container-type: size; overflow: hidden; border-radius: var(--tr-radius-md); background: var(--tr-keyart-paper); box-shadow: var(--tr-depth-object); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.ec-face.is-back { transform: rotateY(180deg); }
.ec-in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--tr-space-32); }
/* On its way out of the folder the face still looks like the folder's sheets; the paper fades as it comes forward. */
.ec-paper { position: absolute; inset: 0; z-index: 2; background: #f1f1f1; color: #d3d3d3; pointer-events: none; }

/* The person, the same on both faces, so the turn keeps them in place: the photo at the author's size on a phone
   (site.css .by-ph), 16, the name, 4, the role. */
.ec-ph { width: 64px; height: 64px; }
.ec-name { margin-top: var(--tr-space-16); }
.ec-role { margin-top: 4px; }

/* The code: the site's own QR for this page, as large as the face allows, on the content's left edge and its foot;
   the 32 px of paper around it is its quiet zone. */
.ec-code { flex: 1 1 0; min-height: 0; margin-top: var(--tr-space-24); }
.ec-qr { display: block; width: 100%; height: 100%; }
.ec-qr rect { fill: var(--tr-color-text); }
.ec-qr.is-held rect { opacity: 0; }

/* The contact: one row a way to reach the person, on a hairline, 12 above and below as the contents of an article
   (site.css .toc ol a): what it is in title size, what a tap does beneath. A row is one link: its title takes the
   accent (states.css). */
.ec-rows { margin-top: var(--tr-space-32); border-bottom: var(--tr-stroke-hairline) solid var(--tr-color-hairline); }
.ec-r { display: block; padding: 12px 0; border-top: var(--tr-stroke-hairline) solid var(--tr-color-hairline); color: inherit; text-decoration: none; }
.ec-r:focus-visible { outline: 2px solid var(--tr-color-accent); outline-offset: 2px; }
.ec-r > span, .ec-say > span { display: block; }
.ec-r .t-ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--hv); }
a.ec-r:hover .t-ttl { color: var(--tr-color-accent); }
.ec-r .t-sm { margin-top: 4px; }
/* The answer to a tap, as the form's errors carry theirs: the tick, then the words. */
.ec-r .ec-said { display: flex; align-items: flex-start; gap: 10px; }
.ec-r [hidden], .ec-cta > [hidden] { display: none; }
.ec-said .tr-tick, .ec-done .tr-tick { flex: none; margin-top: 3px; }
.ec-cta { margin-top: auto; padding-top: var(--tr-space-32); }
.ec-done { display: flex; align-items: flex-start; gap: 10px; }

/* A short screen, a phone browser with its bars: the same order, set closer. */
@container (max-height: 537px) {
  .ec-in { padding: var(--tr-space-24) var(--tr-space-24) var(--tr-space-16); }
  .ec-ph { width: 48px; height: 48px; }
  .ec-name { margin-top: var(--tr-space-8); }
  .ec-rows { margin-top: var(--tr-space-16); }
  .ec-r { padding: 8px 0; }
  .ec-cta { padding-top: var(--tr-space-16); }
}

/* A wide card, a phone on its side: the person and the button on the left, the code or the contact on the right. */
@container (orientation: landscape) {
  .ec-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; column-gap: var(--tr-space-24); }
  .ec-in > * { grid-column: 1; }
  .ec-ph { grid-row: 1; }
  .ec-name { grid-row: 2; }
  .ec-role { grid-row: 3; }
  .ec-cta { grid-row: 5; }
  .ec-in > .ec-code, .ec-in > .ec-rows { grid-column: 2; grid-row: 1 / -1; margin-top: 0; }
  .ec-in > .ec-rows { align-self: start; }
}

/* The visitor's own details, as the sheet that is filed into the folder. */
.ec-filed .ec-rows { margin-top: var(--tr-space-24); }

/* ------------------------------------------------------------ the form: the site's own dialog and box (demo.css), its
   form side alone, at every width as the narrow box sets it: the head with the kicker and Close, the headline 8 under
   it and 32 over the form */
.ec-dlg .dm-box { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.ec-dlg .dm-main { grid-column: 1; grid-row: 1 / 3; }
.ec-dlg .dm-head { justify-content: space-between; }
.ec-dlg .ec-ask { margin-top: 8px; margin-bottom: 32px; }
.ec-dlg .dm-box.is-sent .ec-ask { display: none; }
.ec-dlg .dm-done { margin: 16px 0 24px; padding-bottom: 0; }
.ec-dlg .ec-legal { margin-top: auto; padding-top: var(--tr-space-32); }
