/* Every colour, size and duration on the site lives here. Colours are the First Light mockup's. */
:root {
  --ink: #070912;
  --night: #0e1222;
  --haze: #9ea6cc;
  --mist: #d7dcf2;
  --paper: #f5efe3;
  --amber: #ffbe5c;
  --amber-deep: #f0a040;
  --brass: #c9a35c;
  --enamel: #efe6cf;
  --enamel-ink: #1b2031;
  --moon: #9ad8ff;

  /* the sky drawn behind the paintings: their own top colour, a shade deeper overhead */
  --sky-top: #303d6a;
  --sky-mid: #33437a;
  --sky-low: #3a4e8b;
  --filament: #ffe6bd;    /* the wordmark, lit */
  --tagline-ink: #efeafc;
  --story-ink: #e3e0f2;
  /* a filament warming up, from cold to nearly lit */
  --ember-cold: #6b3414;
  --ember-dull: #8a4318;
  --ember: #b8642a;
  --ember-bright: #f0a55a;
  --ember-hot: #ffc983;

  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* type scale */
  --wordmark: clamp(34px, 11.2vw, 132px);
  --wordmark-track: 0.26em;
  --tagline: clamp(19px, 2.6vw, 34px);
  --kind: clamp(12px, 1.05vw, 14px);
  --heading: clamp(34px, 4.6vw, 64px);
  --story: clamp(20px, 2.1vw, 28px);
  --kind-track: 0.24em;

  /* how far a layer drifts over one screen of scroll, as a share of the scene's height */
  --drift-far: 4.5%;      /* how far the furthest layer hangs back */
  --drift-near: 7%;       /* how far the nearest layer rises ahead */
  /* how far the pointer can push the nearest layer, in px */
  --pointer-reach: 14px;

  /* durations */
  --warm-up: 1250ms;      /* one letter's filament warm-up; the whole opening stays under 2 s */
  --warm-step: 55ms;      /* each letter starts this long after the one before */
  --dawn: 1400ms;         /* a late picture fading up out of the night */
  --lamp-on: 460ms;       /* the opening: the powerhouse windows flicker on... */
  --spread: 1700ms;       /* ...and their light spreads over the valley */
  --finale-step: 460ms;   /* the finale: the wire's run from one job to the next... */
  --finale-breath: 800ms; /* ...the held breath before the Bell Tower... */
  --finale-spread: 700ms; /* ...a job's light spreading round its lamp... */
  --finale-fill: 1300ms;  /* ...and every light growing on until the whole valley is lit */
  --plaque-rise: 900ms;
  --line-draw: 3400ms;    /* the line running across its hillside, pole to pole */
  --line-rest: 4500ms;    /* then, between one pulse of current along it and the next */
  --line-pulse: 1600ms;   /* and a pulse running its length */
  --paint-in: 900ms;      /* a frame being painted in as it comes onto the screen */
  --words-in: 800ms;      /* its words arriving, and the mark under the heading drawing itself */
  --light-up: 1100ms;     /* a stop lighting: the light spreading from its lamp */
  --rise: 1400ms;         /* the sky and the leaves coming up with it */
  --fade: 600ms;
  --wind: 9s;             /* one round of the wind: the leaves' sway, and the gusts that carry the petals (js/wind.js) */
  --cloud-a: 80s;
  --cloud-b: 110s;
  --mist-a: 44s;
  --mist-b: 62s;
  --breathe: 7s;          /* one round of the powerhouse lamps wavering */
  --current: 6s;          /* one round of the current: along the wire, down the cable, off the screen */

  --text-shadow: 0 1px 14px rgba(7, 9, 18, 0.55), 0 0 2px rgba(7, 9, 18, 0.5);
  --glow: 0 0 28px rgba(255, 190, 92, 0.46), 0 0 70px rgba(255, 170, 70, 0.22);
  --gutter: clamp(20px, 5vw, 72px);
  /* the journey below the first screen */
  --stop-gap: clamp(64px, 12vh, 132px);      /* the calm dark between two frames, where the words sit */
  --band-gap: clamp(40px, 8vh, 96px);
  --words-gap: clamp(28px, 5vh, 56px);       /* between a scene's words and its frame */
  --band-max: 660px;                         /* the one framed strip of hillside */
  --painting-max: 680px;                     /* a stop's painting, where it is not the full width */
  --painting-side: min(88vh, 64vw);          /* its height where it stands beside its words */
  --measure: 34em;                           /* the widest a stop's words run; beside a painting; a band's caption */
  --measure-side: 30em;
  --measure-caption: 22em;
  --ground-shadow: rgba(7, 9, 18, 0.5);      /* under a pole's foot */
  --lamp-pool: rgba(255, 190, 92, 0.3);      /* a lit lamp's pool of light in the night air, near and far */
  --lamp-pool-far: rgba(255, 170, 70, 0.1);
  --lamp-reach: linear-gradient(to bottom, #000 0%, #000 17%, transparent 34%);      /* how far down a pole its lamp lights it */
  /* the boards, and along the way */
  --board-max: 400px;                        /* a board under its painting */
  --board-least: 260px;                      /* the narrowest a board is made: its pieces stay big enough for a thumb */
  --house-least: 150px;                      /* the least a house's window on its painting is given above its board */
  --board-over: 14px;                        /* how far a board stands over the foot of its house */
  --half-gap: 8px;                           /* between a half's name and the board */
  --half-portrait: 24px;
  --half-label: 12.5px;
  --board-max-side: 380px;                   /* a board beside its painting: never wider than this, */
  --board-min: 280px;                        /* never so narrow a thumb cannot use it, */
  --play-h: 66vh;                            /* and with its painting no taller than this */
  --painting-play: min(var(--play-h), 46vw);
  --bench-gap: clamp(14px, 2.6vh, 24px);
  --portrait: clamp(34px, 9.5vw, 44px);
  --plate-text: clamp(15px, 4.2vw, 18px);
  --star: clamp(34px, 9vw, 44px);
  --thing: clamp(52px, 14.5vw, 72px);
  --finds-gap: clamp(10px, 3vw, 18px);
  --finds-max: 1040px;                       /* the three parts of "along the way", side by side */
  --find-gap: clamp(30px, 6vh, 48px);        /* between two parts, one under another */
  --find-inner: 16px;                        /* between a part's pictures and its line */
  --portrait-big: clamp(40px, 11vw, 52px);
  --crew-gap: clamp(6px, 1.6vw, 10px);
  --half-clear: 10px;                        /* between a house's foot and the name over its board */
  /* the end of the page */
  --closing: clamp(28px, 7.6cqw, 56px);      /* "And then the whole valley shines." */
  --plaque-w: min(82cqw, 400px);
  --plaque-line: clamp(11.5px, 3cqw, 13.5px);  /* "Coming soon to iPhone and Android": never under 11 px */
  --plaque-name: clamp(22px, 6.4cqw, 34px);
  /* Every frame is cut with a rough, brushed edge (tool/make_edges.py), --edge deep. A frame that
     runs the full width is cut top and bottom (--cut-y); one that stands free has the same edge down its
     sides (css/journey.css). */
  --edge: clamp(12px, 3.4vw, 26px);
  --cut-y: url("../assets/img/edge/top.webp") top / auto var(--edge) repeat-x, url("../assets/img/edge/bottom.webp") bottom / auto var(--edge) repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--edge) + 2px) no-repeat;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 11'%3E%3Cpath d='M0 5.5h52M80 5.5h52' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='66' cy='5.5' r='4' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3Ccircle cx='57' cy='5.5' r='1.3'/%3E%3Ccircle cx='75' cy='5.5' r='1.3'/%3E%3C/svg%3E");
  --ornament: 132px;                         /* the small brass mark under a heading: a line, a knob, a line */
  --tap: 44px;
  --cable: 2px;           /* the cable where the page itself draws it: the scroll cue and its run below */
  --spark: 6px;
  --cue-h: clamp(54px, 9vh, 92px);
  /* a pole picture, toned to the night around it */
  --pole-tone: brightness(0.9) saturate(0.9);
  --lamp-pole-tone: brightness(0.62) saturate(0.6);      /* the game's lamp pole, which is painted for daylight */

  /* ---- the board (css/board.css): the game's approved board, ported from mockup/firstlight ---- */
  /* one unit is one pixel of the mockup's phone, where the board, oak frame and all, is 362 wide */
  --board-u: calc(100cqw / 362);

  /* the page playing by itself (js/selfplay.js reads these) */
  --board-pace: 900ms;                       /* between two of its taps */
  --board-idle: 7000ms;                      /* how long a visitor must be still before it carries on */

  /* materials */
  --board-case: #08090c;                     /* the iron case behind the marble */
  --board-shadow: 0 calc(26 * var(--board-u)) calc(50 * var(--board-u)) rgba(0, 0, 0, 0.6), 0 calc(2 * var(--board-u)) 0 rgba(255, 255, 255, 0.04);
  --board-head-shade: linear-gradient(rgba(9, 10, 13, 0.74), rgba(9, 10, 13, 0.86));      /* over the marble behind the name plate */
  --board-head-edge: inset 0 calc(-1 * var(--board-u)) 0 rgba(0, 0, 0, 0.8), inset 0 var(--board-u) 0 rgba(255, 255, 255, 0.06);
  --board-plate-shadow: drop-shadow(0 calc(2 * var(--board-u)) calc(3 * var(--board-u)) rgba(0, 0, 0, 0.65));
  --board-gauge-shadow: drop-shadow(0 calc(2 * var(--board-u)) calc(3 * var(--board-u)) rgba(0, 0, 0, 0.7));
  --board-gauge-full: drop-shadow(0 0 calc(10 * var(--board-u)) rgba(255, 190, 92, 0.75)) var(--board-gauge-shadow);
  --board-needle: linear-gradient(180deg, #b3261e 0 30%, #17191f 30%);
  --board-slab-tone: brightness(1.3);        /* a marble tile */
  --board-slab-edge: inset 0 var(--board-u) 0 rgba(255, 255, 255, 0.13), inset 0 calc(-2 * var(--board-u)) calc(3 * var(--board-u)) rgba(0, 0, 0, 0.6), inset 0 0 0 var(--board-u) rgba(0, 0, 0, 0.5);
  --board-blank-tone: brightness(0.82);      /* bare marble, set a little deeper */
  --board-blank-edge: inset 0 calc(2 * var(--board-u)) calc(5 * var(--board-u)) rgba(0, 0, 0, 0.75), inset 0 0 0 var(--board-u) rgba(0, 0, 0, 0.55);
  --board-press: 0.955;                      /* a tile under the finger: how far it sinks, and how it catches the light */
  --board-press-tone: brightness(1.5);
  --board-cable-tone: saturate(0.78) brightness(0.82);      /* cable with no power in it */
  --board-theirs-tone: saturate(0.5) brightness(0.6);       /* the friend's half, until the job is lit */
  --board-part-shadow: drop-shadow(0 calc(3 * var(--board-u)) calc(5 * var(--board-u)) rgba(0, 0, 0, 0.6));
  --board-mark-ink: 0.85;                    /* the brass corner marks of a bolted tile: how strongly they show */
  --board-hint-glow: 0 0 calc(14 * var(--board-u)) rgba(255, 190, 92, 0.6);
  --board-pulse: #fffbea;                    /* the pulse of current running along a live cable */
  --board-pulse-ink: 0.85;
  --board-zap: radial-gradient(circle closest-side, #fff, rgba(255, 233, 176, 0.95) 35%, rgba(255, 160, 48, 0));      /* where the pulse enters a tile */
  --board-surge-tone: brightness(1.9) saturate(1.2);        /* the whole circuit flaring once as the job is lit */
  --board-bloom: radial-gradient(circle closest-side, rgba(255, 226, 160, 0.7), rgba(255, 180, 80, 0.26) 38%, rgba(255, 160, 60, 0.08) 70%, rgba(255, 160, 60, 0) 100%);      /* a bulb's light on the marble */
  --board-dynamo-glow: 0.6;                  /* the dynamo's own, smaller, bloom */
  --board-halo: rgba(255, 226, 160, 0.9);    /* the rings a bulb throws when the job is lit */
  --board-spark: radial-gradient(circle, #fff 0 20%, rgba(255, 214, 140, 0.9) 26% 42%, rgba(255, 160, 60, 0) 72%);      /* a loose end */
  --board-seam: linear-gradient(180deg, #fffaf0, #d9d2c0 55%, #8f897b);      /* the porcelain strip between two halves */
  --board-seam-shadow: 0 0 0 var(--board-u) rgba(0, 0, 0, 0.55), 0 calc(2 * var(--board-u)) calc(6 * var(--board-u)) rgba(0, 0, 0, 0.6);
  --board-seam-done: 0.35;                   /* how far the seam fades once the job is lit */
  --board-socket: #0b0c10;                   /* a socket on the seam: its hole, its porcelain rim */
  --board-socket-rim: #e9e2d0;
  --board-socket-shadow: 0 var(--board-u) calc(3 * var(--board-u)) rgba(0, 0, 0, 0.7);
  --board-socket-wait: 0 0 calc(12 * var(--board-u)) calc(2 * var(--board-u)) rgba(154, 216, 255, 0.75), inset 0 0 calc(5 * var(--board-u)) rgba(154, 216, 255, 0.8);
  --board-socket-join-rim: #ffe2a6;
  --board-socket-join: 0 0 calc(14 * var(--board-u)) calc(3 * var(--board-u)) rgba(255, 190, 92, 0.8);
  --board-focus: 2px solid var(--paper);
  --board-focus-inset: -4px;
  --board-focus-edge: inset 0 0 0 6px rgba(7, 9, 18, 0.6);

  /* sizes */
  --board-overhang: calc(2 * var(--board-u));       /* how far the oak frame stands out past the case */
  --board-case-w: calc(7 * var(--board-u));
  --board-corner: calc(4 * var(--board-u));         /* the case's corners, and a tile's */
  --board-frame-out: calc(-9 * var(--board-u));     /* the frame lies over the case: from here outside the marble... */
  --board-frame-w: calc(24 * var(--board-u));       /* ...this wide, its corner plates included */
  --board-frame-slice: 38;                          /* the frame picture's border, in its own pixels */
  --board-head-pad: calc(9 * var(--board-u)) calc(13 * var(--board-u)) calc(8 * var(--board-u)) calc(15 * var(--board-u));
  --board-head-gap: calc(12 * var(--board-u));
  --board-head-marble: 150%;                        /* how large the marble behind the name plate is drawn */
  --board-plate-w: calc(216 * var(--board-u));      /* the enamel name plate */
  --board-plate-shape: 3.73;
  --board-plate-pad: calc(26 * var(--board-u));
  --board-plate-gap: calc(3 * var(--board-u));
  --board-plate-name: calc(19 * var(--board-u));
  --board-plate-line: calc(7 * var(--board-u));
  --board-plate-track: 0.13em;
  --board-plate-line-ink: 0.7;
  --board-gauge: calc(58 * var(--board-u));
  --board-needle-w: calc(2 * var(--board-u));
  --board-needle-rest: -49deg;                      /* the needle with nothing live... */
  --board-needle-sweep: 86deg;                      /* ...and how far it swings when every cable is */
  --board-needle-trip: 3.5deg;                      /* its tremble while a loose end sparks */
  --board-gap: calc(3 * var(--board-u));            /* between tiles, and round them */
  --board-mark-in: calc(4 * var(--board-u));        /* a bolted tile's corner marks: how far in, how long, how thick */
  --board-mark: calc(7 * var(--board-u));
  --board-mark-w: calc(1.5 * var(--board-u));
  --board-line: calc(2 * var(--board-u));           /* a drawn ring or rim */
  --board-spark-size: calc(12 * var(--board-u));
  --board-seam-h: calc(3 * var(--board-u));
  --board-socket-size: calc(20 * var(--board-u));
  --board-ripple-corner: calc(6 * var(--board-u));
  --board-shake: calc(4 * var(--board-u));          /* how far a piece that will not turn shakes */

  /* durations */
  --board-press-time: 120ms;
  --board-turn: 360ms;                       /* a quarter turn */
  --board-turn-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --board-step: 170ms;                       /* the power reaching the next tile along */
  --board-live: 300ms;                       /* a cable coming live, or going dead */
  --board-hum: 3.2s;                         /* one breath of a live cable, and of the dynamo's glow */
  --board-hum-step: 90ms;                    /* each tile a little later than the one before */
  --board-flow: 3.4s;                        /* one round of the pulse running out from the dynamo */
  --board-surge: 900ms;                      /* the flare when the job is lit */
  --board-surge-step: 80ms;
  --board-warmup: 950ms;                     /* a filament catching */
  --board-lamp-hold: 900ms;                  /* the dark bulb stays under it until it has caught... */
  --board-lamp-off: 250ms;                   /* ...then goes */
  --board-bloom-wait: 300ms;
  --board-bloom-in: 700ms;
  --board-bloom-grow: 1100ms;
  --board-bloom-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --board-halo-time: 1500ms;                 /* a bulb's two rings when the job is lit */
  --board-halo-wait: 500ms;
  --board-halo-second: 850ms;
  --board-spark-time: 500ms;
  --board-needle-time: 800ms;
  --board-needle-ease: cubic-bezier(0.3, 1.6, 0.5, 1);
  --board-trip: 320ms;
  --board-nope: 300ms;
  --board-settle: 650ms;                     /* after the job is lit, before the board itself changes */
  --board-seam-wait: 600ms;
  --board-seam-fade: 1400ms;
  --board-theirs-wake: 1600ms;               /* the friend's half brightening once the job is lit */
  --board-port: 1500ms;                      /* one beat of a waiting socket */
  --board-ripple: 700ms;                     /* the ring where the page tapped (js/board.js reads this) */
}

/* the narrowest phones: the small line must stay on one line */
@media (max-width: 380px) {
  :root { --kind: 11.5px; --kind-track: 0.1em; }
}
