/* ==========================================================
   The doodle layer (task #250): icons, drawn scenes and a little movement, ON TOP of look A "Quiet luxury".
   It is linked only by the pages that carry the art (includes/art.php: the home page and the software pages listed in ART_SOFTWARE) and every rule starts with
   ".art" (the class of <main> on those pages), so a page without the art is not touched by a single line of this file. The drawings are made in includes/art.php
   and includes/art-icons.php; art.js only adds the classes that start the movement. Raise ART_VERSION in art.php when this file changes (it is linked as /art.css?v=1).
   ========================================================== */

/* ---------- THE ONE BLOCK OF TOKENS: how much art there is, and how it looks ----------
   Ask for "more" or "less" art by changing ART_LEVEL in includes/art.php (calm, normal, lively; what each level shows is under "Levels" at the end of this file: calm = icons only; normal = + drawn scenes, the hero's dots, one-time movement, the dashes of the arrows; lively = + the dots behind more sections and a slow twinkle).
   Colours come from style.css only: the ink for the line, the brand green (--cta) for the one detail that matters, a 13% wash of the bright green under a drawing. */
.art {
  --art-ink: var(--ink);
  --art-accent: var(--cta);                  /* #047857: 5.5:1 on white */
  --art-wash: rgba(16, 185, 129, .13);       /* --cta-bright at 13%, the soft fill under a drawing */
  --art-dot: var(--line-2);                  /* background dots */
  --art-link: var(--line-2);                 /* the line that joins steps */
  --art-bg: var(--bg);                       /* the colour behind a step's picture, so the joining line passes behind it */
  --art-label: var(--muted);                 /* small captions: 6.3:1 on white */
  --art-weight: 1.6;                         /* the line, in screen pixels: every icon is drawn at this weight whatever its size (the size is --icn on each icon) */
  --art-draw: calc(560ms * var(--k));        /* one line being drawn (--k is 0 under reduced motion, see style.css) */
  --art-step: calc(70ms * var(--k));         /* between the lines of one icon */
  --art-stage: calc(200ms * var(--k));       /* between the stages of a scene */
  --art-flow: 2.4s;                          /* one turn of a marching dashed line (a loop that shows something moving: slow, small, only while on screen) */
}
.art .section-dark {
  --art-ink: var(--on-dark-muted);           /* #CBD5E1 on #0F172A */
  --art-accent: var(--cta-bright);           /* #10B981 on #0F172A */
  --art-wash: rgba(16, 185, 129, .16);
  --art-dot: rgba(255, 255, 255, .16);
  --art-link: rgba(255, 255, 255, .3);
  --art-bg: var(--primary);
  --art-label: var(--on-dark-faint);         /* #94A3B8: 7:1 on the dark band */
}
.art .section-alt, .art .callout { --art-bg: var(--surface); }

/* ---------- Icons: one hand ---------- */
.art-icon {
  display: block; flex: none; overflow: visible;
  width: calc(var(--icn, 40) * 1px); height: calc(var(--icn, 40) * 1px);
  fill: none; stroke: var(--art-ink); stroke-linecap: round; stroke-linejoin: round;
  stroke-width: calc(var(--art-weight) * 48 / var(--icn, 40));      /* the same thin line at 20 px and at 72 px */
}
.art .a { stroke: var(--art-accent); }
.art .w { fill: var(--art-wash); stroke: none; translate: 2px 2px; }       /* nudged with 'translate', which adds to a shape's own transform (a rotated shape keeps its rotation) */
.art .w.big { opacity: .5; }                     /* a large wash (a whole house) is lighter than the wash under a small icon */
.art .o { fill: var(--art-ink); stroke: none; }
.art .g { fill: var(--art-accent); stroke: none; }
.art .sq { fill: var(--art-wash); stroke: var(--art-ink); stroke-width: 1; }
.art .flow { fill: none; stroke-dasharray: 3 8; }

/* a scene: its size comes from its viewBox (width and height attributes), so the space is reserved before it is drawn */
.art-scene {
  display: block; width: 100%; height: auto; overflow: visible;
  fill: none; stroke: var(--art-ink); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7;
}
@media (max-width: 899px) { .art-scene { stroke-width: 2; } }
@media (max-width: 519px) { .art-scene { stroke-width: 2.6; } }

/* ---------- Movement: a drawing arrives once, when it scrolls into view ----------
   Without JavaScript, with reduced motion, or without IntersectionObserver every drawing is simply there, complete: art.js adds .art-wait to a drawing (its lines are
   hidden) and later .art-go (they draw themselves). Only stroke-dashoffset, opacity, transform and translate ever change over time; a colour never transitions. */
.art .s1 { --st: 0ms; }
.art .s2 { --st: var(--art-stage); }
.art .s3 { --st: calc(var(--art-stage) * 2); }
.art .s4 { --st: calc(var(--art-stage) * 3); }
.art .s5 { --st: calc(var(--art-stage) * 4); }
.art .s6 { --st: calc(var(--art-stage) * 5); }
.art .s7 { --st: calc(var(--art-stage) * 6); }
.art .art-steps li:nth-child(2), .art .art-modes li:nth-child(2) { --st: calc(var(--art-stage) * 1.5); }
.art .art-steps li:nth-child(3), .art .art-modes li:nth-child(3) { --st: calc(var(--art-stage) * 3); }
.art .art-picto .art-icon:nth-child(2) { --st: calc(var(--art-step) * 2); }
.art .art-picto .art-icon:nth-child(3) { --st: calc(var(--art-step) * 4); }
.art .art-picto .art-icon:nth-child(4) { --st: calc(var(--art-step) * 6); }
.art .art-picto .art-icon:nth-child(5) { --st: calc(var(--art-step) * 8); }
.art .art-picto .art-icon:nth-child(6) { --st: calc(var(--art-step) * 10); }

@media (prefers-reduced-motion: no-preference) {
  .art [data-art].art-wait .l { stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; }
  .art [data-art].art-wait :is(.o, .g, .sq, .flow) { opacity: 0; }       /* the soft wash stays visible: a pale fill first, then the ink line traces over it (fewer things to animate) */
  .art [data-art].art-wait .swing { transform: rotate(16deg); }
  .art .art-steps[data-art].art-wait::before { transform: scaleX(0); }
  .art .art-steps--route[data-art].art-wait .art-truck { translate: 0 0; }

  .art [data-art].art-go .l {
    --d: calc(var(--st, 0ms) + var(--n, 0) * var(--art-step));
    stroke-dasharray: 1 2; stroke-dashoffset: 0; opacity: 1;
    transition: stroke-dashoffset var(--art-draw) var(--ease-out) var(--d), opacity 1ms linear var(--d);
  }
  .art [data-art].art-go :is(.o, .g, .sq, .flow) { transition: opacity var(--dur-fast) linear calc(var(--st, 0ms) + var(--art-draw)); }
  .art [data-art].art-go .swing { transition: transform 1100ms var(--spring-calm) calc(var(--st, 0ms) + var(--art-draw) * .4); }
  .art .art-steps[data-art].art-go::before { transition: transform calc(var(--art-draw) * 1.6) var(--ease-out); }
  .art .art-steps--route[data-art].art-go .art-truck { transition: translate calc(var(--art-draw) * 3) cubic-bezier(.45, 0, .25, 1) calc(var(--art-draw) * .8); }
}

/* loops that SHOW something moving (the dashes of an arrow): slow, small, only while the drawing is on screen (art.js sets .art-live) */
@keyframes art-march { to { stroke-dashoffset: -22; } }
@keyframes art-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.art [data-art-live] .flow { animation: art-march var(--art-flow) linear infinite; animation-play-state: paused; }
.art [data-art-live].art-live .flow { animation-play-state: running; }

/* ---------- Home page: the hero ---------- */
.art .hero > .container { position: relative; }
.art .hero::before {                          /* a quiet field of dots in the corner, faded out towards the middle */
  content: ''; position: absolute; top: 0; right: 0; width: min(52%, 640px); height: 100%; pointer-events: none;
  background-image: radial-gradient(circle, var(--art-dot) 1.2px, transparent 1.7px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(80% 95% at 100% 0%, #000, transparent 72%); mask-image: radial-gradient(80% 95% at 100% 0%, #000, transparent 72%);
}
.art .hero-index .art-scene--roof { max-width: 440px; margin: 6px auto 4px; }
.art .hero-index-item { grid-template-columns: 40px minmax(0, 1fr) auto; }
.art .hero-index-n { padding-top: 0; }

/* the capability strip: a small picture in front of each word */
.art .strip-inner a { gap: 8px; padding-left: 14px; }

/* the counts band: a picture for each count */
.art .fact { position: relative; }
.art .art-fact-art { position: absolute; top: 14px; right: clamp(16px, 3vw, 44px); }
.art .art-dots { width: clamp(64px, 11vw, 108px); height: auto; }
.art .art-picto { display: grid; grid-template-columns: repeat(var(--cols, 3), auto); gap: 6px 8px; justify-items: center; }

/* ---------- Home page: the software list (a picture for each group and each software) ---------- */
.art .software-group-title { align-items: center; }
.art .software-card {
  grid-template-columns: 34px 44px minmax(0, 1fr) auto; grid-template-areas: "n ic name go" ". ic line go"; align-items: center;
}
.art .software-card .feature-icon { display: grid; grid-area: ic; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 0; }
@media (max-width: 519px) {
  .art .software-card { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "ic name go" "ic line go"; }
  .art .software-card::before { display: none; }
}

/* the custom-development callout: three steps joined by a line */
.art .callout .art-steps { margin-top: 28px; }

/* ---------- Steps joined by a line (the callout, the route) ---------- */
.art .art-steps {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 480px; margin-top: 32px; list-style: none; padding: 0;
}
.art .art-steps::before {                     /* the line, behind the pictures; it grows from the left (transform only) */
  content: ''; position: absolute; left: calc(100% / 6); right: calc(100% / 6); top: 26px; height: 0; border-top: 1.5px solid var(--art-link); transform-origin: left center;
}
.art .art-steps li { position: relative; z-index: 1; display: grid; justify-items: center; align-content: start; gap: 8px; text-align: center; }
.art .art-step-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--art-bg); }
.art .art-step-t { font: 500 .72rem/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--art-label); }
.art .art-steps--route { container-type: inline-size; }
.art .art-steps--route .art-truck {           /* the truck drives along the line once; with no script it is already at the end */
  position: absolute; z-index: 2; top: 12px; left: calc(100% / 6 + 30px); width: 28px; height: 28px; translate: calc(100cqw * 2 / 3 - 92px) 0; pointer-events: none;
}
.art .art-steps--route .art-truck .art-icon { background: var(--art-bg); border-radius: 6px; }

/* ---------- Home page: enterprise cards and the trading offers ---------- */
.art .card-grid .feature-card .art-corner { position: absolute; top: 14px; right: 0; }
.art .card-grid .feature-card h3 { padding-right: 56px; }
.art .offer-list li { grid-template-columns: 48px minmax(0, 1fr); }
.art .offer-list li::before { display: none; }
.art .offer-list .feature-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 0; }
.art .trading-copy .art-steps { margin-top: 36px; }

/* ---------- Software page: the banner scene, the three kinds of shop, a picture for each item ---------- */
.art .software-banner .container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); column-gap: clamp(32px, 5vw, 80px); align-items: center; }
.art .software-banner .container > * { grid-column: 1; }
.art .software-banner .container > .art-scene { grid-column: 2; grid-row: 1 / span 5; justify-self: end; max-width: 460px; }
@media (max-width: 980px) {
  .art .software-banner .container { grid-template-columns: minmax(0, 1fr); }
  .art .software-banner .container > .art-scene { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 36px; max-width: 420px; }
}

.art .art-modes { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.art .art-modes li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.art .art-mode-ic { display: flex; align-items: center; gap: 6px; min-width: 176px; }
.art .art-modes .art-step-t { color: var(--ink); }
@media (min-width: 981px) {
  .art #about .container:has(> .art-modes) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); column-gap: clamp(40px, 6vw, 96px); align-items: start; }
  .art #about .section-head { grid-column: 1 / -1; }
  .art #about .prose { grid-column: 1; }
  .art #about .art-modes { grid-column: 2; grid-row: 2; }
}
@media (max-width: 980px) { .art #about .art-modes { margin-top: 32px; max-width: 520px; } }
@media (max-width: 519px) { .art .art-mode-ic { min-width: 0; } }

.art .check-list li .art-bullet { margin-top: -3px; }

/* small drawings in the corner of a section head: a tag by the prices, bubbles by the questions (no room for them on a phone), a message by the contact box */
.art #prices > .container, .art #faq > .container { position: relative; }
.art .art-scene--tag, .art .art-scene--bubbles { position: absolute; top: -4px; right: 0; width: 96px; }
.art .art-scene--bubbles { width: 108px; }
.art .art-scene--tag .swing { transform-origin: 77px 0; }
@media (min-width: 760px) { .art #prices .section-head, .art #faq .section-head { padding-right: 124px; } }   /* room for the drawing in the corner */
@media (max-width: 759px) { .art .art-scene--tag, .art .art-scene--bubbles { display: none; } }
.art .art-scene--plane { width: 132px; margin-top: 28px; }

/* ---------- Levels (ART_LEVEL in includes/art.php) ---------- */
.art[data-art-level="calm"] :is(.art-scene, .art-steps, .art-modes, .art-fact-art) { display: none; }
.art[data-art-level="calm"] .hero::before { display: none; }
.art[data-art-level="calm"] .software-banner .container, .art[data-art-level="calm"] #about .container { display: block; }   /* no empty column where a scene would be */
.art[data-art-level="lively"] :is(.software-banner, .facts, .callout) { position: relative; isolation: isolate; }
.art[data-art-level="lively"] :is(.software-banner, .facts, .callout)::before {      /* lively: the same quiet field of dots behind more sections */
  content: ''; position: absolute; z-index: -1; top: 0; right: 0; width: min(46%, 520px); height: 100%; border-radius: inherit; pointer-events: none;
  background-image: radial-gradient(circle, var(--art-dot) 1.2px, transparent 1.7px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(80% 95% at 100% 0%, #000, transparent 72%); mask-image: radial-gradient(80% 95% at 100% 0%, #000, transparent 72%);
}
.art[data-art-level="lively"] .spark { animation: art-twinkle 3.6s ease-in-out infinite; animation-play-state: paused; }
.art[data-art-level="lively"] [data-art-live].art-live .spark { animation-play-state: running; }

/* ---------- Windows high contrast, print (reduced motion needs no rules here: the movement above exists only under no-preference) ---------- */
@media (forced-colors: active) {
  .art .w, .art .sq { fill: none; }
  .art .art-icon, .art .art-scene { stroke: CanvasText; }
  .art .a, .art .g { stroke: Highlight; }
  .art .o { fill: CanvasText; }
  .art .g { fill: Highlight; }
}
@media print { .art .art-scene--tag, .art .art-scene--bubbles { display: none; } }
