/* Illustrated interludes use Alalaho's original colour drawings and Value Serif. */
[data-illustrated-moment] {
  --moment-ink: #262626;
  --art-rise: 0px;
  --art-opacity: 1;
  --moment-rest: #aaa399;
  position: relative;
  isolation: isolate;
  width: 100%;
  scroll-margin-top: 3.5rem;
  color: var(--moment-ink);
  background: #f9f8f5;
}
[data-illustrated-moment] .illustrated-frame {
  display: grid;
  justify-items: center;
  align-content: center;
  --scene-row-gap: clamp(1.8rem, 3.6vw, 3.75rem);
  row-gap: var(--scene-row-gap);
  padding: clamp(3.5rem, 7vw, 7.75rem) max(1.35rem, 5vw);
  margin: 0 auto;
}
[data-illustrated-moment] .illustrated-art {
  display: grid;
  place-items: center;
  margin: 0;
}
[data-illustrated-moment] .illustrated-art img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
/* Measure the completed drawing to the first line box. Adjust only this
   interval so a third row (such as a booking button) keeps its existing gap. */
.illustrated-frame > .illustrated-art:has(+ .illustrated-copy) {
  --phone-to-tablet: clamp(0rem, (100vw - 24.375rem) * 8 / 378, .5rem);
  --tablet-to-desktop: clamp(0rem, (100vw - 48rem) * 12 / 598, .75rem);
  --painted-gap: calc(2rem + var(--phone-to-tablet) + var(--tablet-to-desktop));
  margin-block-end: calc(var(--painted-gap) - var(--scene-row-gap));
}
/* With contain, object-position acts on the letterbox space. Its complement
   plus a translation of the whole image box aligns the last painted row with
   the figure bottom, even when the file and frame have different proportions. */
.illustrated-frame > .illustrated-art:has(+ .illustrated-copy) > img {
  object-position: center calc(100% - var(--paper-below, 0%));
  translate: 0 var(--paper-below, 0%);
  clip-path: inset(0 0 var(--paper-below, 0%) 0);
}
/* Unpainted source rows divided by canvas height. The windows' paper is opaque. */
.illustrated-art img[src="/brand/illustrated-moments/helping-hand.webp"] { --paper-below: 1.62003%; } /* 11 / 679 */
.illustrated-art img[src="/brand/illustrated-moments/doorway.webp"] { --paper-below: 1.32450%; } /* 10 / 755 */
.illustrated-art img[src="/brand/restructure/meditate.png"] { --paper-below: 5.09857%; } /* 75 / 1471 */
.illustrated-art img[src="/brand/assets/072fdd4f8135cdbd9c04.png"] { --paper-below: 13%; } /* 78 / 600 */
.illustrated-art img[src="/brand/assets/55aece537e4749eb28d7.png"] { --paper-below: .29630%; } /* 2 / 675 */
.illustrated-art img[src="/brand/assets/82105bc7275335f3da41.png"] { --paper-below: 13.5%; } /* 81 / 600 */
.illustrated-art img[src="/brand/archive/windows-archive.webp"] { --paper-below: 10%; } /* 90 / 900 */

[data-illustrated-moment] .illustrated-copy {
  color: inherit;
  font: 400 clamp(1.9rem, 3.05vw, 3.18rem)/1.17 'Value Serif', Georgia, serif;
  letter-spacing: -.025em;
  text-align: center;
  text-wrap: balance;
  margin: 0;
}
[data-illustrated-moment="doorway"] .illustrated-art { height: min(clamp(10.65rem, 18.45vw, 18.45rem), 28.15svh); width: auto; aspect-ratio: 549 / 755; }
[data-illustrated-moment="doorway"] .illustrated-copy { max-width: 34ch; }
[data-illustrated-moment="helping-hand"] { background: #eee9e2; }
[data-illustrated-moment="helping-hand"] .illustrated-frame { --scene-row-gap: clamp(2rem, 3.6vw, 3.75rem); }
[data-illustrated-moment="helping-hand"] .illustrated-art { width: min(clamp(11rem, 19vw, 19rem), 29svh); aspect-ratio: 700 / 679; }
[data-illustrated-moment="helping-hand"] .illustrated-copy { max-width: 22ch; }
:is([data-illustrated-moment="helping-hand"], [data-illustrated-moment="connect"], [data-illustrated-moment="doorway"]) .illustrated-copy { font-size: clamp(2.1rem, 3.35vw, 3.55rem); }
[data-illustrated-moment="connect"] .illustrated-copy { max-width: 33ch; }

/* The full-screen composition stays in normal flow for static reading. */
[data-illustrated-moment] .illustrated-frame {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
}
@media (max-height: 45rem) {
  [data-illustrated-moment] .illustrated-frame { padding-block: clamp(1.5rem, 6svh, 3rem); --scene-row-gap: clamp(1rem, 4svh, 2.2rem); }
}
/* A little over half a screen of travel lets the art resolve before the
   first words start darkening. Keep a short hold on the completed sentence. */
@media (prefers-reduced-motion: no-preference) and (forced-colors: none) and (prefers-contrast: no-preference) {
  [data-illustrated-moment][data-scroll-scene] {
    min-height: 158vh;
    min-height: 158svh;
    scroll-margin-top: 21vh;
    scroll-margin-top: 21svh;
  }
  [data-scroll-scene] .illustrated-frame {
    position: sticky;
    top: 0;
  }
  [data-scroll-scene] .illustrated-art {
    opacity: var(--art-opacity);
    transform: translateY(var(--art-rise));
  }
  [data-scroll-scene] .illustrated-copy { opacity: var(--copy-opacity, 1); }
  [data-scroll-scene] [data-ink] {
    color: color-mix(in srgb, var(--moment-ink) var(--ink-fill, 0%), var(--moment-rest));
  }
}

@media (max-width: 580px) {
  [data-illustrated-moment] .illustrated-frame { padding-block: 3.35rem; --scene-row-gap: 1.85rem; }
  [data-illustrated-moment="doorway"] .illustrated-copy { font-size: clamp(1.68rem, 6.65vw, 2.1rem); line-height: 1.19; }
}
@media print {
  [data-illustrated-moment][data-scroll-scene],
  [data-illustrated-moment] .illustrated-frame { position: static; min-height: 0; }
  [data-illustrated-moment] :is(.illustrated-art, .illustrated-copy) { opacity: 1; transform: none; }
  [data-illustrated-moment] [data-ink] { color: inherit; }
}

[data-illustrated-moment="connect"] { background: #eee9e2; }
[data-illustrated-moment="connect"] .illustrated-art {
  height: min(clamp(10.65rem, 18.45vw, 18.45rem), 28.15svh); width: auto;
  aspect-ratio: 700 / 738;
}

.expect-people,
[data-illustrated-moment="belonging"] { background: #f7f4f1; }
[data-illustrated-moment="belonging"] .illustrated-art {
  width: min(clamp(12rem, 23vw, 22rem), 49svh);
  aspect-ratio: 820 / 560;
}

[data-illustrated-moment="expect-opening"] .illustrated-copy {
  max-width: 32ch;
  font-size: var(--al-type-split-title);
}

.expect-opening-thoughts, .illustrated-sequence-step { display: grid; justify-items: center; align-content: center; gap: clamp(1.1rem, 3vw, 2.35rem); }
.expect-opening-thoughts { row-gap: clamp(2rem, 7vw, 5rem); }
[data-illustrated-moment="expect-opening"] .expect-opening-note { max-width: 30ch; }

[data-illustrated-moment="belonging"] .illustrated-copy,
[data-illustrated-moment="expect-story"] .illustrated-copy {
  max-width: 33ch;
  font-size: clamp(1.9rem, 3.65vw, 3.55rem);
}

[data-illustrated-moment="expect-story"] {
  background: #eee9e2;
  --moment-ink: #262626;
}

@media (prefers-reduced-motion: no-preference) and (forced-colors: none) and (prefers-contrast: no-preference) {
  [data-illustrated-moment="expect-opening"][data-scroll-scene] {
    min-height: 280vh;
    min-height: 280svh;
  }

  [data-scroll-scene] .illustrated-sequence-step {
    grid-area: 1 / 1;
    opacity: var(--thought-opacity, 0);
    transform: translateY(var(--thought-rise, 0));
  }
}

@media (max-width: 580px) {
  [data-illustrated-moment="connect"] .illustrated-copy,
  [data-illustrated-moment="belonging"] .illustrated-copy,
  [data-illustrated-moment="expect-story"] .illustrated-copy { font-size: clamp(1.68rem, 6.65vw, 2.2rem); }
}

@media print {
  [data-illustrated-moment="expect-opening"][data-scroll-scene] { min-height: 0; }
  [data-scroll-scene] .illustrated-sequence-step { grid-area: auto; opacity: 1; transform: none; }
}

/* Carry the opening section's paper through the scene. Dates introduce the beige. */
#helping-hand {
  background: var(--swatch--almost-white, #f9f8f5);
  scroll-margin-top: 0;
}
#helping-hand .illustrated-frame {
  --scene-row-gap: clamp(1.5rem, 3.8svh, 3rem);
}
#helping-hand .illustrated-art {
  width: min(clamp(8.5rem, 19vw, 18rem), 27svh);
  aspect-ratio: 700 / 679;
}
#helping-hand .illustrated-copy {
  max-width: 33ch;
  font-size: var(--al-type-passage);
}
