/* Motion for the phone pages: links.html, account.html and feedback.html. fx.js has the bits that need a script.
   Same language as the board's MOTION block in index.html, so the whole thing feels like one product:
   transform and opacity only (cheap on a phone), the board's two curves and its spring, the accent colour (pheme.css) only for small signals.
   - Panels rise in and a cover slides off them to the right, led by a thin bright edge, like a tile landing on the board.
   - Text steps in after the panel. Amber tags decode out of scrambled letters, numbers count up (fx.js).
   - Buttons: the hover colour blooms from the pointer, the label rolls up letter by letter, the button lifts and springs back
     when pressed, and a thin line runs along the bottom while they work. With a mouse the pointer is a soft light on the button,
     the label casts a faint shadow away from it and the button leans a few pixels towards it, like it's drawn to the cursor.
   - A picked option draws its accent line out from the middle. Errors give a short sideways nudge (fx.js).
   Everything sits inside prefers-reduced-motion: no-preference, so with Reduce Motion on (iPhone: Settings, Accessibility, Motion)
   the pages are exactly as they were before, with no movement at all. */
:root{
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-io:cubic-bezier(.7,0,.2,1);
  --spring:cubic-bezier(.3,1.3,.5,1);
}
/* the board's spring (damping .7, the countdown digits use it), where the browser can draw it */
@supports (animation-timing-function:linear(0,1)){
  :root{--spring:linear(0,.028,.098,.195,.306,.42,.531,.634,.726,.805,.871,.924,.965,.996,1.018,1.033,1.042,1.045,1.046,1.044,1.04,1.035,1.03,1.025,1.02,1.015,1.011,1.008,1.005,1.003,1.001,1,.999,.998,.998,.998,.998,.998,.998,.998,1)}
}
@media (prefers-reduced-motion:no-preference){
  /* text and small things step up into place. --d is the delay, set per element */
  .fx-up{animation:fxUp .55s var(--ease-out) var(--d,0ms) backwards}
  @keyframes fxUp{from{opacity:0;transform:translateY(14px)}}
  /* a panel rises, then its cover slides off. The panel's own cut corners clip the cover. Once off, the cover is hidden back over its
     panel, never left parked past the right edge, where it made the page wider than the screen (audit, October 2026) */
  .fx{position:relative;animation:fxRise .62s var(--ease-out) var(--d,0ms) backwards}
  .fx::after{content:"";position:absolute;inset:0;z-index:4;pointer-events:none;background:linear-gradient(to right,var(--bone) 0 2px,var(--cover) 2px);visibility:hidden;animation:fxWipe .62s var(--ease-io) calc(var(--d,0ms) + 90ms) backwards}
  @keyframes fxRise{from{opacity:0;transform:translateY(22px)}}
  @keyframes fxWipe{from{transform:none;visibility:visible}to{transform:translateX(101%);visibility:visible}}
  /* the logo slides in from the left, like the board's header on first load */
  .top{animation:fxIn .8s var(--ease-out) backwards}
  @keyframes fxIn{from{opacity:0;transform:translateX(-14px)}}

  /* buttons (.fxb), the same on every page. On hover the hover colour (--fx-hov) blooms out of the point the pointer came in at
     and drains back to where it leaves (fx.js sets --fx-x/--fx-y/--fx-r; from the left edge without it). The label rolls up
     letter by letter and lands on the same words (fx.js wraps it), the button lifts a touch and an icon slides on.
     Pressed, it sinks and springs back. --fx-base and --fx-hov are set per button in each page. */
  .fxb{position:relative;isolation:isolate;overflow:hidden;transition:color .3s var(--ease-out),transform .45s var(--spring)}
  .fxb::before{content:"";position:absolute;left:var(--fx-x,0px);top:var(--fx-y,50%);z-index:-1;width:var(--fx-r,300%);aspect-ratio:1;border-radius:50%;background:var(--fx-hov,var(--accent));transform:translate(-50%,-50%) scale(0);transition:transform .7s var(--ease-out)}
  .fxb:active:not(:disabled){transform:scale(.96);transition-duration:.3s,.12s}
  .fxl{display:inline-flex;overflow:hidden;padding:.2em 0;margin:-.2em 0;white-space:pre}
  .fxls{display:contents}
  .fxls>span{display:inline-block;text-shadow:0 1.5em currentColor;transition:transform .5s var(--ease-out) calc(var(--i,0) * 14ms)}
  .fxv{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  /* the light (fx.js adds .fxlt to each button and moves --fx-lx/--fx-ly with the mouse): a soft glow round the pointer over the hover
     colour, under the label. --fx-light sets its colour per page; by default the page's accent washed towards white, so it shows on
     both an accent and a white button. The label's shadow (--fx-sx/--fx-sy) falls away from the pointer, the lean (--fx-mx/--fx-my)
     goes towards it, a few pixels at most, through the button's spring so it follows a little behind. Mouse only (fine pointer) */
  .fxlt{position:absolute;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(circle var(--fx-lr,140px) at var(--fx-lx,50%) var(--fx-ly,50%),var(--fx-light,color-mix(in srgb,var(--accent) 50%,#fff)),transparent 70%);opacity:0;transition:opacity .45s var(--ease-out)}
  .fxb .fxl,.fxb svg{filter:drop-shadow(var(--fx-sx,0) var(--fx-sy,0) 3px rgba(0,0,0,0));transition:transform .45s var(--spring),filter .4s var(--ease-out)}
  @media (hover:hover){
    .fxb:hover:not(:disabled),.fxb:focus-visible{background:var(--fx-base)}
    .fxb:hover:not(:disabled)::before,.fxb:focus-visible::before{transform:translate(-50%,-50%) scale(1)}
    .fxb:hover:not(:disabled):not(:active){transform:translate(var(--fx-mx,0px),calc(var(--fx-my,0px) - 2px))}
    .fxb:hover:not(:disabled) svg,.fxb:focus-visible svg{transform:translateX(3px)}
    .fxb:hover:not(:disabled) .fxls>span,.fxb:focus-visible .fxls>span{transform:translateY(-1.5em)}
  }
  @media (hover:hover) and (pointer:fine){
    .fxb:hover:not(:disabled) .fxlt{opacity:.38}
    .fxb:hover:not(:disabled) :is(.fxl,svg){filter:drop-shadow(var(--fx-sx,0) var(--fx-sy,0) 3px rgba(0,0,0,.28))}
  }
  /* working (sending, saving): a thin line runs along the bottom, over and over */
  .fxb::after{content:"";position:absolute;left:0;bottom:0;width:40%;height:2px;background:currentColor;opacity:0;transform:translateX(-100%)}
  .fxb.busy::after{opacity:.7;animation:fxRun 1.1s var(--ease-io) infinite}
  @keyframes fxRun{to{transform:translateX(250%)}}

  /* a picked option: the accent line draws out from the middle instead of just appearing (.fxo on the option's label text) */
  .fxo{position:relative;transition:color .2s,background-color .2s}
  .fxo::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--accent);transform:scaleX(0);transition:transform .45s var(--spring)}
  .fxo.on::after,input:checked + .fxo::after{transform:none}
  .fxo.on,input:checked + .fxo{box-shadow:none!important}

  /* a waiting line: a small accent square breathes in front of it, like the board's wire */
  .fxw::before{content:"";display:inline-block;width:8px;height:8px;margin-right:12px;background:var(--accent);vertical-align:.1em;animation:fxBreathe 1.6s ease-in-out infinite}
  @keyframes fxBreathe{50%{opacity:.2}}

  /* the close X turns a quarter on hover */
  .x svg{transition:transform .35s var(--ease-out)}
  .x:hover svg,.x:focus-visible svg{transform:rotate(90deg)}

  /* rings that spread out of a dot (fx.js ping), like radar */
  .fxping{position:absolute;box-sizing:border-box;border:2px solid;border-radius:50%;opacity:0;pointer-events:none}
}
