/* theme.css - Watershed's entire visual theme, as :root custom
   properties. Every colour, ratio, duration and sprite slot the game
   paints is one property here, each with a comment saying what it
   affects; the /themes page (issue #30) renders those comments beside a
   control for each one. puzzle.css keeps every selector and layout rule,
   and reads these by name; it defines no colour, ratio or timing of its
   own any more.

   07-constants.js, waves.js, and 18-tutorial.js read this file's
   resolved values through Theme (public/puzzle/06a-theme.js) once at
   boot; puzzle.js, the Node test loader, parses this file directly with
   a regex and seeds Theme from that, since Node has no computed style.
   Sprite slots are all `none` here: the shape they'd replace is still
   painted on the canvas until an artist sets one (issue #30, Task C).
*/

:root {
    /* 1. Ground and text ------------------------------------------------ */

    /* Ground. The base is the hue of #336699 taken down and drained. */
    --bg:      #131c25;
    --deep:    #0e1620;
    --surface: #1c2833;
    --raise:   #24333f;
    --edge:    #33465a;

    --text:    #dfe7ee;
    --muted:   #8397a9;

    /* Translucent forms of the surfaces, so the water moves behind them.
       Written out rather than mixed, to keep the page working wherever
       colour functions are not. */
    --surface-veil: rgba(28, 40, 51, 0.86);
    --raise-veil:   rgba(36, 51, 63, 0.72);

    --lip:    rgba(255, 255, 255, 0.07);   /* top highlight on a control */
    --well:   rgba(0, 0, 0, 0.34);         /* shadow under one */

    /* Serif everywhere. Charter on macOS and most Linux boxes, Palatino
       or Georgia on Windows, and a plain serif if none of them are to be
       had. Every one of these is sturdy at small sizes, which is the
       whole reason a serif can carry an interface at all. */
    --font: 'Iowan Old Style', Charter, 'Bitstream Charter',
            'Palatino Linotype', Palatino, P052, Georgia, 'Noto Serif',
            'Liberation Serif', serif;

    /* Codes only: seeds, and the rating under the banner. */
    --font-code: 'SF Mono', 'Cascadia Mono', 'DejaVu Sans Mono',
                 'Liberation Mono', ui-monospace, monospace;

    /* 2. Accents --------------------------------------------------------- */

    --accent:  #5fd3a8;      /* jade, the primary */
    --warn:    #f2c14e;      /* gold, hints and messages */
    --bad:     #e5564b;      /* coral, and only ever error: a mistake on
                                 the board, the status line under it, the
                                 Diabolical difficulty swatch */
    --hint:    #f2c14e;      /* a forced edge from Hint, on the board */
    --done:    #3a4d5e;      /* a node whose value is fully satisfied */
    --cursor:  #7fe3c4;      /* the keyboard cursor ring */

    /* Water runs from the dim end to the bright end. Every arrow style
       carries this ramp, so direction is legible from colour alone
       before you even read the shape. */
    --flow:      #6ddcc4;    /* the flat shading's one flow colour */
    --flow-hi:   #e2fff7;    /* its highlight */
    --flow-dim:  #1f6f5c;    /* the faded shading's dim (leaving) end */
    --flow-lit:  #9ff0dd;    /* the faded shading's bright (arriving) end */
    --flow-flat: #6ddcc4;    /* the waterfall's own fill; same value as
                                 --flow today, kept separate so an artist
                                 can split them */

    /* The split shading: magenta where the water leaves, cyan where it
       arrives, meeting at a hard edge halfway along the arrow. */
    --split-up: #b06cf5;
    --split-dn: #4fe0c8;

    --wave-col:   #ffffff;   /* the arrow's own travelling-wave decoration,
                                 and waves.js's lit sheet edge: both are a
                                 white highlight at low opacity */
    --water-ring: rgba(109, 220, 196, 0.55);  /* the one-shot ring on a
                                 node that just settled */

    --shadow: rgba(0, 0, 0, 0.72);  /* the shadow every node is cast on */

    /* A node is domed: lit across the top left, shading away to the
       bottom right, its rim caught by the same light along the top edge. */
    --node-lit: #2c3f50;
    --node-dim: #0b1218;
    --node-lip: rgba(226, 236, 244, 0.16);

    --drain: #3aa8d8;        /* the drain's own accent, e.g. its legend
                                 swatch */

    --callout: #dddddd;      /* the tutorial's callout arrows and their
                                 open 'v' heads, distinct from the board's
                                 own double-headed flow arrows */

    /* Additions beyond the spec's seven-group list: 07-constants.js's C
       object carries two more colours the "Why" section's "lift every
       visual decision into one file" also covers, and no named property
       above fits them. */
    --arrow-neutral: rgba(160, 190, 214, 0.22);  /* an edge with no flow
                                 direction chosen yet (13-paint.js:60) */
    --ring-muted:    #4a6076;                    /* the ring paired with
                                 --text as a fallback for a clue value with
                                 no ramp colour of its own
                                 (13-paint.js:514) */

    /* 3. Clue values ------------------------------------------------------

       A ramp running violet, blue, cyan, green, lime, gold, then on
       through magenta and pink: a legend swatch and the number the board
       paints are the same colour by construction. It keeps its distance
       twice over -- at the gold end it stays clear of --bad so a number
       is never taken for a broken rule, and in the middle it stays clear
       of the water's teal so a number is never taken for an edge. --v7,
       --v8 and --v9 continue the ramp the OTHER way past violet (through
       magenta) rather than past gold (which has only about 38 degrees of
       hue before it collides with --bad); --v9 lands roughly that same
       38-degree distance from --bad on its side, matching the gap --v6
       already keeps on the gold side. */
    --v1: #a78bfa;
    --v2: #7fb3f2;
    --v3: #56cfe1;
    --v4: #6ed07d;
    --v5: #a8dd6a;
    --v6: #f2c14e;
    --v7: #ce88f2;
    --v8: #f288ee;
    --v9: #f288c7;

    /* 4. Water background -------------------------------------------------
       waves.js's three-sheet background. --water-image, if set to a
       url(), replaces the sheets outright instead of painting them. */
    --water-base: #131c25;   /* the page under everything */
    --water-deep: #0e1620;   /* what a sheet is mixed toward as it recedes */
    --water-from: #0d1016;   /* gradient dark end */
    --water-to:   #0e2027;   /* gradient light end */
    --water-rot:  -41;       /* degrees the whole stack is rotated by */
    --water-len:  980;       /* px between crests, in the rotated frame */
    --water-amp:  43;        /* px from midline to crest */
    --water-edge: 0.09;      /* opacity of the white line lit along each
                                 sheet's own wavy edge */

    /* Per sheet: how far it slides (px), how long one pass takes
       (seconds), its wave's phase, and how far toward --water-deep it is
       mixed as it recedes. Where each sheet's own edge sits down the
       stack is not themed -- it is fixed layout, not appearance. */
    --water-sheet-1-slide: 210;
    --water-sheet-1-secs:  31;
    --water-sheet-1-phase: 0;
    --water-sheet-1-sink:  0;

    --water-sheet-2-slide: 155;
    --water-sheet-2-secs:  42;
    --water-sheet-2-phase: 0.55;
    --water-sheet-2-sink:  0.10;

    --water-sheet-3-slide: 105;
    --water-sheet-3-secs:  53;
    --water-sheet-3-phase: 1.15;
    --water-sheet-3-sink:  0.20;

    --water-image: none;

    /* 5. Geometry -----------------------------------------------------
       Ratios stay ratios; each comment says what it is a share of. */
    --node-r:   0.15;    /* node radius, as a share of edge length */
    --node-min: 9;       /* and the range that radius is held within, px */
    --node-max: 46;
    --ring-r:   1.5;     /* widest decoration around a node, in radii: the
                            keyboard cursor ring */

    /* The double head's proportions. HEAD_GAP is the radius its two
       backs are cut to, in node radii; the other three are in line
       widths and head widths. */
    --head-gap:   1.10;
    --head-half:  2.50;
    --head-shaft: 0.60;
    --head-slope: 1.90;
    --head-style: double;   /* one of: wedge, dart, barb, double, chevron,
                                notch, head */

    --wave-gap:   1.6;    /* rems from one arrow-decoration wave to the
                             next */
    --wave-speed: 1.4;    /* rems a second they travel */
    --wave-bow:   0.75;   /* how far a wave bellies forward, in head half
                             widths */
    --wave-a:     0.4;    /* how strongly it shows */

    --shadow-blur: 0.70;  /* node shadow blur, as a share of node radius */
    --shadow-drop: 0.22;  /* node shadow drop, as a share of node radius */

    --drain-tip:  0.94;   /* how dead-overhead the drain's lid ellipse is
                             tipped; 1 would show no edge at all */
    --drain-rise: 0.20;   /* how thick the drain's lid stands, as a share
                             of node radius */

    --door-gap: 0.6;      /* how far each drain-door half slides, as a
                             share of the drain radius */

    /* 6. Timing ----------------------------------------------------------- */
    --wipe-ms:   400;     /* a removal draining away along the arrow */
    --draw-ms:   600;     /* a new arrow sweeping in */
    --flip-ms:   600;     /* a reversal: remove + draw back to back */
    --fly-ms:    700;     /* the new-level fly-in */
    --ripple-ms: 700;     /* the one-shot ring on a satisfied node */

    --drain-step:     260;  /* ms from one hop tier to the next, draining */
    --drain-ms:       450;  /* how long one edge takes to drain */
    --door-close-ms:  700;  /* how long the drain takes to slide shut */
    --door-delay-ms:  200;  /* how long the door holds open after the
                               final fall begins */

    --fall-accel:    3000;  /* px/s^2, how hard the waterfall accelerates */
    --fall-terminal: 2400;  /* px/s, its terminal speed */
    --fall-hold-ms:  500;   /* ms the full-length column holds, at least */

    --shake-ms: 260;   /* how long a node twitches when it will not fill */
    --shake-r:  0.16;  /* and how far, in radii */

    /* 7. Sprites -----------------------------------------------------------
       All `none` by default, which means "keep painting the canvas
       shape". Setting a url() here and having the painter skip that
       element is issue #30's Task C; this file only reserves the names.
       Node values 1..9 and wild each have optional -done/-bad/-hint
       variants; the base is the fallback when a variant is `none`. */
    --sprite-node-1: none;      --sprite-node-1-done: none;
    --sprite-node-1-bad: none;  --sprite-node-1-hint: none;

    --sprite-node-2: none;      --sprite-node-2-done: none;
    --sprite-node-2-bad: none;  --sprite-node-2-hint: none;

    --sprite-node-3: none;      --sprite-node-3-done: none;
    --sprite-node-3-bad: none;  --sprite-node-3-hint: none;

    --sprite-node-4: none;      --sprite-node-4-done: none;
    --sprite-node-4-bad: none;  --sprite-node-4-hint: none;

    --sprite-node-5: none;      --sprite-node-5-done: none;
    --sprite-node-5-bad: none;  --sprite-node-5-hint: none;

    --sprite-node-6: none;      --sprite-node-6-done: none;
    --sprite-node-6-bad: none;  --sprite-node-6-hint: none;

    --sprite-node-7: none;      --sprite-node-7-done: none;
    --sprite-node-7-bad: none;  --sprite-node-7-hint: none;

    --sprite-node-8: none;      --sprite-node-8-done: none;
    --sprite-node-8-bad: none;  --sprite-node-8-hint: none;

    --sprite-node-9: none;      --sprite-node-9-done: none;
    --sprite-node-9-bad: none;  --sprite-node-9-hint: none;

    --sprite-node-wild: none;      --sprite-node-wild-done: none;
    --sprite-node-wild-bad: none;  --sprite-node-wild-hint: none;

    --sprite-drain: none;
    --sprite-drain-open: none;

    --sprite-arrow-head: none;

    --sprite-ripple: none;

    --sprite-waterfall-top:  none;
    --sprite-waterfall-mid:  none;
    --sprite-waterfall-foot: none;
}
