/* Slant, the clasp: slant/slant.css in Standard rules, scoped to .bx-slant and drawn with the
   cabinet's tokens. Clues read ink while they need diagonals and guide grey once matched; a hint
   uses the accent. The bolt sits behind the board's bottom edge and slides back on solve. Luke Steuber. */
.bx-slant{--section-strength:16%;--bolt-out:clamp(16px,calc(var(--cell)*.26),26px);display:flex;align-items:center;justify-content:center;user-select:none;-webkit-user-select:none}
.bx-slant .stage{display:flex;align-items:center;justify-content:center;padding:34px 0}
.bx-slant .clasp{position:relative;flex:none}

.bx-slant .board{position:relative;z-index:1;display:flex;flex-direction:column;flex:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none;border:1px solid var(--ink);background:var(--bg);transition:border-color .85s ease}
.bx-slant .grid-row{display:flex;flex:none}
.bx-slant .cell{width:var(--cell);height:var(--cell);flex:none;position:relative;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--bg);color:var(--ink);touch-action:none;-webkit-touch-callout:none;transition:--section-a .6s ease,--section-b .6s ease,color .85s ease,border-color .6s}
.bx-slant .grid-row:last-of-type .cell{border-bottom:0}
.bx-slant .cell:last-child{border-right:0}
.bx-slant .cell svg{display:block;width:100%;height:100%;overflow:visible;stroke:currentColor;stroke-width:2;fill:none}
.bx-slant .cell svg path{vector-effect:non-scaling-stroke}
/* The drawn line turns inside its own square (clipped 2px out so its corner ends stay whole); the hint ghost stays in flow. */
.bx-slant .cell>svg.line{position:absolute;inset:0;clip-path:inset(-2px)}
.bx-slant .cell>svg.line path{transform-origin:50px 50px;transition:transform .12s cubic-bezier(0,0,.58,1)}
.bx-slant .cell>svg{filter:drop-shadow(0 0 1px #000)}
.bx-slant .cell .ghost{stroke-dasharray:4 4;stroke-width:2}
.bx-slant .cell.evidence svg path{stroke-dasharray:5 3;stroke-width:3}
.bx-slant .cell.path-evidence svg path{stroke-width:3;stroke-dasharray:6 2}
.bx-slant .cell.cycle svg{stroke-width:5;stroke-dasharray:5 2}
.bx-slant .cell:focus-visible{z-index:2;outline:none}
.bx-slant .cell:focus-visible::after{content:"";position:absolute;left:50%;top:50%;width:10px;height:10px;transform:translate(-50%,-50%);border:2px solid var(--ink);border-radius:50%;background:var(--bg);pointer-events:none}
.bx-slant .cell.settled{cursor:default}
.bx-slant .cell.settled:focus-visible::after{display:none}
/* An inset frame marks a locked square without covering its diagonal. */
.bx-slant .cell .lock-frame{position:absolute;inset:5px;border:1px solid var(--guide);pointer-events:none;z-index:1;transition:opacity .85s ease}

/* Corner clues stay above the opaque focused cell and its small cursor. */
.bx-slant .vertices{position:absolute;inset:0;pointer-events:none;z-index:3;transition:opacity .85s ease}
.bx-slant .clue{position:absolute;transform:translate(-50%,-50%);display:grid;place-items:center;width:24px;height:24px;background:var(--bg);border-radius:50%;font:500 clamp(13px,calc(var(--cell)*.24),21px)/1 var(--mono);color:var(--ink);transition:opacity .85s ease}
.bx-slant .clue.satisfied{color:var(--guide)}
.bx-slant .clue.error{text-decoration:underline dotted;text-underline-offset:4px;text-decoration-thickness:2px}
/* Confirmed sections shed their clues and cursors; shared unfinished clues stay. */
.bx-slant .clue.settled{opacity:0}

/* A hint has its own color so it cannot be mistaken for play: the square to fill is tinted and ringed,
   its suggested diagonal is drawn in that color, and the clues and diagonals that justify it are marked the same way. */
.bx-slant .cell.hint-target{box-shadow:inset 0 0 0 2px var(--accent),inset 0 0 0 999px color-mix(in srgb,var(--accent) 18%,transparent);z-index:1}
.bx-slant .cell.hint-target .ghost{stroke:var(--accent);stroke-width:5;stroke-dasharray:7 5}
.bx-slant .cell.hint-target svg{animation:bx-slant-pulse 900ms 3}
.bx-slant .cell.evidence svg path:not(.ghost){stroke:var(--accent)}
.bx-slant .clue.evidence{text-decoration:none;box-shadow:0 0 0 2px var(--accent)}

/* Quiet color while thinking; full pigment arrives only after a valid solve. */
@property --section-a{syntax:"<color>";inherits:false;initial-value:transparent}
@property --section-b{syntax:"<color>";inherits:false;initial-value:transparent}
.bx-slant .board.solved{--section-strength:100%;border-color:transparent;animation:bx-slant-settle .65s cubic-bezier(.3,.7,.2,1)}
.bx-slant .board.solved .cell{color:#000;border-width:0;transition-duration:.85s,.85s,.85s,.6s}
.bx-slant .board.solved .cell>svg{filter:none}
.bx-slant .board.solved .vertices,.bx-slant .board.solved .lock-frame{opacity:0}

/* The clasp's bolt: an ink bar that runs down out of the board's bottom edge into a hairline keeper.
   It lies behind the board, so on solve it slides back up across the edge and is gone. */
.bx-slant .bolt,.bx-slant .keeper{position:absolute;left:calc(var(--cell)*var(--bolt-col,1.5) + 1px);pointer-events:none}
.bx-slant .bolt{z-index:0;bottom:calc(var(--bolt-out)*-1);height:calc(var(--bolt-out) + 18px);width:5px;margin-left:-2.5px;background:var(--ink)}
.bx-slant .keeper{z-index:0;top:100%;height:calc(var(--bolt-out) + 4px);width:15px;margin-left:-7.5px;border:1px solid var(--guide);border-top:0}
.bx-slant .clasp.open .bolt{transform:translateY(calc(var(--bolt-out)*-1 - 4px))}
.bx-slant .clasp.open .keeper{border-color:var(--line)}
.bx-slant .clasp.unlocking .bolt{transition:transform .42s cubic-bezier(.55,0,.7,.2) .2s}
.bx-slant .clasp.unlocking .keeper{transition:border-color .4s ease .5s}

@keyframes bx-slant-pulse{50%{opacity:.3}}
@keyframes bx-slant-settle{0%{transform:scale(1)}45%{transform:scale(.985)}100%{transform:scale(1)}}

@media(prefers-reduced-motion:reduce){.bx-slant *,.bx-slant *::before,.bx-slant *::after{animation:none!important;transition:none!important}}
.bx-slant.still *,.bx-slant.still *::before,.bx-slant.still *::after{animation:none!important;transition:none!important}

@media(forced-colors:active){
  .bx-slant .clue{background:Canvas;color:CanvasText}
  .bx-slant .cell{background:Canvas!important;color:CanvasText;border-color:GrayText}
  .bx-slant .cell>svg{filter:none}
  .bx-slant .clue.satisfied{color:Highlight}
  .bx-slant .clue.mismatch{color:CanvasText;text-decoration:underline}
  .bx-slant .cell:focus-visible::after{border-color:CanvasText;background:Canvas}
  .bx-slant .cell .lock-frame{border-color:CanvasText}
  .bx-slant .board.solved .cell{color:CanvasText}
  .bx-slant .cell.hint-target{box-shadow:none;outline:3px solid Highlight;outline-offset:-3px}
  .bx-slant .clue.evidence{box-shadow:none;text-decoration:underline dotted}
  .bx-slant .bolt{background:CanvasText}
}
