/* language: CSS, file: assets/css/polish.css
   Small, shared refinements used across the site. Everything here is additive — remove
   this file and the layout still works, it just feels flatter. */

/* ---------------- reveal on scroll ---------------- */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s cubic-bezier(.22,.68,.24,1) var(--rv-delay, 0ms),
                transform .55s cubic-bezier(.22,.68,.24,1) var(--rv-delay, 0ms);
    will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------- product card tilt + lift ---------------- */
.pc-card {
    transform: perspective(760px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
    transition: transform .22s cubic-bezier(.22,.68,.24,1),
                box-shadow .22s cubic-bezier(.22,.68,.24,1),
                border-color .22s var(--ease, ease);
    transform-style: preserve-3d;
}
.pc-card:hover {
    box-shadow: 0 22px 44px -28px rgba(18, 33, 48, .5);
    border-color: var(--sky-l, #bfdbfe);
}
/* the logo/artwork lifts slightly faster than the card, a cheap depth cue */
.pc-card:hover .pc-thumb, .pc-card:hover .pc-img { transform: translateZ(14px) scale(1.03); }
.pc-thumb, .pc-img { transition: transform .22s cubic-bezier(.22,.68,.24,1); }

/* ---------------- sticky nav shadow ---------------- */
.nav, header.nav, .navbar { transition: box-shadow .2s ease, background-color .2s ease; }
.nav.is-scrolled, header.nav.is-scrolled, .navbar.is-scrolled {
    box-shadow: 0 8px 26px -20px rgba(16, 30, 44, .55);
}

/* ---------------- copy affordance ---------------- */
[data-copy], [data-copy-acc] { cursor: pointer; }
.is-copied {
    outline: 2px solid #34c98a;
    outline-offset: 2px;
    border-radius: 8px;
    transition: outline-color .12s ease;
}

/* ---------------- back to top ---------------- */
.to-top {
    position: fixed; right: 16px; bottom: 18px; z-index: 60;
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--line, #dfe7ef);
    background: var(--surface, #fff); color: var(--ink-2, #4a5c6d);
    box-shadow: 0 10px 26px -14px rgba(16, 30, 44, .5);
    opacity: 0; transform: translateY(10px) scale(.94); pointer-events: none;
    transition: opacity .2s ease, transform .2s cubic-bezier(.22,.68,.24,1), box-shadow .2s ease;
    cursor: pointer;
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--sky, #2563eb); box-shadow: 0 14px 30px -14px rgba(37, 99, 235, .45); }
.to-top svg { width: 20px; height: 20px; }
html.theme-dark .to-top { background: #16212c; border-color: #26333f; color: #9fb2c4; }

/* ---------------- buttons: a touch of life ---------------- */
.btn {
    transition: transform .14s cubic-bezier(.22,.68,.24,1),
                box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary:hover { box-shadow: 0 14px 28px -18px rgba(37, 99, 235, .65); }

/* ---------------- links inside prose ---------------- */
.legal-doc a, .muted a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------------- focus: always visible, never a rectangle of doom ---------------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--sky, #2563eb);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ---------------- scrollbar (webkit) ---------------- */
@media (pointer: fine) {
    * { scrollbar-width: thin; scrollbar-color: #c4d2e0 transparent; }
    *::-webkit-scrollbar { width: 10px; height: 10px; }
    *::-webkit-scrollbar-thumb {
        background: #c4d2e0; border-radius: 99px; border: 3px solid transparent;
        background-clip: content-box;
    }
    *::-webkit-scrollbar-thumb:hover { background: #a9bccd; background-clip: content-box; }
    html.theme-dark *::-webkit-scrollbar-thumb { background: #2c3a48; background-clip: content-box; }
}

/* ---------------- honour reduced motion everywhere ---------------- */
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .pc-card { transform: none !important; }
    .to-top { transition: none; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
