/* ==========================================================================
   Career Leap: illustration.css   (owner: illustration layer)
   Direction: "The marked-up plan". Three registers: System / Hand / Horizon.
   Colours: every --cl-il-* role is DEFINED in tokens/tokens.json (sys.light|dark.illustration, aliasing ref.color.*) and emitted by
   tokens.css, themed there. This file only CONSUMES them (round E1 ruling 27): no colour literal, no --cl-ref-*, no role definitions.
   Load tokens.css first.
   Handwriting font (Kalam, with a Segoe Print / Bradley Hand fallback) is for .cl-annotation and .cl-postit ONLY, never UI; minimum 20px; every annotation
   that carries meaning has a real-text twin (.cl-annotation__text).
   ROUND A2 (art direction): the pen is the identity -- a real, slightly imperfect pen (Kalam + pressure-variant filled
   marks + the highlighter) appears ONCE per screen, as the system's voice on the user's side; everything else stays quiet
   and precise. Marks are FILLED outlines (thin entry, full pressure, lifted tail), never uniform strokes. People are
   photography direction (duotone, no drawn faces, tagged ILLUSTRATIVE). Night horizon is quieter: gold-dark 7-8, blue-dark 3-6,
   sun gold-dark 9 at 72%. color-scheme lives in tokens.css only. .cl-tag lives in atoms.css; here it is only positioned.
   RULES added in round A1: (1) glass never sits over paper, photos or illustrations (use .cl-glass--over-art);
   (2) ILLUSTRATIVE / SIMULATED are HTML tags (.cl-tag) at caption size, never SVG text; (3) grain is ONE tiled
   WebP (grain.webp, 2 KB), no per-card SVG filters; at most one SVG filter on any page.
   ========================================================================== */
@layer cl.illustration {
:root { --cl-il-rot: 0deg; }   /* the only variable defined here: the rotation hook the .cl-rot-* classes set. Every colour role is in tokens.json (sys.light|dark.illustration) and arrives via tokens.css. */
/* ---- Marks (inline SVG from assets/illustrations/mark-*.svg) ------------- */
.cl-mark { display: block; overflow: visible; max-width: 100%; height: auto; pointer-events: none; }
.cl-mark--orange { --cl-il-mark: var(--cl-il-orange); }   /* one key word per page, max */
.cl-mark--flip { transform: scaleX(-1); }
.cl-mark--sm { width: 64px; }
.cl-mark--md { width: 96px; }
.cl-mark--lg { width: 160px; }      /* lint-allow: artwork width: the mark's own viewBox scale (64/96/160) */
.cl-mark--underline { width: 100%; height: 12px; }   /* lint-allow: underline artwork height, viewBox 240x24 scaled */       /* stretches under the word it marks */

/* ---- mark/insight: ONE highlighter shape everywhere (ruling 9, finding 9) ------------------------------------------
   A tapered swipe, low and narrow at the left, fuller at the right, under the lower 0.42em of ONE word per page.
   The swipe is a solid token colour: gold-light-6 on Whisper Gold, gold-dark-7 on Night (a darker gold, so the text
   keeps its normal ink in both themes and never straddles gold and canvas). The hex in each data-URI mirrors that
   token because an SVG data-URI cannot read a CSS variable (the same two values are asserted in scripts/contrast.mjs). */
.cl-mark-insight {
  background: var(--cl-il-swipe-art) no-repeat 0 var(--_mark-y, 88%) / 100% var(--_mark-h, .42em);   /* the swipe art and its colour are built from tokens.json (sys.*.illustration.swipe) by build-tokens */
  color: inherit;   /* <mark>'s UA default is black (MarkText); text must keep the theme's on-surface */
  padding: 0 .2em; margin: 0 -.2em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
:root[data-theme="dark"] .cl-mark-insight,
.cl-theme-dark .cl-mark-insight,
[data-theme="dark"] .cl-mark-insight {
  --_mark-y: 92%; --_mark-h: .62em;   /* Night: a thin dark stripe read as a strike-through; a taller, lower swipe reads as highlighter under light text */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cl-mark-insight { --_mark-y: 92%; --_mark-h: .62em; }
}
@media (forced-colors: active) {
  .cl-mark-insight { background: none; text-decoration: underline 3px; text-underline-offset: 4px; } /* lint-allow: forced-colors underline matches the 3px hand-stroke weight */
}

/* ---- Annotation: handwriting. Decorative, aria-hidden; repeat meaning in text. */
.cl-annotation {
  font-family: var(--cl-font-family-hand, Kalam), "Segoe Print", "Bradley Hand", cursive;   /* loaded with font-display: swap (ruling 18) */
  font-weight: 400;
  font-size: var(--cl-font-size-20);   /* never below 20px: Kalam's x-height is small, 18 reads like 15px Inter (ruling 15) */
  line-height: 1.25;
  max-width: min(12ch, 40vw);          /* never a fixed pixel width: it wraps with the text at 200% */
  overflow-wrap: break-word;
  color: var(--cl-il-ink);
  transform: rotate(var(--cl-il-rot));
  pointer-events: none; user-select: none; margin: 0;
}

/* Real-text twin of a handwritten annotation: visually hidden, read by assistive tech.
   Pattern: <p class="cl-annotation" aria-hidden="true">Same courses&hellip;</p><span class="cl-annotation__text">Same courses, same advice, and still no calls.</span> */
.cl-annotation__text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---- Post-it --------------------------------------------------------------- */
.cl-postit {
  position: relative; box-sizing: border-box;
  min-width: 0; padding: var(--cl-space-16) var(--cl-space-16) var(--cl-space-20);
  background: linear-gradient(180deg, var(--cl-il-gloss) 0 14%, transparent 14%), var(--cl-il-sticky);
  color: var(--cl-il-on-sticky);
  font-family: var(--cl-font-family-hand, Kalam), "Segoe Print", "Bradley Hand", cursive; font-size: var(--cl-font-size-20); line-height: 1.25; overflow-wrap: break-word;
  box-shadow: 0 1px 1px var(--cl-il-contact-shadow), 0 14px 12px -10px var(--cl-il-shadow);   /* lint-allow: paper contact-shadow geometry */
  transform: rotate(var(--cl-il-rot)); border-radius: 2px 2px 4px 2px;
}
.cl-postit::after {             /* lifted corner */
  content: ""; position: absolute; right: 0; bottom: 0; width: var(--cl-space-24); height: var(--cl-space-24);
  background: linear-gradient(135deg, transparent 50%, var(--cl-il-sticky-fold) 50%, var(--cl-il-sticky-fold-light) 100%);
  border-radius: 0 0 4px 0;
}
/* round G: the blue post-it is retired. The hand register is yellow paper only; new notes use .cl-sticky (same --cl-il-sticky roles). */

/* ---- Paper cards -------------------------------------------------------- */
/* Shadow: a bottom-only box-shadow on an UNCLIPPED wrapper. The old filter:drop-shadow on a rotated clip-path layer
   forced a CPU re-raster on every scroll (round A1 iOS 6 / Android 6). */
.cl-paper-shadow { box-shadow: 0 12px 10px -10px var(--cl-il-shadow); border-radius: var(--cl-radius-4); }   /* lint-allow: paper contact-shadow geometry */
.cl-paper-torn, .cl-paper-crumpled, .cl-paper-index {
  --_grain: var(--cl-asset-grain);   /* one shared 96px tile, 2 KB; replaces the per-card feTurbulence data-URI */
  background: var(--_grain), var(--cl-il-paper);
  color: var(--cl-il-ink-paper); box-sizing: border-box; padding: var(--cl-space-24);
  transform: rotate(var(--cl-il-rot));
}
/* Wrap in .cl-paper-shadow: clip-path cuts a box-shadow on the paper itself, so the shadow lives on the wrapper. */
.cl-paper-torn { clip-path: polygon(0.0% 0.8%,5.0% 1.7%,10.0% 0.0%,15.0% 0.4%,20.0% 1.1%,25.0% 0.9%,30.0% 0.2%,35.0% 0.3%,40.0% 0.1%,45.0% 0.1%,50.0% 0.5%,55.0% 1.9%,60.0% 0.1%,65.0% 1.4%,70.0% 1.6%,75.0% 0.2%,80.0% 0.2%,85.0% 1.0%,90.0% 1.7%,95.0% 0.3%,100.0% 0.6%,99.3% 7.7%,99.5% 15.4%,99.6% 23.1%,100.0% 30.8%,99.2% 38.5%,98.9% 46.2%,98.9% 53.8%,99.3% 61.5%,99.6% 69.2%,99.6% 76.9%,99.2% 84.6%,99.3% 92.3%,100.0% 99.8%,95.0% 99.6%,90.0% 99.4%,85.0% 99.2%,80.0% 98.7%,75.0% 99.2%,70.0% 100.0%,65.0% 98.7%,60.0% 99.3%,55.0% 99.2%,50.0% 99.6%,45.0% 99.3%,40.0% 99.4%,35.0% 98.8%,30.0% 99.8%,25.0% 99.1%,20.0% 99.7%,15.0% 98.9%,10.0% 99.9%,5.0% 99.6%,0.0% 99.4%,0.6% 92.3%,0.0% 84.6%,0.4% 76.9%,0.2% 69.2%,0.3% 61.5%,0.4% 53.8%,0.9% 46.2%,0.4% 38.5%,0.9% 30.8%,0.2% 23.1%,0.8% 15.4%,0.3% 7.7%); }
.cl-paper-crumpled {
  background:
    linear-gradient(115deg, transparent 0 30%, var(--cl-il-gloss-strong) 30% 31%, transparent 31%),
    linear-gradient(62deg, transparent 0 55%, var(--cl-il-crease) 55% 56%, transparent 56%),
    linear-gradient(160deg, var(--cl-il-gloss), transparent 40%, var(--cl-il-crease-soft) 78%),
    var(--_grain), var(--cl-il-paper);
  clip-path: polygon(0 1%, 18% 0, 47% 1.4%, 76% 0, 100% 1%, 99% 38%, 100% 70%, 98.6% 100%, 62% 98.8%, 30% 100%, 0 98.6%, 1.2% 60%);
}
.cl-paper-index {
  background:
    linear-gradient(var(--cl-il-gold), var(--cl-il-gold)) 0 40px / 100% 2px no-repeat,   /* lint-allow: ruled-card geometry: header rule, then 28px ruled lines */
    repeating-linear-gradient(transparent 0 27px, var(--cl-il-blue-soft) 27px 28px) 0 68px / 100% 112px no-repeat,   /* lint-allow: ruled-card geometry */
    var(--_grain), var(--cl-il-paper-edge);
  border-radius: 4px;
}

/* ---- Horizon placement ------------------------------------------------------ */
.cl-has-corner { position: relative; overflow: hidden; isolation: isolate; }
.cl-corner {                                     /* flush to the corner; the artwork itself bleeds */
  position: absolute; z-index: -1; pointer-events: none; height: auto;
  width: var(--cl-corner-size, clamp(160px, 48vw, 260px));   /* lint-allow: Horizon artwork bleed size, art-directed per viewport */
}
.cl-corner--tr { top: 0; right: 0; }
.cl-corner--tl { top: 0; left: 0; transform: scaleX(-1); }
.cl-corner--bl { bottom: 0; left: 0; }
.cl-corner--br { bottom: 0; right: 0; transform: scaleX(-1); }
.cl-corner--bleed { --cl-corner-size: clamp(200px, 60vw, 340px); }   /* lint-allow: Horizon artwork bleed size */
.cl-horizon-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; width: 100%; height: auto; pointer-events: none; }
.cl-corner-safe { position: relative; z-index: 1; }     /* body content sits here, outside the art */

/* spark ticks: absolute at a corner of the thing that just arrived */
.cl-spark { position: absolute; width: 44px; height: auto; pointer-events: none; }   /* lint-allow: spark-tick mark width, viewBox scale */
.cl-spark--tr { top: -12px; right: -8px; }
.cl-spark--tl { top: -12px; left: -8px; transform: scaleX(-1); }

/* Photography direction slot (ruling 19). A 4:5 or 3:2 duotone frame stands where a real, consented photo goes: figure from
   behind or side, hands on a laptop, a desk with torn paper. No drawn faces. The ILLUSTRATIVE tag is HTML (.cl-tag, defined in
   atoms.css, only positioned here): SVG text scales with the artwork and fell to 6px (round A1 ruling 10).
   .cl-person is kept as an alias because atoms and molecules pages use it. */
.cl-person, .cl-il-slot { position: relative; display: block; isolation: isolate; }
.cl-person-slot { display: block; width: 100%; height: auto; border-radius: var(--cl-radius-12); overflow: hidden; }
.cl-il-slot::after {               /* grain at 6%, the one shared tile */
  content: ""; position: absolute; inset: 0; border-radius: var(--cl-radius-12); pointer-events: none;
  background: var(--cl-asset-grain); opacity: var(--cl-opacity-grain); mix-blend-mode: multiply;
}
.cl-person > .cl-tag, .cl-il-slot .cl-tag { position: absolute; top: var(--cl-space-8); left: var(--cl-space-8); z-index: 1; }
.cl-il-slot__cap {                 /* "Photo goes here": visible in the frame, solid chip, 12px floor */
  position: absolute; left: var(--cl-space-8); right: var(--cl-space-8); bottom: var(--cl-space-8); z-index: 1;
  padding: var(--cl-space-4) var(--cl-space-8); border-radius: var(--cl-radius-8);
  background: var(--cl-color-surface-raised); color: var(--cl-color-on-surface);
  font-family: var(--cl-font-family-sans); font-size: var(--cl-type-caption-size); line-height: var(--cl-type-caption-line-height);
}
:root[data-theme="dark"] .cl-person-slot, .cl-theme-dark .cl-person-slot, [data-theme="dark"] .cl-person-slot { filter: saturate(.8) brightness(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cl-person-slot { filter: saturate(.8) brightness(.8); } }
@media (forced-colors: active) { .cl-decor, .cl-mark { forced-color-adjust: none; } }

/* ---- Batch G spots (round G): placement helpers for assets/illustrations/spot-*, quiz-*, result-*, empty-*, about-*, milestone, onboarding-welcome.
   Spots sit on the canvas or on paper, never on glass (glass over art uses .cl-glass--over-art). Decorative by default: aria-hidden="true" on the svg/img.
   Night: paper steps down to dimmed cream (color-mix of the light paper and the dark surface) so scenes do not look pasted on; warmth comes from the soft halo inside the art. */
.cl-il-spot { display: block; overflow: visible; width: 100%; height: auto; max-width: 100%; margin-inline: auto; pointer-events: none; }   /* sized by its container; the viewBox sets the ratio */
.cl-il-spot--sm { max-width: 14rem; }   /* lint-allow: spot artwork width, empty states and About (240 and 320 wide viewBoxes) */
.cl-il-spot--md { max-width: 20rem; }   /* lint-allow: spot artwork width, landing and quiz (320 wide) */
.cl-il-spot--lg { max-width: 26rem; }   /* lint-allow: spot artwork width, result reveal (400 wide) */
.cl-il-spot--start { margin-inline: 0; }
:root[data-theme="dark"] .cl-il-spot:not(.cl-theme-light .cl-il-spot), .cl-theme-dark .cl-il-spot, [data-theme="dark"] .cl-il-spot:not([data-theme="light"] .cl-il-spot) { --cl-il-paper: color-mix(in oklab, var(--cl-il-paper-light) 80%, var(--cl-color-surface)); --cl-il-paper-edge: color-mix(in oklab, var(--cl-il-paper-edge-light) 70%, var(--cl-color-surface)); }   /* round G9: Night paper is dimmed cream (: light paper 80 percent, edge 70 percent, mixed with the dark surface; ink-paper navy stays above 4.5:1, 7.5 and 6.2) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cl-il-spot { --cl-il-paper: color-mix(in oklab, var(--cl-il-paper-light) 80%, var(--cl-color-surface)); --cl-il-paper-edge: color-mix(in oklab, var(--cl-il-paper-edge-light) 70%, var(--cl-color-surface)); } }
@media (forced-colors: active) { .cl-il-spot { forced-color-adjust: none; } }

/* ---- Rotation helpers: -3deg .. +3deg only ------------------------------------- */
.cl-rot-n3 { --cl-il-rot: -3deg; } .cl-rot-n2 { --cl-il-rot: -2deg; } .cl-rot-n1 { --cl-il-rot: -1deg; }
.cl-rot-1 { --cl-il-rot: 1deg; }   .cl-rot-2 { --cl-il-rot: 2deg; }   .cl-rot-3 { --cl-il-rot: 3deg; }

/* ---- Draw-on: once, 400ms. Strokes use pathLength="1"; filled brush marks reveal left to right. */
/* All motion from tokens (round A1 ruling 6): --cl-motion-draw = 400ms, standard easing, 100ms delay. Under
   prefers-reduced-motion the duration tokens collapse to 0.01ms and the explicit block below shows marks already drawn. */
@keyframes cl-draw { to { stroke-dashoffset: 0; } }
@keyframes cl-reveal { to { clip-path: inset(0 0 0 0); } }
.cl-draw path[pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; animation: cl-draw var(--cl-motion-draw) forwards; }
.cl-draw .cl-reveal, .cl-draw.cl-reveal { clip-path: inset(0 100% 0 0); animation: cl-reveal var(--cl-motion-draw) forwards; }
.cl-draw path[pathLength]:nth-of-type(2) { animation-delay: var(--cl-motion-draw-delay-2); }
@media (prefers-reduced-motion: reduce) {
  .cl-draw path[pathLength] { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .cl-draw .cl-reveal, .cl-draw.cl-reveal { clip-path: none; animation: none; }
}
@media (prefers-contrast: more), (prefers-reduced-data: reduce), (update: slow) {
  .cl-paper-torn, .cl-paper-crumpled, .cl-paper-index { background-image: none; background-color: var(--cl-il-paper); }
}

}
