/* ==========================================================================
   Kisaka external audit page
   Built on the IT consultancy page: css/kisaka-advisory.css and
   css/kisaka-it.css give the hero, the numbered list, the text and drawing
   rows, the sticky index with its features and the closing panel, so the
   type, buttons, panels and spacing match it. This file adds only what the
   IT page has no part for (the promo and resource cards, the bullets) and
   ventriloc.ca/en/data-agents' motion on top: the typed breadcrumb, title
   lines sliding up, the underlined red word, rules drawing in, panels
   opening from the bottom and the turning index square.
   Motion lives in js/kisaka-audit.js; the drawings come from
   scripts/make_audit_diagrams.py.
   ========================================================================== */

.kisaka-audit-page
   {
      --au-step: 140ms;
      --au-rise: 900ms;
      --au-ease-out: cubic-bezier(0.075, 0.82, 0.165, 1);
      --au-ease-lines: cubic-bezier(0.55, 0.21, 0.07, 0.87);
      --au-ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
      --au-ease-rule: cubic-bezier(0.23, 1, 0.32, 1);
      --au-ease-scale: cubic-bezier(0.215, 0.61, 0.355, 1);
   }


/* ===== Keyframes ===== */

@keyframes au-fade
   {
      0%
         {
            opacity: 0;
         }
   }

@keyframes au-rise
   {
      0%
         {
            translate: 0 var(--au-ty, 40px);
         }
   }

@keyframes au-slide-line
   {
      0%
         {
            translate: 0 2em;
         }
   }

@keyframes au-rule
   {
      0%
         {
            scale: 0 1;
         }
   }

@keyframes au-open
   {
      0%
         {
            clip-path: inset(99.9999% 0 0 0 round var(--au-radius, 20px));
         }

      100%
         {
            clip-path: inset(0 0 0 0 round var(--au-radius, 20px));
         }
   }

@keyframes au-settle
   {
      0%
         {
            scale: 1.15;
         }
   }

@keyframes au-type
   {
      0%
         {
            opacity: 0;
            color: var(--adv-red);
         }

      1%
         {
            opacity: 1;
            color: var(--adv-red);
         }
   }

@keyframes au-sweep
   {
      0%
         {
            translate: -100% 0;
         }

      50%, 100%
         {
            translate: 560% 0;
         }
   }


/* The red word's underline lives in kisaka-advisory.css (.adv-mark);
   this file only times it to the hero entrance below. */


/* ===== Text the IT page has no rule for ===== */

/* The IT page sets each report's text on one <p>; here a report can have
   two, so they take the container's type (shared p rules elsewhere would
   set a light grey). */
.kisaka-audit .it-feature__text
   {
      line-height: 24px;
   }

.kisaka-audit .it-feature__text p
   {
      font: inherit;
      line-height: 24px;
      color: inherit;
   }

.kisaka-audit .it-feature__text p + p
   {
      margin-top: 10px;
   }

.kisaka-audit :is(.it-feature__text, .it-media__text) strong
   {
      font-weight: 600;
      color: var(--adv-ink);
   }

.kisaka-audit .it-list__name
   {
      margin: 0;
      font: inherit;
   }

.kisaka-adv .au-bullets
   {
      display: grid;
      gap: 10px;
      margin-top: 14px;
      padding-left: 20px;
   }

.kisaka-adv .au-bullets li
   {
      display: list-item;
      list-style: disc outside;
      font-family: "Newsreader", Georgia, "Times New Roman", serif;
      font-optical-sizing: auto;
      font-size-adjust: 0.5;
      font-size: 16px;
      color: var(--adv-body);
   }

.kisaka-adv .au-bullets li::marker
   {
      color: var(--adv-red);
   }

/* Back-to-back text and drawing rows sit closer, as one pair. */
.au-row + .au-row--tight
   {
      padding-top: 0;
   }

/* Text links in the features and cards: red, with the underline drawing in
   from the left. 44px tall for touch. */
.kisaka-adv .au-link
   {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 44px;
      margin-top: 6px;
      color: var(--adv-red);
      font-size: 15px;
      font-weight: 500;
      text-decoration: none;
      background-image: linear-gradient(currentColor, currentColor);
      background-repeat: no-repeat;
      background-position: 100% calc(100% - 10px);
      background-size: 0 1px;
      transition: background-size 500ms var(--au-ease-scale);
   }

.kisaka-adv .au-link:is(:hover, :focus-visible)
   {
      background-position: 0 calc(100% - 10px);
      background-size: 100% 1px;
   }

.kisaka-adv .au-link:focus-visible
   {
      outline: 2px solid var(--adv-red);
      outline-offset: 4px;
      border-radius: 2px;
   }

/* The index square turns into place as on Ventriloc. */
.kisaka-audit .it-toc a::before
   {
      rotate: -270deg;
      transition: transform 300ms var(--adv-ease), rotate 300ms linear;
   }

.kisaka-audit .it-toc a.is-active::before
   {
      rotate: 0deg;
      transition: transform 450ms var(--au-ease-scale), rotate 950ms var(--au-ease-expo);
   }


/* ===== Promo and resource cards, in the IT page's panels and type ===== */

.au-promo__grid
   {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 20px;
   }

.au-promo__grid--three
   {
      grid-template-columns: repeat(3, minmax(0, 1fr));
   }

.au-promo + .au-promo
   {
      padding-top: 0;
   }

.au-promo__item
   {
      --au-radius: 20px;
      display: flex;
      flex-direction: column;
      border-radius: 20px;
      background: var(--it-panel);
      overflow: clip;
   }

.au-promo__item--full
   {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
   }

.au-promo__content
   {
      display: flex;
      flex-direction: column;
      gap: 14px;
      padding: clamp(28px, 3.4vw, 48px);
   }

.au-promo__item--full .au-promo__content
   {
      justify-content: center;
   }

.au-promo__content .au-link
   {
      margin-top: auto;
      align-self: flex-start;
   }

.kisaka-adv .au-promo__title
   {
      font-size: clamp(22px, 2vw, 28px);
      font-weight: 400;
      line-height: 1.18;
      letter-spacing: -0.02em;
      color: var(--adv-ink);
      text-wrap: balance;
   }

.kisaka-adv .au-promo__text
   {
      max-width: 560px;
      font-family: "Newsreader", Georgia, "Times New Roman", serif;
      font-optical-sizing: auto;
      font-size-adjust: 0.5;
      font-size: 17px;
      color: var(--adv-body);
   }

.au-promo__media
   {
      --au-radius: 20px;
      position: relative;
      margin: 0;
      display: grid;
      place-items: center;
      padding: 56px 24px 24px;
      border-radius: 20px;
      background: var(--it-deep);
      overflow: clip;
   }

.au-promo__screen
   {
      width: 100%;
      max-width: 520px;
   }

.au-promo__screen .au-diagram
   {
      display: block;
      width: 100%;
      height: auto;
   }

.au-promo__header
   {
      margin-bottom: clamp(32px, 4vw, 48px);
   }

.kisaka-adv .au-resource__link
   {
      display: flex;
      flex-direction: column;
      gap: 12px;
      height: 100%;
      padding: clamp(24px, 2.6vw, 36px);
      color: var(--adv-ink);
      text-decoration: none;
   }

.kisaka-adv .au-resource__label
   {
      font-size: 13px;
      font-weight: 500;
      line-height: 1.4;
      color: var(--adv-red);
   }

.kisaka-adv .au-resource__title
   {
      font-size: clamp(20px, 1.7vw, 24px);
      font-weight: 400;
      line-height: 1.2;
      letter-spacing: -0.02em;
      color: var(--adv-ink);
   }

.kisaka-adv .au-resource__meta
   {
      margin-top: auto;
      padding-top: 16px;
      font-size: 14px;
      color: var(--adv-muted);
      transition: color 150ms linear;
   }

.kisaka-adv .au-resource__link:is(:hover, :focus-visible) .au-resource__meta
   {
      color: var(--adv-red);
   }

.kisaka-adv .au-resource__link:focus-visible
   {
      outline: 2px solid var(--adv-red);
      outline-offset: -4px;
      border-radius: 20px;
   }

.kisaka-adv .au-disclaimer
   {
      max-width: 680px;
      margin-top: 40px;
      font-size: 14px;
      color: var(--adv-muted);
   }


/* ==========================================================================
   Motion, only when js/kisaka-audit.js has set .au-motion (motion allowed
   and an observer to drive it). Each [data-au] block gets .is-inview when it
   comes on screen and loses it once fully gone, so every entrance plays on
   every visit: rising from below, dropping from above. An observed block is
   never clipped while it waits, because Chrome counts an element's own
   clip-path and a block clipped shut would never register as on screen.
   ========================================================================== */

.au-motion [data-au][data-au-from="above"]
   {
      --au-ty: -40px;
   }

/* rise and fade: Ventriloc's basic move */
.au-motion [data-au]:not(.is-inview) :is(.it-hero__lead, .adv-actions, .it-list__lead, .it-list__n, .it-list__name, .it-list__text, .it-media__title, .it-media__text, .adv-lead, .it-toc li, .it-feature__title, .it-feature__text, .au-link, .au-promo__content > *, .au-resource__link > *, .it-cta__label, .it-cta__title, .it-cta__text),
.au-motion .au-disclaimer[data-au]:not(.is-inview)
   {
      opacity: 0;
   }

.au-motion [data-au].is-inview :is(.it-hero__lead, .adv-actions, .it-list__lead, .it-list__n, .it-list__name, .it-list__text, .it-media__title, .it-media__text, .adv-lead, .it-toc li, .it-feature__title, .it-feature__text, .au-link, .au-promo__content > *, .au-resource__link > *, .it-cta__label, .it-cta__title, .it-cta__text),
.au-motion .au-disclaimer[data-au].is-inview
   {
      animation: au-rise var(--au-rise) var(--au-ease-out) var(--d, 0ms) backwards, au-fade 250ms linear var(--d, 0ms) backwards;
   }

/* titles: words slide up out of their masks, line by line */
.au-motion [data-au-lines] .au-line-word
   {
      display: inline-flex;
      overflow: clip;
      overflow-clip-margin: 0.12em;
      padding-bottom: 0.06em;
      margin-bottom: -0.06em;
      vertical-align: top;
   }

.au-motion [data-au-lines] .au-line-word__in
   {
      display: inline-block;
   }

.au-motion [data-au]:not(.is-inview) [data-au-lines] .au-line-word__in
   {
      opacity: 0;
   }

.au-motion [data-au].is-inview [data-au-lines] .au-line-word__in
   {
      animation: au-slide-line 1.2s var(--au-ease-lines) calc(var(--line-index, 0) * var(--au-step) + var(--lines-delay, 0ms)) backwards, au-fade 250ms linear calc(var(--line-index, 0) * var(--au-step) + var(--lines-delay, 0ms)) backwards;
   }

[data-au]
   {
      --after-lines: calc((var(--line-total, 1) + 1) * var(--au-step) + var(--lines-delay, 0ms));
   }

/* Hero: the breadcrumb types at 50ms a character, the title follows, then
   the lead and buttons; the red word underlines and its glint sweeps by. */
.au-hero
   {
      --lines-delay: 280ms;
   }

.au-motion .au-hero .au-char
   {
      opacity: 0;
   }

.au-motion .au-hero.is-inview .au-char
   {
      opacity: 1;
      animation: au-type 300ms linear calc(var(--char-index) * 50ms) backwards;
   }

.au-hero .it-hero__lead
   {
      --d: calc(var(--after-lines) + var(--au-step));
   }

.au-hero .adv-actions
   {
      --d: calc(var(--after-lines) + var(--au-step) * 2);
   }

.au-motion .au-hero:not(.is-inview) .adv-mark__line::before
   {
      scale: 0 1;
   }

.au-motion .au-hero.is-inview .adv-mark__line::before
   {
      animation: au-rule 1.3s var(--au-ease-expo) calc(var(--after-lines) + 500ms) backwards;
   }

.au-motion .au-hero.is-inview .adv-mark__line::after
   {
      animation: au-sweep 4s var(--au-ease-expo) calc(var(--after-lines) + 800ms) infinite;
   }

.au-motion .au-hero:not(.is-inview) .it-hero__media
   {
      opacity: 0;
   }

.au-motion .au-hero.is-inview .it-hero__media
   {
      --au-radius: 0px;
      animation: au-open 1.2s var(--au-ease-expo) var(--au-step) backwards;
   }

.au-motion .au-hero.is-inview .it-hero__screen
   {
      animation: au-settle 1.2s var(--au-ease-scale) var(--au-step) backwards;
   }

/* Steps: each rule draws from the left, rows 140ms apart. */
.au-steps .it-list__lead
   {
      --d: var(--after-lines);
   }

.au-steps .it-list__rows li
   {
      position: relative;
      --row-d: calc(var(--after-lines) + var(--au-step) + var(--index) * var(--au-step));
   }

.au-steps .it-list__n
   {
      --d: calc(var(--row-d) + var(--au-step));
   }

.au-steps .it-list__name,
.au-steps .it-list__text
   {
      --d: calc(var(--row-d) + var(--au-step) * 2);
   }

.au-motion .au-steps .it-list__rows li
   {
      border-bottom-color: transparent;
   }

.au-motion .au-steps .it-list__rows li::after
   {
      content: "";
      position: absolute;
      left: 0;
      bottom: -1px;
      width: 100%;
      height: 1px;
      background: var(--adv-line-strong);
      transform-origin: left;
   }

.au-motion .au-steps:not(.is-inview) .it-list__rows li::after
   {
      scale: 0 1;
   }

.au-motion .au-steps.is-inview .it-list__rows li::after
   {
      animation: au-rule 1.2s var(--au-ease-rule) var(--row-d) backwards;
   }

/* Text and drawing rows: the panel fades in, the copy follows. */
.au-motion .it-media__panel[data-au]:not(.is-inview)
   {
      opacity: 0;
   }

.au-motion .it-media__panel[data-au].is-inview
   {
      animation: au-fade 250ms linear backwards;
   }

.au-motion .it-media__panel[data-au].is-inview .it-media__screen
   {
      animation: au-rise 1.2s var(--au-ease-out) backwards;
   }

.au-row .it-media__title
   {
      --d: var(--au-step);
   }

.au-row .it-media__text
   {
      --d: calc(var(--au-step) * 2);
   }

/* Reports: the index steps in 50ms apart; each report's title, text and
   link rise and its drawing panel opens from the bottom. */
.au-reports .adv-lead
   {
      --d: var(--after-lines);
   }

.au-reports .it-toc li
   {
      --d: calc(var(--after-lines) + var(--au-step) + var(--index) * 50ms);
   }

.au-reports .it-feature__text
   {
      --d: var(--au-step);
   }

.au-reports .it-feature .au-link
   {
      --d: calc(var(--au-step) * 2);
   }

.au-motion .it-feature[data-au]:not(.is-inview) .it-feature__media
   {
      opacity: 0;
   }

.au-motion .it-feature[data-au].is-inview .it-feature__media
   {
      animation: au-open 1.2s var(--au-ease-expo) calc(var(--au-step) * 2) backwards;
   }

.au-motion .it-feature[data-au].is-inview .it-feature__screen
   {
      animation: au-settle 1.2s var(--au-ease-scale) calc(var(--au-step) * 2) backwards;
      transform-origin: top;
   }

/* Cards open from the bottom; inside, the copy drops in from above, last
   line first. */
.au-promo__item
   {
      --card-d: calc(var(--index, 0) * var(--au-step));
   }

.au-motion .au-promo__item[data-au]:not(.is-inview)
   {
      opacity: 0;
   }

.au-motion .au-promo__item[data-au].is-inview
   {
      animation: au-open 1.2s var(--au-ease-expo) var(--card-d) backwards;
   }

.au-motion .au-promo__item[data-au].is-inview .au-promo__screen
   {
      animation: au-settle 1.2s var(--au-ease-scale) calc(var(--card-d) + var(--au-step)) backwards;
   }

.au-promo__item :is(.au-promo__content, .au-resource__link) > *
   {
      --au-ty: -40px;
   }

.au-promo__item :is(.au-promo__content, .au-resource__link) > :nth-child(1)
   {
      --d: calc(var(--card-d) + var(--au-step) * 4);
   }

.au-promo__item :is(.au-promo__content, .au-resource__link) > :nth-child(2)
   {
      --d: calc(var(--card-d) + var(--au-step) * 3);
   }

.au-promo__item :is(.au-promo__content, .au-resource__link) > :nth-child(3)
   {
      --d: calc(var(--card-d) + var(--au-step) * 2);
   }

.au-promo__header .adv-lead
   {
      --d: var(--after-lines);
   }

/* Closing panel: opens like the cards, then its copy rises. */
.au-motion .au-cta[data-au]:not(.is-inview)
   {
      opacity: 0;
   }

.au-motion .au-cta[data-au].is-inview
   {
      animation: au-open 1.2s var(--au-ease-expo) backwards;
   }

.au-cta .it-cta__label
   {
      --d: calc(var(--au-step) * 2);
   }

.au-cta .it-cta__title
   {
      --d: calc(var(--au-step) * 3);
   }

.au-cta .it-cta__text
   {
      --d: calc(var(--au-step) * 4);
   }

.au-cta .adv-actions
   {
      --d: calc(var(--au-step) * 5);
   }


/* ===== Responsive ===== */

@media (max-width: 900px)
   {
      .au-promo__item--full,
      .au-promo__grid,
      .au-promo__grid--three
         {
            grid-template-columns: minmax(0, 1fr);
         }
   }

@media (prefers-reduced-motion: reduce)
   {
      .kisaka-audit .it-toc a::before
         {
            rotate: 0deg;
            transition: none;
         }
   }
