/* Lisa v2 (lisa-v2) — additions on top of lisa3.css. Same tokens, same family:
   the summary grid, the decision card, the two-halves insight, and the visible
   placeholders for numbers that are still to come. */

/* Summary: four cards, two by two */
body.l3 .l4-brief{ grid-template-columns:repeat(2,minmax(0,1fr)); }

/* Story map: eight parts, four across on wide screens */
body.l3 .l4-chapters{ grid-template-columns:repeat(4,minmax(0,1fr)); }
body.l3 .l4-chapters .l3-chapcard{ grid-template-columns:minmax(0,1fr); align-content:start; padding:20px 48px 22px 20px; }
body.l3 .l4-chapters .l3-chapcard__n{ grid-row:auto; padding:0 0 10px; font:var(--t-b3b); text-transform:uppercase; letter-spacing:var(--ls-caps); }
body.l3 .l4-chapters .l3-chapcard .icon{ top:22px; margin-top:0; }

/* Decision card: could have / chose / cost */
body.l3 .wrap > .l4-card{ max-width:var(--l3-read); }
.l4-card{ border:1px solid var(--l3-accent-line); border-radius:var(--l3-r); background:var(--l3-accent-soft); padding:8px 24px; }
.l4-card__rows{ margin:0; display:grid; }
.l4-card__rows > div{ display:grid; grid-template-columns:112px minmax(0,1fr); gap:16px; padding:16px 0; border-top:1px solid var(--l3-line); }
.l4-card__rows > div:first-child{ border-top:0; }
.l4-card__rows dt{ font:var(--t-b3b); letter-spacing:var(--ls-caps); text-transform:uppercase; color:var(--l3-accent); padding-top:3px; }
.l4-card__rows dd{ margin:0; font:var(--t-b2); color:#fff; }
.l4-card__rows > div:nth-child(2) dd{ font:var(--t-b1a); }

/* The two halves: the hinge between the problem and the decisions */
body.l3 .wrap > .l4-insight{ max-width:var(--l3-read); }
.l4-insight{ border-radius:var(--l3-r); background:var(--l3-card); padding:28px; }
.l4-insight .subkicker{ margin:0 0 12px; }
.l4-insight__t{ font:var(--t-b1a); color:#fff; margin:0 !important; }
.l4-insight__list{ list-style:none; margin:24px 0 0; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.l4-insight__list a{ display:block; padding:14px 16px; border:1px solid var(--l3-line); border-radius:var(--l3-r-sm); color:#fff; text-decoration:none; font:var(--t-b2); transition:border-color .2s, background .2s; }
.l4-insight__list a:hover, .l4-insight__list a:focus-visible{ border-color:var(--l3-accent-line); background:var(--l3-accent-soft); }
.l4-insight__list b{ display:block; font:var(--t-b3b); letter-spacing:var(--ls-caps); text-transform:uppercase; color:var(--l3-accent); margin-bottom:4px; }

/* Three decisions sit in one row, so none is left alone */
.l4-insight__list--3{ grid-template-columns:repeat(3,minmax(0,1fr)); }

/* Four-stop timeline (the rollout) */
body.l3 .timeline__row.l4-row4{ grid-template-columns:repeat(4,1fr); }
body.l3 .timeline__row.l4-row4::before{ width:calc(75% + .75 * var(--tl-gap)); }

/* Quotes sit apart from the paragraphs around them */
body.l3 .wrap > figure.qfig{ margin-block:36px; }

/* Results: four columns */
body.l3 .l4-results{ grid-template-columns:repeat(4,minmax(0,1fr)); }

/* A number still to come. Deliberately visible: this is a draft. */
.l4-slot{ display:inline-block; padding:2px 10px; border:1px dashed var(--l3-accent-line); border-radius:8px; color:var(--l3-accent); font:var(--t-b3); font-style:normal; }
.l4-slot::before{ content:"[ "; } .l4-slot::after{ content:" ]"; }

@media (max-width:1023px){
  body.l3 .l4-chapters{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.l3 .l4-results{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px){
  /* the shared scorecard spans its last cell for a five-up row; four is an even 2 x 2 */
  body.l3 .l4-results .score:last-child{ grid-column:auto; }
  body.l3 .l4-results .score:nth-child(odd){ border-left:0; }
  body.l3 .l4-results .score:nth-child(even){ border-left:1px solid var(--l3-line); }
  body.l3 .timeline__row.l4-row4{ grid-template-columns:1fr; }
  body.l3 .timeline__row.l4-row4::before{ width:1px; }
}
@media (max-width:640px){
  body.l3 .l4-brief, .l4-insight__list{ grid-template-columns:1fr; }
  .l4-card{ padding:4px 18px; }
  .l4-card__rows > div{ grid-template-columns:1fr; gap:6px; }
}

/* ================================================================ figures, v2
   The plate is the hero. The card around it is a quiet hairline frame, the
   label is a small mono caption, and Zoom is a compact icon. Plates are
   recomposed (scripts/v2_images.py) so every screen sits centred with even
   margins. */
body.l3 .l3-shot,
body.l3 .frame.frame--has-image,
body.l3 .dgram{
  padding:6px; border-radius:24px;
  background:rgb(255 255 255 / .04); border:1px solid rgb(255 255 255 / .07);
  transition:border-color .3s, background .3s;
}
body.l3 .l3-shot:hover, body.l3 .frame.frame--has-image:hover, body.l3 .dgram:hover{
  border-color:rgb(255 255 255 / .16); background:rgb(255 255 255 / .055);
}
body.l3 .dgram__bar{ padding:4px 4px 10px 12px; min-height:42px; }
body.l3 .dgram__tag{
  padding:0; font:var(--t-b3c); font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--l3-muted);
}
body.l3 .dgram__btn{
  height:32px; padding:0 12px; gap:6px; border-radius:16px; font:var(--t-b3); font-size:13px;
  background:rgb(255 255 255 / .07); box-shadow:none; color:#fff;
  transition:background .2s;
}
body.l3 .dgram__btn:hover{ background:rgb(255 255 255 / .14); transform:none; box-shadow:none; }
body.l3 .dgram__btn:active{ transform:scale(.96); }
body.l3 .dgram__btn .icon{ width:14px; height:14px; }
/* Zoom is a glyph, not a word: the whole card already opens the viewer. */
body.l3 .dgram__btn[data-dgram-expand],
body.l3 .dgram__btn[aria-label="Zoom into the image"]{ width:32px; padding:0; justify-content:center; gap:0; }
body.l3 .dgram__btn[data-dgram-expand] span,
body.l3 .dgram__btn[aria-label="Zoom into the image"] span{ display:none; }
body.l3 .l3-shot .artifact-link, body.l3 .frame .artifact-link, body.l3 .dgram__scroll{ border-radius:18px; }
body.l3 .l3-shot .artifact-link img, body.l3 .frame .artifact-link img{ transition:transform .7s cubic-bezier(.2,.7,.2,1); }
@media (hover:hover){
  body.l3 .is-card:hover .artifact-link img{ transform:scale(1.012); }
}
body.l3 figure.bleed > .figc, body.l3 .l3-fig > .figc{ max-width:var(--l3-read); color:var(--l3-soft); }
@media (max-width:640px){
  body.l3 .l3-shot, body.l3 .frame.frame--has-image, body.l3 .dgram{ padding:4px; border-radius:20px; }
  body.l3 .l3-shot .artifact-link, body.l3 .frame .artifact-link, body.l3 .dgram__scroll{ border-radius:16px; }
  body.l3 .dgram__bar{ padding:2px 2px 8px 10px; min-height:38px; }
  body.l3 .dgram__btn span{ display:none; }
  body.l3 .dgram__btn{ width:32px; padding:0; justify-content:center; }
}

/* ================================================================ viewer, v2
   One image at a time, fitted whole; a bottom bar with previous, the label and
   caption, and next; click the image for full size, drag to move. */
.v2lb{
  position:fixed; inset:0; z-index:1000; display:grid; grid-template-rows:auto minmax(0,1fr) auto;
  background:rgb(7 7 9 / .9); -webkit-backdrop-filter:blur(18px) saturate(120%); backdrop-filter:blur(18px) saturate(120%);
  padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);
  opacity:0; transition:opacity .22s ease;
}
.v2lb[hidden]{ display:none !important; }
.v2lb.is-open{ opacity:1; }
.v2lb__top{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px clamp(16px,3vw,28px); }
.v2lb__count{ font:var(--t-b3c); font-size:12px; letter-spacing:.08em; color:var(--l3-muted); font-variant-numeric:tabular-nums; }
.v2lb__btn{
  display:inline-grid; place-items:center; width:44px; height:44px; border-radius:50%; border:0; cursor:pointer;
  background:rgb(255 255 255 / .08); color:#fff; transition:background .2s, opacity .2s, transform .2s;
}
.v2lb__btn:hover{ background:rgb(255 255 255 / .16); }
.v2lb__btn:active{ transform:scale(.94); }
.v2lb__btn:disabled{ opacity:.25; cursor:default; }
.v2lb__btn:focus-visible{ outline:2px solid var(--l3-accent); outline-offset:3px; }
.v2lb__btn .icon{ width:20px; height:20px; }
.v2lb__stage{ position:relative; min-height:0; overflow:hidden; display:grid; place-items:center; padding:0 clamp(16px,4vw,56px); touch-action:pan-y; }
.v2lb__frame{
  position:relative; border-radius:16px; overflow:hidden; background:var(--l3-canvas);
  box-shadow:0 0 0 1px rgb(255 255 255 / .08), 0 50px 120px -30px rgb(0 0 0 / .85);
  transition:opacity .25s ease, transform .35s cubic-bezier(.2,.7,.2,1); cursor:zoom-in;
}
.v2lb__frame.is-dark{ background:#0b0b0d; }
.v2lb__frame.is-loading{ opacity:0; transform:scale(.985); }
.v2lb__frame > img, .v2lb__frame > svg{ display:block; width:100%; height:100%; }
.v2lb__frame.is-static{ cursor:default; }
/* Full size: the stage scrolls, the frame sits at native pixels. */
.v2lb__stage.is-zoomed{ display:block; overflow:auto; cursor:grab; overscroll-behavior:contain; padding:0 clamp(16px,4vw,56px) 24px; }
.v2lb__stage.is-zoomed .v2lb__frame{ margin:0 auto; cursor:zoom-out; }
.v2lb__stage.is-dragging{ cursor:grabbing; user-select:none; }
/* A tall page reads as a page: fitted to width, scrolled down. */
.v2lb__stage.is-tall{ display:block; overflow:auto; overscroll-behavior:contain; padding-bottom:24px; }
.v2lb__stage.is-tall .v2lb__frame{ margin:0 auto; cursor:default; }
.v2lb__bar{
  display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; gap:clamp(12px,3vw,32px);
  padding:16px clamp(16px,3vw,28px) 20px;
}
.v2lb__cap{ text-align:center; min-width:0; max-width:680px; justify-self:center; }
.v2lb__label{ margin:0 0 6px !important; font:var(--t-b3c); font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--l3-accent); }
.v2lb__text{ margin:0 !important; font:var(--t-b3); color:rgb(255 255 255 / .78); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
@media (max-width:640px){
  .v2lb__top{ padding:12px 12px 8px; }
  .v2lb__stage{ padding:0 12px; }
  .v2lb__bar{ grid-template-columns:40px minmax(0,1fr) 40px; gap:10px; padding:12px 12px 16px; }
  .v2lb__btn{ width:40px; height:40px; }
  .v2lb__text{ -webkit-line-clamp:2; font-size:13px; }
}
@media (prefers-reduced-motion:reduce){ .v2lb, .v2lb__frame{ transition:none; } }

/* The annotated Setup page is a tall single screen: cap its width so the
   labels read at body size instead of shrinking with a full-width plate. */
body.l3 figure.bleed:has(img[src*="setup-anatomy"]){ max-width:calc(940px + 2 * var(--pad)); }

/* ------------------------------------------------------------------------
   Pinned version sequence (Auto Attendant v2, V1 to V8)
   Without JS the versions stay a stacked list (aa1.css). With JS (.is-on) the
   rail, the picture and its note pin under the top bar, and scrolling the
   page steps through the versions: nobody scrolls past having seen only V1.
   ------------------------------------------------------------------------ */
.vx__foot{ display:none; }
.vx.is-on{ position:relative; height:var(--vx-total, 600vh); margin-top:clamp(20px,3vw,32px); }
.vx.is-on .vx__pin{ position:sticky; top:var(--vx-top, 80px); height:var(--vx-h, 80vh);
  display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:clamp(12px,2vh,20px); padding-block:clamp(8px,2vh,20px); }
.vx.is-on .aa-vtrack{ margin:0; }
.vx.is-on .aa-vstage{ position:relative; min-height:0; }
.vx.is-on .aa-vpanel{ display:none; margin:0; height:100%; }
.vx.is-on .aa-vpanel.is-active{ display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,340px); gap:clamp(20px,3vw,40px);
  align-items:center; animation:vx-in .4s var(--ease, ease); }
.vx.is-on .aa-vpanel .l3-shot{ min-height:0; max-height:100%; display:flex; flex-direction:column; justify-self:end; width:fit-content; max-width:100%; }
.vx.is-on .aa-vpanel .l3-shot a{ min-height:0; display:block; }
.vx.is-on .aa-vpanel .l3-shot img{ display:block; width:auto; height:auto; max-width:100%; max-height:var(--vx-img, 60vh); }
.vx.is-on .aa-vnote{ display:flex; flex-direction:column; gap:14px; margin:0; }
.vx.is-on .aa-vnote h4{ font:var(--t-h3); }
.vx.is-on .vx__foot{ display:flex; align-items:center; gap:16px; font:var(--t-b3a); color:var(--l3-muted); }
.vx__hint{ display:flex; align-items:center; gap:8px; margin:0; }
.vx__hint .icon{ width:18px; height:18px; color:var(--l3-accent); animation:vx-nudge 1.6s var(--ease, ease) infinite; }
.vx__pos{ margin:0 0 0 auto; font-variant-numeric:tabular-nums; }
.vx__pos b{ color:#fff; font-weight:inherit; }
.vx__skip{ color:var(--l3-soft) !important; text-decoration:underline; text-underline-offset:3px; }
.vx.is-done .vx__hint{ visibility:hidden; }
@keyframes vx-in{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
@keyframes vx-nudge{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(3px); } }
@media (prefers-reduced-motion: reduce){
  .vx.is-on .aa-vpanel.is-active, .vx__hint .icon{ animation:none; }
}
/* Phones and narrow tablets: rail of numbers, picture, then the lesson only. */
@media (max-width: 900px){
  .vx.is-on .aa-vpanel.is-active{ grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) auto; align-items:start; gap:12px; }
  .vx.is-on .aa-vpanel .l3-shot{ justify-self:center; }
  .vx.is-on .aa-vnote{ gap:8px; }
  .vx.is-on .aa-vnote h4{ font:var(--t-h4, var(--t-h3)); }
  .vx.is-on .aa-vnote > p:not(.aa-vlearn){ display:none; }
  .vx.is-on .aa-vtabs{ grid-template-columns:repeat(8,1fr); min-width:0; }
  .vx.is-on .aa-vtab{ font-size:0; gap:0; }
  .vx.is-on .aa-vtab span{ font:var(--t-b3c); }
}
/* html and body both clip x with overflow:hidden, which makes body its own
   (never-scrolling) scroll container and stops position:sticky. clip doesn't. */
html:has(.vx.is-on), html:has(.vx.is-on) body{ overflow-x:clip; overflow-y:visible; }

/* Fitted plates (scripts/v2_plates.py): each plate is cut to its screens with the
   same padding on every side, so its shape varies. Cap the height so a two-phone
   plate doesn't run a screen and a half tall, and let the frame carry the plate's
   lavender so a narrower plate still fills it edge to edge. */
body.l3 .artifact-link:has(img[src*="/v2src/new/"]:not([src*="anatomy"])),
body.l3 .artifact-link:has(img[src*="/img/v2/lisa/"]),
body.l3 .artifact-link:has(img[src*="/img/v2/lisa3/"]){ background:#eff0fe; }
body.l3 .artifact-link img[src*="/v2src/new/"]:not([src*="anatomy"]),
body.l3 .artifact-link img[src*="/img/v2/lisa/"],
body.l3 .artifact-link img[src*="/img/v2/lisa3/"]{ width:auto; max-width:100%; max-height:min(80vh, 900px); margin-inline:auto; }

/* Version rail: left-aligned, so the first dot and label sit on the same left
   edge as the figure and the page grid instead of centred in the first column. */
.aa-vers .aa-vtab{ align-items:flex-start; text-align:left; padding-inline:0 4px; }
.aa-vers .aa-vtabs::before{ left:10px; right:calc(100% / 8 - 10px); }
.aa-vers .aa-vtabs::after{ left:10px; }

/* Desktop: the pinned scene stops above the fixed pravar.design / sound row,
   with a hairline between them, as the Experience and Horizon hero folds do. */
.vx.is-on .vx__pin{ border-bottom:1px solid var(--l3-line); }
