/* Bear James: the landing page. Watercolor spots bleed onto the paper (the big blue one in the
   middle first, then the others around the edge), and the logo fades gently into the blue, with
   links to Tall Tales U.S.A. and The Ice Machine under it (the logo itself isn't a link).
   Worked out in splash-lab/; the old navy page with the logo drawing itself is in archive/. */
:root { --paper: #f4ecdc; --navy: #14213d; --gold: #e9b92f; --texture: url('../talltales/images/gray-watercolor-texture.jpg'); }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--navy); font: 500 16px/1.4 'Jost', 'Futura', 'Avenir Next', sans-serif; }
.bj-home { position: relative; height: 100vh; height: 100dvh; overflow: hidden; container-type: size; isolation: isolate; background: var(--paper); }
/* ---- The sheet: everything is printed on one sheet of paper, the same gray watercolor the Tall Tales
   map is printed on (in Multiply, a little lighter than the map so the colors stay bright). --tex is how big that print is: it covers the
   window, and the spots below are painted on the very same print, so the paper's grain runs through
   the paint and everything scales together. ---- */
.bj-home { --tex: max(100cqw, 100cqh); }
.bj-home::before { content: ''; position: absolute; inset: 0; background: var(--texture) center / var(--tex) no-repeat; mix-blend-mode: multiply; opacity: .2; filter: brightness(1.18) contrast(1.35); }

/* ---- The spots: where (--x, --y: the center, in percent of the window), how big (--s), what color
   (--c), its shape (one of images/spots/, drawn by source/make-spots.py, set below) and when (--d). Each
   one soaks outward from --ox, --oy until it fills its shape, like paint spreading into the paper. Spots that run into the blue lie over it
   in Multiply, so the overlaps mix darker. ---- */
@property --bj-wet { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.bj-spots i { position: absolute; left: calc(var(--x) * 1cqw - var(--s) / 2); top: calc(var(--y) * 1cqh - var(--s) / 2); width: var(--s); height: var(--s);
  opacity: .82; mix-blend-mode: multiply; }
.bj-spots i::before { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--c) var(--texture); background-blend-mode: multiply; background-size: var(--tex);
  background-position: calc(50cqw - var(--tex) / 2 - var(--x) * 1cqw + var(--s) / 2) calc(50cqh - var(--tex) / 2 - var(--y) * 1cqh + var(--s) / 2);
  box-shadow: inset 0 0 5cqmin rgba(80, 20, 40, .35); filter: brightness(1.12) saturate(1.15);
  --wet: radial-gradient(ellipse calc(var(--bj-wet) * .75) calc(var(--bj-wet) * .75) at var(--ox, 50%) var(--oy, 50%), #000 70%, transparent);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-composite: source-in; mask-composite: intersect;
  animation: bj-bleed 1.6s cubic-bezier(.2, .7, .3, 1) var(--d) forwards; }
@keyframes bj-bleed { to { --bj-wet: 110%; } }
.bj-blue    { --x: 50; --y: 50; --s: 74cqmin;  --c: #4f78b8; --d: .1s; --oy: 52%; opacity: .92 !important; mix-blend-mode: normal !important; }
.bj-gold    { --x: 4;  --y: 42; --s: 100cqmin; --c: #e9b92f; --d: .35s; --ox: 54%; }
.bj-teal    { --x: 21; --y: 5;  --s: 22cqmin;  --c: #4fa9a0; --d: .5s; --oy: 56%; }
.bj-green   { --x: 91; --y: 13; --s: 30cqmin;  --c: #7fb07a; --d: .6s; --ox: 46%; }
.bj-red     { --x: 80; --y: 40; --s: 44cqmin;  --c: #d94a6e; --d: .7s; --oy: 55%; }
.bj-scarlet { --x: 5;  --y: 80; --s: 28cqmin;  --c: #d8402c; --d: .8s; --ox: 55%; }
.bj-gold2   { --x: 17; --y: 95; --s: 18cqmin;  --c: #e9b92f; --d: .9s; }
.bj-orange  { --x: 91; --y: 85; --s: 38cqmin;  --c: #ee8a3c; --d: 1s; --oy: 46%; }
.bj-purple  { --x: 76; --y: 97; --s: 24cqmin;  --c: #8a6bb8; --d: 1.1s; --oy: 58%; }
/* each spot's shape. Written out here, not passed in a variable, so the address is read from this file
   (a url() inside a variable is read from the page in some browsers) */
.bj-blue::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-1.svg'); mask-image: var(--wet), url('../images/spots/spot-1.svg'); }
.bj-gold::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-2.svg'); mask-image: var(--wet), url('../images/spots/spot-2.svg'); }
.bj-teal::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-3.svg'); mask-image: var(--wet), url('../images/spots/spot-3.svg'); }
.bj-green::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-4.svg'); mask-image: var(--wet), url('../images/spots/spot-4.svg'); }
.bj-red::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-5.svg'); mask-image: var(--wet), url('../images/spots/spot-5.svg'); }
.bj-scarlet::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-6.svg'); mask-image: var(--wet), url('../images/spots/spot-6.svg'); }
.bj-gold2::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-7.svg'); mask-image: var(--wet), url('../images/spots/spot-7.svg'); }
.bj-orange::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-8.svg'); mask-image: var(--wet), url('../images/spots/spot-8.svg'); }
.bj-purple::before { -webkit-mask-image: var(--wet), url('../images/spots/spot-9.svg'); mask-image: var(--wet), url('../images/spots/spot-9.svg'); }
/* on a tall screen (a phone) the blue and the red are bigger, and the big gold and the red move out
   to the edges so they only touch the blue */
@container (aspect-ratio < 1) {
  .bj-gold { --x: -10; --y: 28; --s: 90cqmin; }
  .bj-red  { --x: 100; --y: 68; --s: 62cqmin; }
  .bj-blue { --s: 90cqmin; }
}

/* ---- The logo appears gently as the blue spreads: each piece fades in, one after another (--d),
   with no outline drawn first ---- */
.bj-logo { position: absolute; left: 50%; top: 50%; width: 36cqmin; margin: -21cqmin 0 0 -18cqmin; line-height: 0; }
.bj-logo svg { width: 100%; height: auto; overflow: visible; }
.bj-logo path { fill: var(--paper); opacity: 0; animation: bj-appear 1.1s ease forwards; animation-delay: calc(.8s + var(--d, 0s)); }
@keyframes bj-appear { to { opacity: 1; } }
.bj-logo path:nth-child(1) { --d: 0.00s; }
.bj-logo path:nth-child(2) { --d: 0.06s; }
.bj-logo path:nth-child(3) { --d: 0.12s; }
.bj-logo path:nth-child(4) { --d: 0.18s; }
.bj-logo path:nth-child(5) { --d: 0.24s; }
.bj-logo path:nth-child(6) { --d: 0.30s; }
.bj-logo path:nth-child(7) { --d: 0.36s; }
.bj-logo path:nth-child(8) { --d: 0.42s; }
.bj-logo path:nth-child(9) { --d: 0.48s; }
.bj-logo path:nth-child(10) { --d: 0.54s; }
.bj-logo path:nth-child(11) { --d: 0.60s; }
.bj-logo path:nth-child(12) { --d: 0.66s; }
.bj-logo path:nth-child(13) { --d: 0.72s; }
.bj-logo path:nth-child(14) { --d: 0.78s; }
.bj-logo path:nth-child(15) { --d: 0.84s; }

/* ---- The links, in the blue under the logo ---- */
.bj-links { position: absolute; left: 50%; top: calc(50% + 15.5cqmin); translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: .7em;
  font-size: clamp(12px, 1.8cqmin, 17px); opacity: 0; animation: bj-fade .8s ease 2.5s forwards; }
.bj-links a { color: var(--paper); text-decoration: none; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.bj-links a span { display: inline-block; margin-left: .35em; transition: transform .2s ease; }
.bj-links a:hover { border-bottom-color: currentColor; }
.bj-links a:hover span { transform: translateX(.3em); }
@keyframes bj-fade { to { opacity: 1; } }

/* on a phone: the logo a little smaller and higher, the links closer, so both stay in the blue */
@container (aspect-ratio < 1) {
  .bj-logo { width: 38cqmin; margin: -25.5cqmin 0 0 -19cqmin; }
  .bj-links { top: calc(50% + 12cqmin); gap: .6em; }
}

@media (prefers-reduced-motion: reduce) {
  .bj-spots i::before { animation: none; --bj-wet: 110%; }
  .bj-logo path { animation: none; opacity: 1; }
  .bj-links { animation: none; opacity: 1; }
}
