/* ============================================================
   ARTY: the games' playful look, shared across the website.
   Outlined, tinted cards; faint hand-drawn line art that moves
   behind them; a yellow marker pen that draws under key words;
   photos framed like stickers; things that rise in as you scroll.
   js/arty.js adds the line art (data-art="...") and the scroll
   triggers. Without JS everything simply shows, still styled.
   ============================================================ */

/* ---- Cards: navy outline, soft tint, lift and a yellow glow on hover ---- */
.art-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid var(--color-navy);
  border-radius: 22px;
  color: var(--color-navy);
  background: var(--color-off-white);
  transition: transform .3s var(--ease-out, ease), box-shadow .3s, background .3s;
}
a.art-card:hover, a.art-card:focus-visible,
button.art-card:hover, button.art-card:focus-visible,
.art-card--lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px -16px rgba(30, 58, 95, .5), 0 0 0 6px rgba(237, 196, 106, .6);
}
.art-card > :not(.art-doodle, .visually-hidden) { position: relative; z-index: 1; }
/* anything else that hosts line art (keeps its own look and transitions) */
.art-host { overflow: hidden; isolation: isolate; }
.art-host > :not(.art-doodle, .panel__close, .visually-hidden) { position: relative; z-index: 1; }

/* tints (one per card, like the game cards) */
.tint-sun    { background: radial-gradient(circle at 50% 30%, rgba(253, 227, 88, .30), transparent 70%), var(--color-off-white); }
.tint-sky    { background: radial-gradient(circle at 50% 50%, rgba(90, 160, 210, .18), transparent 72%), var(--color-off-white); }
.tint-rose   { background: radial-gradient(circle at 50% 55%, rgba(225, 110, 110, .14), transparent 70%), var(--color-off-white); }
.tint-lilac  { background: radial-gradient(circle at 50% 50%, rgba(150, 125, 205, .16), transparent 70%), var(--color-off-white); }
.tint-leaf   { background: linear-gradient(180deg, rgba(110, 170, 120, .16), rgba(110, 170, 120, .04)), var(--color-off-white); }
.tint-honey  { background: linear-gradient(180deg, transparent 40%, rgba(237, 196, 106, .32)), var(--color-off-white); }

/* the yellow pill button from the game cards */
.art-pill {
  display: inline-block;
  padding: .55rem 1.9rem;
  background: var(--color-yellow, #FDE358);
  border: 1.5px solid var(--color-navy);
  border-radius: 999px;
  color: var(--color-navy);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}
.art-pill:hover, .art-pill:focus-visible,
.art-card:hover .art-pill, .art-card:focus-visible .art-pill { background: var(--color-navy); color: var(--color-off-white); }

/* ---- Line art behind a card (injected by js/arty.js from data-art) ---- */
.art-doodle {
  position: absolute; z-index: 0;
  width: 118%; max-width: 26rem;
  left: 50%; top: 50%; translate: -50% -50%;
  fill: none; stroke: var(--color-navy); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .22; pointer-events: none;
}
.art-doodle * { transform-box: fill-box; }
/* text-heavy hosts: tuck the drawing into the bottom-right corner, out from behind the words */
.art-corner > .art-doodle { width: 13rem; left: auto; top: auto; right: -2.5rem; bottom: -2.5rem; translate: none; opacity: .2; }
@media (max-width: 45.999rem) { .art-corner > .art-doodle { width: 9rem; right: -2.75rem; bottom: -2.75rem; opacity: .16; } }
.art-doodle .fillY { fill: var(--color-yellow, #FDE358); stroke: none; }
.art-doodle .fillN { fill: var(--color-navy); stroke: none; }

.art-doodle .ping { transform-origin: center; animation: art-ping 3.6s ease-out infinite; opacity: 0; }
.art-doodle .d2 { animation-delay: 1.2s; } .art-doodle .d3 { animation-delay: 2.4s; }
@keyframes art-ping { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }

.art-doodle .twinkle { transform-origin: center; animation: art-twinkle 3s ease-in-out infinite; }
.art-doodle .t2 { animation-delay: .8s; } .art-doodle .t3 { animation-delay: 1.6s; }
@keyframes art-twinkle { 50% { transform: scale(1.5) rotate(18deg); opacity: .5; } }

.art-doodle .bob { animation: art-bob 6s ease-in-out infinite; }
.art-doodle .b2 { animation-delay: -2s; } .art-doodle .b3 { animation-delay: -4s; }
@keyframes art-bob { 50% { transform: translateY(-9px) rotate(-5deg); } }

.art-doodle .rise { animation: art-rise 7s linear infinite; opacity: 0; }
.art-doodle .r2 { animation-delay: -2.3s; } .art-doodle .r3 { animation-delay: -4.6s; }
@keyframes art-rise { 0% { transform: translateY(40px); opacity: 0; } 20%, 70% { opacity: 1; } 100% { transform: translateY(-120px); opacity: 0; } }

.art-doodle .draw { stroke-dasharray: 400; animation: art-draw 6s ease-in-out infinite; }
@keyframes art-draw { 0% { stroke-dashoffset: 400; } 40%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }

.art-doodle .slide { animation: art-slide 9s linear infinite; }
@keyframes art-slide { to { transform: translateX(40px); } }

.art-doodle .spin { transform-origin: 100px 100px; transform-box: view-box; animation: art-turn 16s linear infinite; }
.art-doodle .spin-fast { transform-origin: 100px 100px; transform-box: view-box; animation: art-turn 6s linear infinite; }
@keyframes art-turn { to { rotate: 360deg; } }

/* ---- Yellow marker pen: draws itself under a word when it comes into view ---- */
.art-mark {
  background: linear-gradient(var(--color-yellow, #FDE358), var(--color-yellow, #FDE358)) no-repeat 0 92% / 100% .28em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.js .art-mark { background-size: 0% .28em; transition: background-size 1s cubic-bezier(.6, 0, .2, 1) var(--mark-delay, .35s); }
.js .art-mark.in { background-size: 100% .28em; }
/* a fatter highlighter version */
.art-mark--fat { background-position: 0 62%; }
.art-mark--fat, .js .art-mark--fat.in { background-size: 100% .55em; }
.js .art-mark--fat { background-size: 0% .55em; }

/* ---- Photos framed like stickers: a coloured block behind, a slight tilt ----
   (drawn with box-shadow so a photo that crops its own corners keeps it) */
.art-photo {
  --pop: var(--color-yellow, #FDE358);
  border: 1.5px solid var(--color-navy);
  box-shadow: 10px 10px 0 -1.5px var(--pop), 10px 10px 0 0 var(--color-navy);
  rotate: var(--tilt, -2deg);
  transition: rotate .4s var(--ease-out, ease), transform .4s var(--ease-out, ease), box-shadow .4s var(--ease-out, ease);
}
.art-photo--b { --tilt: 1.8deg; --pop: #cfe3f2; }
.art-photo--c { --tilt: -1deg; --pop: #f3d2cf; }
:is(a, button):hover > .art-photo, :is(a, button):focus-visible > .art-photo, .art-photo:hover {
  rotate: 0deg; transform: translateY(-4px);
  box-shadow: 15px 15px 0 -1.5px var(--pop), 15px 15px 0 0 var(--color-navy);
}

/* ---- Gentle float, for screenshots and objects ---- */
.art-float { animation: art-float 6s ease-in-out infinite; }
.art-float:nth-child(2n) { animation-delay: -2s; }
.art-float:nth-child(3n) { animation-delay: -4s; }
@keyframes art-float { 50% { transform: translateY(-10px); } }

/* ---- Headline lines rise in (wrap each line: <span class="art-line"><span>…</span></span>) ---- */
.art-line { display: block; overflow: hidden; padding-bottom: .08em; }
.art-line > span { display: inline-block; animation: art-line-rise .95s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.15s + var(--l, 0) * .17s); }
@keyframes art-line-rise { from { transform: translateY(105%) rotate(2deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Rise in as you scroll (only with JS, so nothing is ever hidden without it) ---- */
.js .art-reveal { opacity: 0; transform: translateY(46px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * .14s); }
.js .art-reveal.in { opacity: 1; transform: none; }

/* float an image that already has its own entrance animation (uses translate, not transform) */
.art-float-img { animation-name: art-float-t; animation-duration: 6s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.lj-js .lj-drop.art-float-img { animation: lj-drop .95s cubic-bezier(.3, .8, .35, 1) both, art-float-t 6s ease-in-out 1.6s infinite; }
@keyframes art-float-t { 50% { translate: 0 -10px; } }

/* the home page's dictionary entry, as a card */
.definition.art-box { padding: clamp(1.5rem, 4vw, 2.75rem); }

/* a plain white card (consultancy pages) */
.art-panel--white { background: #fff; }

/* drawings around a picture (behind it, bigger than it), e.g. the Learnal notebook */
.art-around { position: relative; isolation: isolate; }
.art-around > .art-doodle { width: min(30rem, 100%); max-width: none; opacity: .4; stroke-width: 1.6; z-index: -1; }
.art-around > img { position: relative; }

/* ---- A framed picture or film: sticker block behind, slight tilt, and a
   star and a squiggle that play around its corners ---- */
.art-framed { position: relative; --pop: var(--color-yellow, #FDE358); --tilt: -1.2deg; }
.art-framed--b { --pop: #cfe3f2; --tilt: 1deg; }
.art-framed { rotate: var(--tilt); transition: rotate .4s ease; }
.art-framed:hover { rotate: 0deg; }
.art-framed > :is(img, video) {
  display: block; border-radius: 16px; border: 1.5px solid var(--color-navy);
  box-shadow: 12px 12px 0 -1.5px var(--pop), 12px 12px 0 0 var(--color-navy);
}
.art-framed::before, .art-framed::after { content: ""; position: absolute; z-index: 2; pointer-events: none; background-repeat: no-repeat; background-size: contain; }
.art-framed::before { width: clamp(2.2rem, 5vw, 3.4rem); aspect-ratio: 1; top: -1.4rem; left: -1.4rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1l2.6 8.4L23 12l-8.4 2.6L12 23l-2.6-8.4L1 12l8.4-2.6z" fill="%23FDE358" stroke="%231E3A5F" stroke-width="1.2"/></svg>');
  animation: art-twinkle 3.2s ease-in-out infinite; }
.art-framed::after { width: clamp(4rem, 9vw, 6.5rem); aspect-ratio: 40 / 24; right: -1.6rem; bottom: -2.2rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 24"><path d="M2 14c4-8 8 8 12 0s8 8 12 0 8 8 12 0" fill="none" stroke="%231E3A5F" stroke-width="2" stroke-linecap="round"/></svg>');
  animation: art-wiggle 4s ease-in-out infinite; }
@media (max-width: 45.999rem) { .art-framed::before { left: -.5rem; top: -1.2rem; } .art-framed::after { right: -.3rem; bottom: -1.9rem; } }
@keyframes art-wiggle { 50% { transform: translateX(10px) rotate(-4deg); } }

/* ---- Phone screenshots and product shots: a coloured sticker shadow that
   follows the shape, and a gentle tilt ---- */
.art-sticker { filter: drop-shadow(9px 10px 0 var(--pop, #FDE358)) drop-shadow(0 14px 22px rgba(30, 58, 95, .2)); }

/* ---- A standalone drawing, e.g. on the thank-you and not-found pages ---- */
.art-badge { position: relative; width: clamp(9rem, 22vw, 13rem); aspect-ratio: 1; margin: 0 0 var(--space-md, 1.5rem); }
.art-badge > .art-doodle { width: 100%; max-width: none; opacity: .55; stroke-width: 2; }

/* ---- Long reading pages (legal): a yellow tab above each section heading ---- */
.art-legal h2::before { content: ""; display: block; width: 2.6rem; height: .3rem; margin-bottom: .55rem; border-radius: 3px; background: var(--color-yellow, #FDE358); }
.art-legal .lede { padding: 1rem 1.25rem; border: 1.5px solid var(--color-navy); border-radius: 18px; background: #fff; box-shadow: 8px 8px 0 -1.5px var(--color-yellow, #FDE358), 8px 8px 0 0 var(--color-navy); }

/* ---- A content card (consultancy pages) ---- */
.art-panel { max-width: 40rem; padding: clamp(1.5rem, 4vw, 2.5rem); }
/* even spacing between everything inside the card */
div.art-panel > * { margin-block: 0; }
div.art-panel > * + *, .consult div.art-panel > * + * { margin-top: 1.4rem; }
div.art-panel > .art-doodle + * { margin-top: 0; }
form.art-panel { margin-top: var(--space-lg, 2rem); }
/* small label above a heading: navy on a tinted card (yellow would vanish) */
.art-panel .consult-eyebrow { color: var(--color-navy); opacity: .7; }

/* ---- Highlights on the pinned "story" pages draw each time their slide
   comes up (the slide gets .is-current), and wipe when it leaves ---- */
.js .is-current .art-mark { background-size: 100% .28em; }
.js .is-current .art-mark--fat { background-size: 100% .55em; }

/* static fallback of the story pages (no animation running): show everything */
:is(.ab-cinema, .q-cinema):not(.is-kinetic) .art-words .aw { opacity: 1; transform: none; filter: none; }
.js :is(.ab-cinema, .q-cinema):not(.is-kinetic) .art-mark { background-size: 100% .28em; }
.js :is(.ab-cinema, .q-cinema):not(.is-kinetic) .art-mark--fat { background-size: 100% .55em; }

/* ---- Words drift in one by one (js/arty.js wraps each word in .aw) ---- */
.js .art-words .aw { display: inline-block; opacity: 0; transform: translateY(.45em) rotate(1.5deg); filter: blur(3px);
  transition: opacity .25s ease, transform .25s ease, filter .25s ease; }
/* a highlight or link moves as part of the line (so it can wrap like text): it fades rather than lifts */
.js .art-words .aw--el { display: inline; }
.js .art-words.in .aw, .js .is-current .art-words .aw {
  opacity: 1; transform: none; filter: none;
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1), filter .6s ease;
  transition-delay: calc(var(--wd, .25s) + var(--w, 0) * 32ms);
}

/* ---- Buttons: the games' yellow pill, made chunky and playful. A navy
   outline and a navy "3D" base; a shine sweeps across now and then; it
   springs up with a little tilt when you point at it and presses down
   when you tap. ---- */
:is(.page-main .button, .shop-buy .button, .signup__button, .enquiry__submit, .ab-cta__link, .page-main .lj-store, .page-main .lj-btn, .page-main .qu-app__store, .q-cta__button, .qa-store, .art-pill, .site-promo__button) {
  --depth: var(--color-navy);
  color: var(--color-navy) !important;
  background-color: var(--color-yellow, #FDE358) !important;
  border: 1.5px solid var(--color-navy) !important;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--depth) !important;
  background-image: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .6) 50%, transparent 62%) !important;
  background-size: 260% 100% !important;
  background-repeat: no-repeat !important;
  background-position: 160% 0;
  animation: art-shine 5s ease-in-out infinite;
  transition: background-color .2s, color .2s, box-shadow .2s, transform .35s cubic-bezier(.34, 1.7, .5, 1) !important;
}
:is(.page-main .button, .shop-buy .button, .signup__button, .enquiry__submit, .ab-cta__link, .page-main .lj-store, .page-main .lj-btn, .page-main .qu-app__store, .q-cta__button, .qa-store, .art-pill, .site-promo__button):nth-of-type(2) { animation-delay: 1.2s; }
:is(.page-main .button, .shop-buy .button, .signup__button, .enquiry__submit, .ab-cta__link, .page-main .lj-store, .page-main .lj-btn, .page-main .qu-app__store, .q-cta__button, .qa-store, .art-pill, .site-promo__button):nth-of-type(3) { animation-delay: 2.4s; }
:is(.page-main .button, .shop-buy .button, .signup__button, .enquiry__submit, .ab-cta__link, .page-main .lj-store, .page-main .lj-btn, .page-main .qu-app__store, .q-cta__button, .qa-store, .art-pill, .site-promo__button):is(:hover, :focus-visible) {
  outline: none;
  transform: translateY(-3px) rotate(-2deg) !important;
  box-shadow: 0 7px 0 var(--depth) !important;
}
:is(.page-main .button, .shop-buy .button, .signup__button, .enquiry__submit, .ab-cta__link, .page-main .lj-store, .page-main .lj-btn, .page-main .qu-app__store, .q-cta__button, .qa-store, .art-pill, .site-promo__button):active { transform: translateY(3px) !important; box-shadow: 0 1px 0 var(--depth) !important; transition-duration: .08s !important; }
/* the banner's button stays navy (it sits on yellow), with a deeper navy base */
.site-promo > .site-promo__button { --depth: #0b1a2b; color: var(--color-off-white) !important; background-color: var(--color-navy) !important; border-color: var(--color-navy) !important; }
/* the pill inside a card (Consultancy) follows the card */
.art-card .art-pill { box-shadow: 0 3px 0 var(--depth) !important; }
@keyframes art-shine { 0%, 62% { background-position: 160% 0; } 100% { background-position: -60% 0; } }

/* ---- Boxes: white, a navy outline, a coloured sticker block behind and a
   slight tilt (straightens when you point at it) ---- */
.art-box {
  background: #fff !important;
  border: 1.5px solid var(--color-navy) !important;
  border-radius: 22px;
  box-shadow: 10px 10px 0 -1.5px var(--pop, #FDE358), 10px 10px 0 0 var(--color-navy) !important;
  rotate: var(--tilt, -.6deg);
  transition: rotate .4s ease, box-shadow .4s ease;
}
.art-box:hover { rotate: 0deg; }
form.art-box { --tilt: 0deg; }
.art-box.pop-sky   { --pop: #cfe3f2; --tilt: .6deg; }
.art-box.pop-rose  { --pop: #f3d2cf; }
.art-box.pop-leaf  { --pop: #c7e4cb; --tilt: .5deg; }
.art-box.pop-lilac { --pop: #e3daf3; }

/* ---- A white paint swipe behind a line of text, so it reads over drawings ---- */
.art-swipe { display: table; margin-inline: auto; padding: .45em 1.1em; background: #fff; border-radius: 22px 30px 24px 34px / 26px 22px 30px 24px; rotate: -.8deg; box-shadow: 0 6px 18px -10px rgba(30, 58, 95, .25); }

@media (prefers-reduced-motion: reduce) {
  .art-doodle, .art-doodle *, .art-float, .art-float-img, .art-line > span, .art-framed::before, .art-framed::after { animation: none !important; }
  .art-doodle .ping, .art-doodle .rise { opacity: .3; }
  .js .art-reveal { opacity: 1; transform: none; transition: none; }
  .js .art-mark { background-size: 100% .28em; transition: none; }
  :is(.page-main .button, .shop-buy .button, .signup__button, .enquiry__submit, .ab-cta__link, .page-main .lj-store, .page-main .lj-btn, .page-main .qu-app__store, .q-cta__button, .qa-store, .art-pill, .site-promo__button) { animation: none; transition: none !important; }
  .art-box { transition: none; }
  .js .art-words .aw { opacity: 1; transform: none; filter: none; transition: none; }
  .js .art-mark--fat { background-size: 100% .55em; }
  .art-photo, .art-card { transition: none; }
}
