/* Caesar Palm Jumeirah story page. The site's own tokens (paper, ink, Geist, green spot) with an Illoca-style
   structure: a fixed 3D stage seen through a rounded window in the paper, chapters that swing in on scroll. */
.cp-stage { position: fixed; inset: 0; z-index: 0; }
.cp-stage canvas { display: block; width: 100%; height: 100%; }
/* the window: one rounded box whose huge shadow is the paper around it; its size is set from scroll */
.cp-window { position: fixed; z-index: 1; left: 50%; top: 50%; width: 0; height: 0; border-radius: 28px; pointer-events: none;
  box-shadow: 0 0 0 200vmax var(--paper), inset 0 0 0 1px var(--line); }
.cp-load { position: fixed; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--paper); transition: opacity .6s; }
.cp-load .mono { font: 500 .72rem var(--mono); text-transform: uppercase; color: var(--ink-muted); letter-spacing: .06em; }
.cp-load b { font: 600 clamp(48px, 7vw, 96px)/1 var(--sans); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.cp-load.is-done { opacity: 0; pointer-events: none; }

.cp { position: relative; z-index: 2; }
.cp-seg { height: calc(var(--h) * 1vh); }

/* hero: the title sits on the paper above the window */
.cp-hero__title { position: fixed; z-index: 2; left: var(--gut); right: var(--gut); top: 104px; display: grid; gap: 10px; pointer-events: none; }
.cp-hero__title .eyebrow { opacity: 0; }
.cp-h { position: relative; font: 700 clamp(44px, 8.4vw, 150px)/.9 var(--sans); letter-spacing: -.055em; }
.cp-h__bg { display: block; color: transparent; -webkit-text-stroke: 1px var(--ink); }
.cp-h__fill { position: absolute; inset: 0; display: block; color: var(--ink); }
.cp-hand { font: 400 clamp(26px, 2.6vw, 40px)/1 var(--hand); color: var(--spot-2); rotate: -3deg; justify-self: end; margin-right: 6vw; opacity: 0; }

/* chapters: the panel swings in on the paper beside the window */
.cp-panel { position: fixed; z-index: 2; top: 120px; width: min(30vw, 470px); visibility: hidden; }
.cp-ch[data-side="left"] .cp-panel { left: var(--gut); } .cp-ch[data-side="right"] .cp-panel { right: var(--gut); }
.cp-card { display: grid; gap: 18px; }
.cp-eye { display: flex; align-items: center; gap: 10px; font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.cp-eye span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--spot); color: #fff; font-size: .68rem; }
.cp-t { position: relative; font: 600 clamp(30px, 3.3vw, 56px)/1 var(--sans); letter-spacing: -.045em; }
.cp-p { font-size: clamp(15px, 1.05vw, 17px); line-height: 1.6; color: var(--ink-muted); max-width: 40ch; }
.cp-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 14px 26px; justify-content: start; padding-top: 16px; border-top: 1px solid var(--line); }
.cp-facts dt { font: 500 .66rem var(--mono); text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.cp-facts dd { font: 600 1.25rem var(--sans); letter-spacing: -.02em; }
/* each chapter's images: one frame that steps through them with scroll, the next one wiping up over the last */
.cp-media { display: grid; gap: 10px; }
.cp-media__frame { position: relative; height: clamp(170px, 33vh, 330px); border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.cp-media__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--card);   /* slides, plans and pages are shown whole */
  clip-path: inset(100% 0 0 0); scale: 1.08;
  transition: clip-path .9s cubic-bezier(.7, 0, .2, 1), scale 1.4s cubic-bezier(.2, .7, .2, 1); }
.cp-media__frame img.was-on { clip-path: inset(0); scale: 1; z-index: 0; transition: none; }
.cp-media__frame img.is-on { clip-path: inset(0); scale: 1; z-index: 1; }
.cp-media figcaption { display: flex; align-items: baseline; gap: 8px; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.cp-media figcaption b { color: var(--ink); font-weight: 600; }
.cp-media figcaption em { font-style: normal; margin-left: 6px; text-transform: none; letter-spacing: 0; font: 400 .85rem var(--sans); }

/* outro: the window closes and a card lands on the paper */
.cp-out { position: relative; }
.cp-out__card { position: relative; width: min(980px, calc(100vw - 2 * var(--gut))); margin: 0 auto 14vh; padding: clamp(24px, 4vw, 56px); border-radius: 22px; background: var(--card); box-shadow: var(--shadow-card), 0 0 0 1px var(--line); display: grid; gap: 22px; }
.cp-out__card h2 { font: 600 clamp(30px, 4vw, 60px)/1.02 var(--sans); letter-spacing: -.045em; }
.cp-out__card > p:not(.eyebrow) { color: var(--ink-muted); max-width: 52ch; font-size: 1.05rem; line-height: 1.6; }
.cp-facts--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cp-facts--wide dd { font: 400 1rem/1.4 var(--sans); letter-spacing: 0; }
.cp-out__cta { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 1023px) {
  .cp-hero__title { top: 92px; }
  .cp-hand { justify-self: start; margin: 0; }
  .cp-panel { left: 12px !important; right: 12px !important; top: auto; bottom: 12px; width: auto; }
  .cp-card { gap: 10px; padding: 18px; border-radius: 18px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-card), 0 0 0 1px var(--line); }
  .cp-t { font-size: 28px; } .cp-p { font-size: 14px; line-height: 1.5; }
  .cp-facts dd { font-size: 1rem; }
  .cp-media__frame { height: 120px; border-radius: 10px; }
  .cp-card .cp-facts { display: none; }   /* on a phone the text already says it; the tower keeps the room */
  .cp-facts--wide { grid-template-columns: 1fr; }
}

/* hand-written notes pinned to points on the tower (positioned from js/cpj-gl.js) */
.cp-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cp-pin { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; opacity: 0; white-space: nowrap; will-change: transform, opacity; }
.cp-pin i { flex: none; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--spot); box-shadow: 0 0 0 5px color-mix(in srgb, var(--spot) 28%, transparent); }
.cp-pin span { font: 400 clamp(22px, 1.9vw, 30px)/1 var(--hand); padding: 5px 12px 3px; border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--paper) 90%, transparent); box-shadow: 0 0 0 1px var(--line); rotate: -2deg; transition: translate .3s; }
