/* Stag On · shared effects (cursor, magnetic buttons, page transitions, day/night, drawing lines, photos) */

/* 13 · pages that flow */
@view-transition{navigation:auto}
@media (prefers-reduced-motion:no-preference){
  ::view-transition-old(root){animation:vt-out .26s cubic-bezier(.4,0,1,1) both}
  ::view-transition-new(root){animation:vt-in .42s cubic-bezier(0,0,.2,1) both}
}
@keyframes vt-out{to{opacity:0;transform:translateY(-10px)}}
@keyframes vt-in{from{opacity:0;transform:translateY(14px)}}
@media (prefers-reduced-motion:reduce){
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
}

/* 20 · day and night: the switch, and the reveal when it changes */
.theme-toggle{display:inline-grid;place-items:center;width:44px;height:44px;flex:none;padding:0;border-radius:50%;border:1px solid var(--stone,#D9D2C3);background:transparent;color:inherit;cursor:pointer;transition:border-color .2s,transform .45s cubic-bezier(.2,1.4,.4,1)}
.theme-toggle:hover{border-color:currentColor}
.theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .tt-sun{display:none}
html[data-theme=dark] .theme-toggle .tt-sun{display:inline}
html[data-theme=dark] .theme-toggle .tt-moon{display:none}
html[data-theme=light]{color-scheme:light}
html[data-theme=dark]{color-scheme:dark}
html.theme-vt::view-transition-old(root){animation:none}
html.theme-vt::view-transition-new(root){animation:theme-reveal .7s cubic-bezier(.6,0,.2,1) both}
@keyframes theme-reveal{from{clip-path:circle(0 at var(--vtx,50%) var(--vty,0))}to{clip-path:circle(150vmax at var(--vtx,50%) var(--vty,0))}}

/* 14 · buttons that press in, and 2 · magnetic buttons */
:root .btn,:root [data-press]{transform:translate(var(--mx,0px),var(--my,0px)) scale(var(--pr,1));transition:transform .5s cubic-bezier(.2,1.5,.4,1),background .2s,box-shadow .2s,color .2s,border-color .2s}
:root .btn.mag-on{transition:transform .14s ease-out,background .2s,box-shadow .2s}
:root .btn:active,:root [data-press]:active{--pr:.96;transition-duration:.08s}

/* 1 · custom cursor (mouse only; the normal cursor stays until this is running) */
.cur{position:fixed;left:0;top:0;z-index:10000;pointer-events:none;opacity:0;will-change:transform}
html.has-cursor .cur{opacity:1;transition:opacity .25s}
html.has-cursor.cur-away .cur,html.has-cursor.cur-text .cur{opacity:0}
.cur-dot{width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:50%;background:#B88A3E}
.cur-ring{width:38px;height:38px;margin:-19px 0 0 -19px;border-radius:50%;border:1.5px solid rgba(184,138,62,.7);transition:border-color .25s,background-color .25s}
.cur-ring.hot{border-color:#B88A3E;background-color:rgba(184,138,62,.12)}
.cur-label{margin:-7px 0 0 0;width:0;display:flex;justify-content:center;font:500 10px/14px 'IBM Plex Mono',monospace;letter-spacing:.16em;text-transform:uppercase;color:#B88A3E;white-space:nowrap}
.cur-label span{display:block;opacity:0;transform:translateY(32px);transition:opacity .2s,transform .25s}
.cur-label.on span{opacity:1;transform:translateY(44px)}
html.has-cursor,html.has-cursor body,html.has-cursor a,html.has-cursor button,html.has-cursor label,html.has-cursor [role=button],html.has-cursor input[type=range],html.has-cursor [data-cursor],html.has-cursor summary{cursor:none}
html.has-cursor input:not([type=range]):not([type=checkbox]):not([type=radio]),html.has-cursor textarea,html.has-cursor select{cursor:text}

/* 7 · lines that draw themselves (svg.draw) */
@media (prefers-reduced-motion:no-preference){
  html.fx-ready svg.draw .dl{stroke-dasharray:1;stroke-dashoffset:1}
  html.fx-ready svg.draw.drawn .dl{animation:fx-draw .9s cubic-bezier(.6,0,.2,1) forwards;animation-delay:calc(var(--i,0) * 90ms)}
}
@keyframes fx-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}

/* 8 · photos with craft: a wipe as each appears, gentle depth on scroll, a slow zoom on hover */
.photo img{scale:1.08;translate:0 var(--py,0px);transition:scale 1.8s cubic-bezier(.2,.7,.2,1)}
@media (hover:hover){.photo:hover img{scale:1.14}}
@media (prefers-reduced-motion:no-preference){
  html.fx-ready .photo{clip-path:inset(0 100% 0 0);transition:clip-path 1.15s cubic-bezier(.7,0,.2,1)}
  html.fx-ready .photo.shown{clip-path:inset(0 0 0 0)}
}
@media (prefers-reduced-motion:reduce){.photo img{scale:1;translate:none;transition:none}}
