/* Art direction: where each graphic slot sits, and the palettes of the alternate directions.
   Motif choice lives in scripts/art-direction.js; this file only owns placement, ink and motion. */

/* Slot plumbing --------------------------------------------------------------- */
:where(.home__intro,.home__use-cases,.home__early-access,.footer).has-gfx{
  position:relative;
}
:is(.home__intro,.home__use-cases,.home__early-access,.footer).has-gfx{
  isolation:isolate;
}
.gfx--slot{
  opacity:0;
  transition:opacity 1.1s cubic-bezier(.25,.46,.45,.94);
}
.gfx--slot.is-inview{opacity:var(--gfx-opacity,1)}
.gfx--slot.is-empty{display:none}
.gfx--slot[hidden]{display:none}
/* art-direction.js `keep`: the slots that stay when the rest of the graphics are off */
:root[data-visuals="off"] .gfx:not([data-gfx-slot="hero-title"],[data-gfx-slot="tracks-back"],[data-gfx-slot="schedule-ribbon"],[data-gfx-slot="faq-question"],[data-gfx-slot="final-goo"],[data-gfx-slot="footer-back"]){display:none}
@keyframes gfx-spin{to{rotate:360deg}}
.gfx--slot[data-gfx-motion] svg{animation:gfx-spin 240s linear infinite paused;transform-origin:50% 50%}
.gfx--slot[data-gfx-motion="spin-slow"] svg{animation-duration:420s}
.gfx--slot[data-gfx-motion].is-inview svg{animation-play-state:running}
@media (prefers-reduced-motion:reduce){
  .gfx--slot{transition:none}
  .gfx--slot[data-gfx-motion] svg{animation:none}
}

/* Hero -------------------------------------------------------------------------- */
[data-gfx-slot="hero-back"]{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-surface);
  --gfx-opacity:.6;
  bottom:0;
  height:66%;
  left:0;
  position:absolute;
  right:0;
  z-index:-1;
}
/* terrain floor: humps rise either side of the title, the saddle sits under the button */
[data-gfx-slot="hero-back"][data-gfx-layout="floor"]{
  bottom:-46%;
  height:auto;
  top:50%;
}
[data-gfx-slot="hero-back"][data-gfx-layout="center"]{
  --gfx-opacity:.5;
  bottom:auto;
  height:min(150vh,118vw);
  left:60%;
  right:auto;
  top:34%;
  translate:-50% -50%;
  width:min(150vh,118vw);
}
/* Title: the drape's face sits exactly on the h1 (1em = the h1's size; 268 = the drape's glyph size),
   and its echoes spill out of the box on every side. The h1 text stays for
   layout and screen readers but is not painted. */
.home__hero-text h1:has([data-gfx-slot="hero-title"]){position:relative}
/* Unpainted from the first frame, not only once the graphic has mounted (it waits for the display
   face): otherwise the word shows in the ink, then fades out on the h1's colour transition.
   [data-ad] is set by art-direction.js from <head>, so without scripts the text still shows. */
:root[data-ad] .home__hero-text h1:has([data-gfx-slot="hero-title"]) .split-word,
.home__hero-text h1:has([data-gfx-slot="hero-title"].is-mounted) .split-word{color:transparent;transition:none}
/* the word answers presses (graphics.js, the pluck): quick ones must not select its unpainted text */
.home__hero-text h1:has([data-gfx-slot="hero-title"].is-mounted){-webkit-user-select:none;user-select:none}
[data-gfx-slot="hero-title"]{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-surface);
  --gfx-w:.8px;
  /* the drape's box (art-direction.js: w 1800, h 392, size 268) hangs 52 units below the h1
     to hold the g's descender */
  bottom:calc(-1em*52/268);
  height:calc(1em*392/268);
  left:50%;
  position:absolute;
  translate:-50% 0;
  width:calc(1em*1800/268);
  z-index:-1;
}
[data-gfx-slot="hero-title"] svg{overflow:visible}
/* raster mount (scripts/graphics.js mountRaster): the title is a painted mask filled with the ink */
.gfx-raster{
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-size:100% 100%;mask-size:100% 100%;
  background-color:var(--gfx-ink);
  pointer-events:none;
  position:absolute;
}
/* scroll-following mount (scripts/graphics.js mountFollow): the title's echoes on one canvas laid
   in the document (sized and slid along by the script, so it scrolls with the page). z-index 1
   puts it under .home__top-hero (z-index 2), so everything on the first stage paints over it: the
   light cards hide it, and the stage panels, being transparent, let it through. Nothing on that
   stage may repaint the stage colour (see home.css, Stage fills). */
.gfx-follow{
  left:0;
  pointer-events:none;
  position:absolute;
  top:0;
  z-index:1;
}
/* the title is there on arrival: no fade-in */
[data-gfx-slot="hero-title"].gfx--slot{opacity:1;transition:none}
[data-gfx-slot="hero-title"] svg text{font-weight:800}

[data-gfx-slot^="hero-corner"]{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-surface);
  --gfx-opacity:.85;
  bottom:calc(40*var(--dp));
  height:calc(26*var(--dp));
  position:absolute;
  width:calc(220*var(--dp));
  z-index:0;
}
[data-gfx-slot="hero-corner-l"]{left:calc(40*var(--dp))}
[data-gfx-slot="hero-corner-r"]{height:calc(60*var(--dp));right:calc(40*var(--dp));width:calc(60*var(--dp))}
[data-gfx-slot^="hero-corner"][data-gfx-layout="tall"]{height:calc(110*var(--dp));width:calc(90*var(--dp))}
[data-gfx-slot^="hero-corner"][data-gfx="glyph"]{height:calc(50*var(--dp));width:calc(50*var(--dp))}

/* Intro ------------------------------------------------------------------------- */
.home__intro.has-gfx{overflow:clip}
[data-gfx-slot="intro-side"]{
  --gfx-ink:var(--current-color-100);
  --gfx-bg:var(--current-color-10);
  --gfx-opacity:.58;
  --gfx-w:1px;
  height:calc(640*var(--dp));
  position:absolute;
  /* bleeds off the right edge; only the strip beside the copy shows */
  right:calc(-460*var(--dp));
  top:50%;
  translate:0 -50%;
  width:calc(640*var(--dp));
  z-index:-1;
}
[data-gfx-slot="intro-side"][data-gfx="ribbed"]{height:calc(440*var(--dp));right:calc(-440*var(--dp));top:60%;width:calc(640*var(--dp))}
[data-gfx-slot="intro-side"][data-gfx-layout="bleed"]{
  --gfx-opacity:.5;
  height:100%;
  right:0;
  width:36%;
}
/* a tall figure standing in the right margin, clear of the copy */
[data-gfx-slot="intro-side"][data-gfx-layout="tall"]{
  --gfx-opacity:.82;
  height:86%;
  right:4%;
  width:30%;
}

/* Tracks ------------------------------------------------------------------------ */
/* The graphic covers the section's own ground: the pinned card and a section gap above and below
   it. In a tall window the stack's box is taller than that and runs under the sections on either
   side (home.css, vertical rhythm); the graphic stops short of them. */
[data-gfx-slot="tracks-back"]{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-surface);
  --gfx-opacity:.6;
  --tracks-overlap-top:max(0px,calc(var(--tracks-bleed-top,var(--tracks-bleed)) - var(--space-section)));
  --tracks-overlap:max(0px,calc(var(--tracks-bleed-bottom,var(--tracks-bleed)) - var(--space-section)));
  inset:var(--tracks-overlap-top) 0 var(--tracks-overlap);
  position:absolute;
  z-index:0;
}
[data-gfx-slot="tracks-back"][data-gfx-layout="floor"]{inset:30% 0 var(--tracks-overlap)}
[data-gfx-slot="tracks-back"]:is([data-gfx="turing"],[data-gfx="topo"]){--gfx-opacity:.34}
/* live contour map (scripts/graphics.js mountLive): one canvas filling the pinned stage. It shows
   and hides itself from the scroll position, so the slot does not fade it in. */
[data-gfx-slot="tracks-back"][data-gfx="contours"]{
  --gfx-opacity:.4;
  --gfx-w:1px;
  /* the map fills the pinned stage edge to edge (the stage is the window while pinned), rather
     than stopping a section gap short like the other tracks graphics */
  inset:0;
  transition:none;
}
.gfx-live{display:block;height:100%;width:100%}
.gfx--card{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-color-10);
  --gfx-w:1.1px;
  height:calc(190*var(--dp));
  position:absolute;
  right:calc(24*var(--dp));
  top:calc(24*var(--dp));
  width:calc(190*var(--dp));
  z-index:0;
}
.gfx--card[data-gfx-layout="row"]{
  height:calc(54*var(--dp));
  left:calc(60*var(--dp));
  right:auto;
  top:calc(60*var(--dp));
  width:calc(260*var(--dp));
}
.gfx--card[data-gfx="glyph"]{height:calc(90*var(--dp));right:calc(40*var(--dp));top:calc(40*var(--dp));width:calc(90*var(--dp))}

/* Schedule ---------------------------------------------------------------------- */
[data-gfx-slot="schedule-back"]{
  --gfx-ink:var(--current-color-40);
  --gfx-opacity:.3;
  --gfx-w:1px;
  height:calc(720*var(--dp));
  left:0;
  position:absolute;
  top:0;
  width:100%;
  z-index:-1;
}
/* The ribbon (scripts/graphics.js, mountRibbon): the host covers the schedule's stage, which is
   the window while the days run, so the band bleeds off both edges; the canvas inside it is
   placed over the rail of the days' track. Hidden lines are cut out of the canvas, not painted
   over, so nothing here repaints the stage. Its lines sit at the same strength as the contour
   map above it (tracks-back, --gfx-opacity) and the goo below it (final-goo, --goo-opacity):
   the same ink at the same opacity. */
[data-gfx-slot="schedule-ribbon"]{
  --gfx-ink:var(--current-color-40);
  --gfx-opacity:.4;
  --gfx-w:1px;
  inset:0;
  position:absolute;
  z-index:0;
}
[data-gfx-slot="schedule-ribbon"] .gfx-live{
  left:0;
  position:absolute;
}

/* Venue ------------------------------------------------------------------------- */
[data-gfx-slot="venue-back"]{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-color-100);
  --gfx-opacity:.5;
  height:calc(720*var(--dp));
  position:absolute;
  right:calc(-80*var(--dp));
  top:calc(20*var(--dp));
  width:calc(720*var(--dp));
  z-index:-1;
}
[data-gfx-slot="venue-back"][data-gfx="topo"]{--gfx-opacity:.28;height:100%;right:0;top:0;width:100%}
/* the graphics inside the two cards (named, so the pieces round the cards are not caught) */
:is([data-gfx-slot="venue-left"],[data-gfx-slot="venue-right"]){
  --gfx-ink:var(--current-color-100);
  --gfx-bg:var(--current-color-40);
  --gfx-opacity:.5;
  --gfx-w:1px;
  inset:42% 0 0;
  position:absolute;
  z-index:0;
}
[data-gfx-slot="venue-left"]{--gfx-bg:var(--current-color-20)}
.home__early-access__content :is(h3){position:relative;z-index:1}

/* FAQ --------------------------------------------------------------------------- */
[data-gfx-slot="faq-back"]{
  --gfx-ink:var(--current-color-100);
  --gfx-bg:var(--current-color-10);
  --gfx-opacity:.3;
  --gfx-w:1px;
  height:calc(900*var(--dp));
  left:0;
  position:absolute;
  top:0;
  width:100%;
}
/* the question mark: the goo's ink, weight and fill (final-goo, below), drawn stronger against the
   light panel; its dot takes the same strength while it is docked (art-direction.js, dock.light) */
[data-gfx-slot="faq-question"]{
  --gfx-ink:var(--current-color-40);
  --gfx-opacity:1;
  --gfx-w:1px;
  --gfx-heavy:1;
  --goo-fill:var(--current-surface);
  --goo-opacity:.85;
  aspect-ratio:360/440;
  left:0;
  position:absolute;
  top:0;
  width:100%;
}

/* Final call and footer --------------------------------------------------------- */
[data-gfx-slot="final-back"]{
  --gfx-ink:var(--current-color-40);
  --gfx-bg:var(--current-color-100);
  --gfx-opacity:.8;
  --gfx-w:1px;
  bottom:calc(50% + calc(170*var(--dp)));
  height:calc(50% - calc(130*var(--dp)));
  left:50%;
  position:absolute;
  translate:-50% 0;
  width:min(calc(960*var(--dp)),92vw);
}
/* hangs from the top edge of the closing section, above the headline */
[data-gfx-slot="final-back"][data-gfx-layout="hang"]{
  --gfx-opacity:.75;
  bottom:auto;
  height:min(calc(640*var(--dp)),80vw);
  left:50%;
  top:calc(-.62*min(calc(640*var(--dp)),80vw));
  translate:-50% 0;
  width:min(calc(640*var(--dp)),80vw);
  clip-path:inset(62% 0 0 0);
}
[data-gfx-slot="final-back"][data-gfx-layout="rise"]{
  --gfx-opacity:.7;
  bottom:calc(-1*min(calc(460*var(--dp)),44vw));
  height:min(calc(920*var(--dp)),88vw);
  left:50%;
  translate:-50% 0;
  width:min(calc(920*var(--dp)),88vw);
}
[data-gfx-slot="final-back"][data-gfx-layout="center"]{
  --gfx-opacity:.4;
  bottom:auto;
  height:min(120vh,96vw);
  top:50%;
  translate:-50% -50%;
  width:min(120vh,96vw);
}
/* Sliced goo in orbit inside the closing section: one canvas filling the section (a full window),
   under its words (the wrapper above it is z-index 1). The bodies go round the words, in the open
   ground between them and the section's edges. Its font size is the scene's scale at most, in
   units of 1em/100: the scene is scaled down from it until the largest body about fits the
   narrowest strip of that ground (scripts/graphics.js, measureGoo), so on most windows the strip,
   not this number, sets the size. The lines match the tracks' contour map: the same ink,
   --goo-opacity as its --gfx-opacity, and its 1px weight (--gfx-heavy 1); round the pointer they
   brighten to --goo-glow. --goo-fill: the bodies are filled with the stage's own colour (the token
   body paints, not a copy of it), so where they pass over the footer's boiling edge they cover it
   and read as in front of it; everywhere else the fill is the stage itself and does not show. */
[data-gfx-slot="final-goo"]{
  --goo-fill:var(--current-surface);
  /* the canvas hangs --goo-overhang (set on .home__bot-hero, home.css) below the section, over
     the footer, so a body passing the section's bottom edge is drawn whole over the footer instead
     of cut off there; the bodies still orbit inside the section (graphics.js, measureGoo `room`) */
  pointer-events:none;
  --gfx-ink:var(--current-color-40);
  --gfx-opacity:1;
  --gfx-w:1px;
  --gfx-heavy:1;
  --goo-opacity:.4;
  --goo-glow:.8;
  font-size:calc(100*var(--dp));
  inset:calc(-1*var(--goo-overreach,0px)) 0 calc(-1*var(--goo-overhang));
  position:absolute;
  transition:none;
  z-index:0;
}
/* the goo's own pointer states (set on the root by scripts/graphics.js pointGoo): a body under
   the pointer can be picked up; while one is held, or one is being painted (a brush, so a
   crosshair), nothing on the page is selected by the drag */
:root.goo-grab body{cursor:grab}
:root.goo-grabbing,
:root.goo-grabbing *{
  cursor:grabbing!important;
  -webkit-user-select:none;
  user-select:none;
}
:root.goo-painting,
:root.goo-painting *{cursor:crosshair!important}
/* The footer's boiling edge (scripts/graphics.js, mountBoil): a strip of the stage standing on
   the footer's top edge. The footer's surface boils up into it (filled with the footer's own
   colour, read from the footer), and contour lines ripple out from that surface across the stage,
   in the same ink and weight as the tracks' contour map and the goo above it, but fainter
   (--boil-line), so the goo leads. The strip reaches --boil-sink down into the footer, so its fill joins the footer with no
   seam; the script sizes the bubbles in design pixels from the strip's height (230 of them). */
[data-gfx-slot="footer-edge"]{
  --gfx-ink:var(--current-color-40);
  --gfx-opacity:1;
  --gfx-w:1px;
  --boil-line:.22;
  --boil-sink:8px;
  bottom:calc(100% - var(--boil-sink));
  height:calc(230*var(--dp) + var(--boil-sink));
  left:0;
  pointer-events:none;
  position:absolute;
  right:0;
  transition:none;
  z-index:0;
}
[data-gfx-slot="footer-back"]{
  --gfx-ink:var(--current-color-100);
  --gfx-bg:var(--current-color-20);
  --gfx-opacity:.42;
  --gfx-w:1px;
  bottom:calc(-80*var(--dp));
  height:calc(400*var(--dp));
  left:34%;
  position:absolute;
  width:calc(560*var(--dp));
  z-index:-1;
}
[data-gfx-slot="footer-back"][data-gfx-layout="rule"]{
  --gfx-opacity:.7;
  bottom:calc(32*var(--dp));
  height:calc(20*var(--dp));
  left:calc(40*var(--dp));
  right:calc(40*var(--dp));
  width:auto;
}
[data-gfx-slot="footer-back"][data-gfx-layout="wash"]{--gfx-opacity:.24;inset:0;height:auto;width:auto}
/* A still contour map standing on the page's bottom edge, in the footer's dark ink, faint enough to
   read as a tone of the lime. Its hills rise in the empty ground between and beside the columns
   (art-direction.js places them), and the flat ground under the words has no lines. */
[data-gfx-slot="footer-back"][data-gfx-layout="ground"]{
  --gfx-opacity:.22;
  bottom:0;
  height:calc(280*var(--dp));
  left:0;
  transition:none;
  width:100%;
}

/* Section tags -------------------------------------------------------------------- */
.gfx--tag{
  --gfx-ink:currentColor;
  --gfx-w:1.2px;
  --gfx-heavy:1;
  display:inline-block;
  height:calc(15*var(--dp));
  margin-right:calc(8*var(--dp));
  opacity:1;
  vertical-align:middle;
  width:calc(15*var(--dp));
}
.section-intro__tag .gfx--tag svg{height:100%;margin:0;width:100%}

@media (max-width:768px){
  [data-gfx-slot="hero-back"][data-gfx-layout="floor"]{top:54%}
  [data-gfx-slot="intro-side"]{--gfx-opacity:.32;height:calc(440*var(--dp));right:calc(-200*var(--dp));width:calc(440*var(--dp))}
  [data-gfx-slot="intro-side"][data-gfx-layout="tall"]{display:none}
  [data-gfx-slot^="hero-corner"]{display:none}
  [data-gfx-slot="venue-back"]{height:calc(400*var(--dp));right:calc(-140*var(--dp));width:calc(400*var(--dp))}
  .gfx--card{height:calc(110*var(--dp));right:calc(12*var(--dp));top:calc(12*var(--dp));width:calc(110*var(--dp))}
  .gfx--card[data-gfx-layout="row"]{height:calc(36*var(--dp));left:calc(30*var(--dp));top:calc(30*var(--dp));width:calc(170*var(--dp))}
  [data-gfx-slot="footer-back"]{left:10%}
  /* a phone keeps the map at its desktop proportions and shows its right-hand end */
  [data-gfx-slot="footer-back"][data-gfx-layout="ground"]{left:auto;right:0;width:calc(1440*var(--dp))}
}

/* Direction 2 - Acid Terminal: one lime on near-black, lime paper for light sections --- */
:root[data-ad="acid"]{
  --green-10:#e9ff9c;--green-20:#d6ff57;--green-40:#c6ff3d;--green-tone:#070905;
  --purple-10:#e9ff9c;--purple-20:#d6ff57;--purple-40:#c6ff3d;--purple-tone:#070905;
  --blue-10:#e9ff9c;--blue-20:#d6ff57;--blue-40:#c6ff3d;--blue-tone:#070905;
  --pink-10:#e9ff9c;--pink-20:#d6ff57;--pink-40:#c6ff3d;--pink-tone:#070905;
  --peri-olive:#9fd61f;
}
:root[data-ad="acid"] .gfx{--gfx-w:1.1px}
/* lime cards on lime ink would vanish: card graphics switch to the dark tone */
:root[data-ad="acid"] .gfx--card{--gfx-ink:var(--current-color-100)}
:root[data-ad="acid"] [data-gfx-slot="hero-back"][data-gfx-layout="center"],
:root[data-ad="organism"] [data-gfx-slot="hero-back"][data-gfx-layout="center"]{--gfx-opacity:.42}

/* Direction 3 - Soft Organism: mint and ultraviolet ------------------------------------ */
:root[data-ad="organism"]{
  --green-10:#e3fbec;--green-20:#bdf6d2;--green-40:#52ff95;--green-tone:#082015;
  --pink-10:#e3fbec;--pink-20:#bdf6d2;--pink-40:#52ff95;--pink-tone:#082015;
  --purple-10:#efe9ff;--purple-20:#d6c8ff;--purple-40:#8f5cff;--purple-tone:#170b33;
  --blue-10:#efe9ff;--blue-20:#d6c8ff;--blue-40:#8f5cff;--blue-tone:#170b33;
  --peri-olive:#1fbf63;
}

/* Preview switcher (design tool; disable with `switcher:false` in scripts/art-direction.js) */
.ad-switcher{
  background:#0b0b0b;
  border:1px solid #3a3a3a;
  border-radius:var(--radius);
  bottom:calc(16*var(--dp));
  color:#f4f4f4;
  left:calc(16*var(--dp));
  max-width:calc(100vw - calc(32*var(--dp)));
  padding:calc(12*var(--dp));
  position:fixed;
  width:calc(300*var(--dp));
  z-index:1000;
}
.ad-switcher__title,.ad-switcher__note,.ad-switcher__lab,.ad-switcher button{
  font-family:var(--font-system)!important;
  font-size:var(--text-xs);
  letter-spacing:.04em;
}
.ad-switcher__title{margin:0 0 calc(8*var(--dp));opacity:.6;text-transform:uppercase}
.ad-switcher__choices{display:grid;gap:calc(4*var(--dp))}
.ad-switcher button{
  align-items:center;
  background:transparent;
  border:1px solid #3a3a3a;
  border-radius:var(--radius);
  color:inherit;
  cursor:pointer;
  display:flex;
  gap:calc(10*var(--dp));
  min-height:calc(36*var(--dp));
  padding:0 calc(10*var(--dp));
  text-align:left;
  text-transform:uppercase;
}
.ad-switcher button span{font-family:var(--font-system)!important;opacity:.55}
.ad-switcher button[aria-pressed="true"]{background:#f4f4f4;border-color:#f4f4f4;color:#0b0b0b}
.ad-switcher__note{line-height:1.4;margin:calc(10*var(--dp)) 0 calc(8*var(--dp));opacity:.72}
.ad-switcher__lab{color:inherit}
@media (max-width:768px){.ad-switcher{display:none}}
