/* Shared puzzle key-art styles for the homepage, 3D collection and command
   palette. Extracted from the old landing stylesheet so the new pages can
   use the bespoke inline-SVG glyphs without also loading the retired layout.

   Every colour is a token, so light/dark needs no second asset and no swap.
   ========================================================================= */
.puzzle-glyph {
    display: block;
    width: 100%;
    height: 100%;
}

.puzzle-glyph .g-surface { fill: var(--bg-2); }
.puzzle-glyph .g-edge    { stroke: var(--line); }
.puzzle-glyph .g-cell    { fill: var(--bg-1); }
.puzzle-glyph .g-rule    { stroke: var(--line); stroke-width: 1; }

/* Family identity — the same three colours the cards' pills use. */
.puzzle-glyph[data-family="word"]    { --g-hi: var(--cat-word); }
.puzzle-glyph[data-family="logic"]   { --g-hi: var(--cat-logic); }
.puzzle-glyph[data-family="spatial"] { --g-hi: var(--cat-spatial); }

.puzzle-glyph .g-cell--on       { fill: var(--g-hi); }
.puzzle-glyph .g-cell--accent   { fill: var(--accent); }
.puzzle-glyph .g-cell--muted    { fill: var(--line); }
.puzzle-glyph .g-accent-soft    { fill: color-mix(in srgb, var(--accent) 12%, transparent); }

.puzzle-glyph .g-letter,
.puzzle-glyph .g-cipher,
.puzzle-glyph .g-tile-letter,
.puzzle-glyph .g-digit,
.puzzle-glyph .g-num {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    fill: var(--text-muted);
}

.puzzle-glyph .g-tile-letter   { font-size: 9px; fill: var(--text); }
.puzzle-glyph .g-tile-letter--on,
.puzzle-glyph .g-digit--on     { fill: var(--accent-contrast); }
.puzzle-glyph .g-cipher        { font-size: 10px; fill: var(--accent-contrast); }
.puzzle-glyph .g-num           { font-size: 6.5px; fill: var(--text-muted); }
.puzzle-glyph .g-digit         { font-size: 7.5px; fill: var(--text); }

.puzzle-glyph .g-mark          { stroke: var(--g-hi); }
.puzzle-glyph .g-mark--on      { stroke: var(--accent-contrast); }
.puzzle-glyph .g-cross         { stroke: var(--text-muted); opacity: 0.55; }

/* ── Isometric scenes (the 3D collection) ────────────────────────────────
   The projection is defined in src/common/PuzzleGlyph.php. Each box is three
   polygons and the lighting is the same idea as the hero cube: the top face is
   lit, the +x face is mid, the +y face is in shadow. A hairline on each face
   keeps the edges legible where two faces meet. */
.puzzle-glyph .g-iso-top,
.puzzle-glyph .g-iso-right,
.puzzle-glyph .g-iso-front {
    /* A stronger edge than the flat glyphs use: at 120px the isometric scenes are
       mostly pale paper tones, and without a firm join line the blocks dissolve
       into each other. */
    stroke: color-mix(in srgb, var(--text-strong) 20%, transparent);
    stroke-width: 0.9;
    stroke-linejoin: round;
}

/* Shaded faces carry a little of the family colour, so a scene belongs to Word,
   Logic or Spatial at a glance the way the flat glyphs do, without every block
   becoming a saturated slab. */
.puzzle-glyph .g-iso-top   { fill: color-mix(in srgb, var(--bg-1) 86%, var(--g-hi)); }
.puzzle-glyph .g-iso-right { fill: color-mix(in srgb, var(--bg-2) 92%, var(--g-hi)); }
.puzzle-glyph .g-iso-front { fill: color-mix(in srgb, var(--bg-2) 62%, var(--g-hi)); }

/* A block the scene wants to single out — the placed piece, the found word. */
.puzzle-glyph .g-iso--accent.g-iso-top   { fill: var(--g-hi); }
.puzzle-glyph .g-iso--accent.g-iso-right { fill: color-mix(in srgb, var(--g-hi) 84%, var(--text-strong)); }
.puzzle-glyph .g-iso--accent.g-iso-front { fill: color-mix(in srgb, var(--g-hi) 66%, var(--text-strong)); }

.puzzle-glyph .g-iso-cell {
    fill: color-mix(in srgb, var(--bg-1) 30%, transparent);
    stroke: color-mix(in srgb, var(--text-strong) 10%, transparent);
    stroke-width: 0.6;
}

.puzzle-glyph .g-iso-cell--accent { fill: var(--accent); }

.puzzle-glyph .g-iso-num {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    fill: var(--text);
    text-anchor: middle;
}

.puzzle-glyph .g-iso-num--on { fill: var(--accent-contrast); }

/* Small variant for faces that carry a whole word (the word-ladder rungs),
   where the default 11px mono would overlap its neighbours. */
.puzzle-glyph .g-iso-num--sm { font-size: 8px; }

.puzzle-glyph .g-piece         { fill: var(--bg-1); stroke: var(--line); }
.puzzle-glyph .g-piece--accent { fill: var(--g-hi); stroke: var(--g-hi); }

/* Crossword and maze boards are drawn as open/blocked cells rather than lines,
   so the pattern itself carries the structure at small sizes. */
.puzzle-glyph .g-cell--paper   { fill: var(--bg-1); }
.puzzle-glyph .g-cell--block   { fill: var(--line); }
.puzzle-glyph .g-cell--wall    { fill: var(--line); }

.puzzle-glyph .g-rail          { fill: var(--line); }
.puzzle-glyph .g-path          { stroke: var(--g-hi); }
.puzzle-glyph .g-node          { fill: var(--text-muted); }
.puzzle-glyph .g-node--accent  { fill: var(--accent); }
