/* Cursor tilt on home subject cards and in-subject section tiles. tilt.js feeds the --vars;
   loaded after layout.css so these hover/active rules win. */
.dash-subject,
.section-tile {
  transition:
    transform 160ms var(--ease),
    box-shadow 220ms var(--ease),
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease);
}

/* Shadow is cast away from the cursor. The inset ring thickens the orange hover border
   without changing border-width, which would shift the tile's content. */
:is(.dash-subject, .section-tile, .overview-chapter-row):hover {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); /* replaces layout.css's lift */
  box-shadow:
    inset 0 0 0 1px var(--accent-light),
    var(--sx, 0px) calc(var(--sy, 0px) + 6px) 20px -8px rgba(194, 53, 4, 0.38);
}

/* Push: sink a little, keep the tilt, shadow tucks in. */
:is(.dash-subject, .section-tile, .overview-chapter-row):active {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(0.97);
  box-shadow:
    inset 0 0 0 1px var(--accent-light),
    calc(var(--sx, 0px) / 3) calc(var(--sy, 0px) / 3 + 2px) 8px -4px rgba(194, 53, 4, 0.45);
}
