/* Shapes while a page loads (the owner's pick B of mock-app-loading: a still tint that breathes; README.md, "Loading
   shapes"). The shapes are written into a page's HTML where its content will go, so they show with the first paint;
   js/loading.js hands over to the content with a short fade. Dark mode is written here (tools/build_dark.py skips this
   file), from the same tokens.

   A box that waits:
     data-sk="replace"  its first fill replaces the shapes inside it (Today's stream, the Desk)
     data-sk="cover"    the shapes lie over the page's own (hidden) markup until the page calls Loading.done (person, position)
     data-sk="fade"     no shapes: its first content fades in (Explore's landing, News, Bills)
   The shapes:  .sk-set  the group (appears only after 150 ms of waiting, so a quick page never flashes grey)
                .sk      one shape, with .sk-ln a line, .sk-hd a headline, .sk-ti a title, .sk-ci a face,
                         .sk-fg a figure, .sk-pl a button; --w width, --h height, --d a face's size */

:root { --sk: #eeebfa; --sk-navy: rgba(255, 255, 255, .13); --sk-curve: cubic-bezier(.2, .8, .2, 1); }
:root[data-theme="dark"] { --sk: rgba(255, 255, 255, .09); }

.sk-set { pointer-events: none; animation: sk-appear 200ms var(--sk-curve) 150ms both; }
@keyframes sk-appear { from { opacity: 0; } to { opacity: 1; } }

.sk { display: block; background: var(--sk); border-radius: 6px; animation: sk-breathe 1.8s ease-in-out infinite alternate; }
@keyframes sk-breathe { from { opacity: 1; } to { opacity: .5; } }
.sk-ln { height: 11px; width: var(--w, 100%); margin: 8px 0; }
.sk-hd { height: 17px; width: var(--w, 100%); margin: 7px 0; border-radius: 8px; }
.sk-ti { height: 28px; width: var(--w, 60%); margin: 2px 0; border-radius: 9px; }
.sk-ci { width: var(--d, 36px); height: var(--d, 36px); border-radius: 50%; flex: none; }
.sk-fg { width: var(--w, 72px); height: var(--h, 32px); border-radius: 10px; flex: none; }
.sk-pl { width: var(--w, 90px); height: var(--h, 36px); border-radius: 999px; flex: none; }
.sk-row { display: flex; align-items: center; gap: 10px; }
.sk-row > .sk-grow { flex: 1; min-width: 0; }
.sk-eb { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--sk); }
.sk-eb .sk { height: 10px; margin: 0; }
.sk-on-navy .sk { background: var(--sk-navy); }
/* a card's frame while it waits (the look's card: white, hairline, 18px) */
.sk-card { box-sizing: border-box; background: #fff; border: 1px solid #e6e2fa; border-radius: 18px; padding: 16px; }
:root[data-theme="dark"] .sk-card { background: #292259; border-color: #3b3478; }

/* the hand-off: the content fades in on the curve, a little later each block down the page; the shapes fade out over it */
.sk-in > * { animation: sk-fade 260ms var(--sk-curve) both; }
.sk-in.is-quick > * { animation-duration: 150ms; animation-delay: 0ms !important; }
.sk-in > :nth-child(2) { animation-delay: 45ms; }
.sk-in > :nth-child(3) { animation-delay: 90ms; }
.sk-in > :nth-child(4) { animation-delay: 135ms; }
.sk-in > :nth-child(n+5) { animation-delay: 180ms; }
@keyframes sk-fade { from { opacity: 0; } to { opacity: 1; } }
.sk-ghost { position: absolute; z-index: 1; margin: 0 !important; animation: sk-out 220ms var(--sk-curve) 60ms both !important; }
@keyframes sk-out { from { opacity: 1; } to { opacity: 0; } }

/* cover: the page's own markup waits unseen under the shapes */
[data-sk="cover"] { position: relative; }
[data-sk="cover"].sk-wait > :not(.sk-set) { opacity: 0; pointer-events: none; }
[data-sk="cover"].sk-wait { min-height: calc(100vh - 56px); }   /* (its own markup may be short until it is filled: the shapes still fill the screen) */
[data-sk="cover"] > .sk-set { position: absolute; inset: 0; z-index: 2; overflow: hidden; }

/* the person and position pages' shapes, in the pages' own grid (css/person.css, css/position.css) */
.sk-page { box-sizing: border-box; width: 100%; max-width: 720px; margin: 0 auto; padding: 12px 16px 64px; display: grid; gap: 16px; align-content: start; }
.sk-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.sk-col > * { min-width: 0; }   /* (a row of shapes fits its column, never wider) */
.sk-col.is-act { display: none; }
.sk-hero { display: flex; align-items: center; gap: 16px; padding: 2px 0; }
.sk-hero .sk-ci { margin: 6px; }
.sk-hero > .sk-grow { flex: 1; min-width: 0; }
.sk-acts { display: flex; gap: 8px; }
.sk-acts > * { flex: 0 1 auto; min-width: 0; }   /* (narrower in a computer's side column) */
.sk-navy { position: relative; box-sizing: border-box; border-radius: 22px; padding: 20px 18px 18px; background: #1a1740; }
.sk-navy::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: linear-gradient(90deg, #0725f9, #4a28ee 25%, #8a2be2 50%, #c3157a 75%, #f70008);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
:root[data-theme="dark"] .sk-navy { background: #1b1846; }
.sk-who { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, .06); margin: 14px 0; }
.sk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.sk-two .sk { height: 52px; border-radius: 12px; }
@media (min-width: 860px) {
  .sk-page { max-width: 1040px; grid-template-columns: 300px minmax(0, 640px); justify-content: center; gap: 40px; padding: 24px 28px 80px; }
  .sk-page .sk-hero { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sk-page .sk-hero .sk-ci { --d: 128px !important; margin: 6px 0 10px 6px; }
  .sk-page .sk-hero > .sk-grow { flex: none; align-self: stretch; }
}
@media (min-width: 1280px) {
  .sk-page { max-width: 1440px; grid-template-columns: 280px minmax(0, 640px) 320px; gap: 32px; padding-top: 20px; }
  .sk-page .sk-hero { flex-direction: row; align-items: center; gap: 14px; }
  .sk-page .sk-hero .sk-ci { --d: 84px !important; margin: 4px; }
  .sk-page .sk-hero > .sk-grow { flex: 1; align-self: auto; }
  .sk-col.is-act { display: grid; }
}

/* reduced motion: the shapes hold still; the fades stay (they are not motion) */
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
