/* ---- Round 6: the open logo, dials that travel between pages, livelier motion ---- */

/* The mark stands on the page itself: no tile, the page's ink, a soft accent glow. */
.brand-mark, .brand-footer .brand-mark {
    color: var(--ink); background: none; border-radius: 0; box-shadow: none;
    filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--accent) 30%, transparent));
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.08); }
/* The hands keep the visitor's own time (motion.js); the ring fills in on load and all the way on hover. */
.logo-hour { transform: rotate(var(--logo-h, 0deg)); }
.logo-minute { transform: rotate(var(--logo-m, 0deg)); }
.brand:hover .logo-minute, .brand:focus-visible .logo-minute { transform: rotate(calc(var(--logo-m, 0deg) + 360deg)); }
.brand:hover .logo-hour, .brand:focus-visible .logo-hour { transform: rotate(calc(var(--logo-h, 0deg) + 30deg)); }
.logo-ring { stroke-dasharray: 78 200; stroke-dashoffset: 0; transition: stroke-dasharray .9s var(--ease); animation: logo-fill 1.3s var(--ease) .15s backwards; }
.brand:hover .logo-ring, .brand:focus-visible .logo-ring { stroke-dasharray: 104 200; stroke-dashoffset: 0; }
@keyframes logo-fill { from { stroke-dasharray: 0 200; } }

/* A dial opened from a card grows into the product page, and shrinks back. */
.detail [data-gallery-main] { view-transition-name: face-dial; }
::view-transition-group(face-dial) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); z-index: 5; }
::view-transition-old(face-dial), ::view-transition-new(face-dial) { height: 100%; object-fit: contain; border-radius: 50%; }

/* The hero follows the pointer with a soft light, and its glow drifts slowly. */
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(520px circle at var(--hx, 50%) var(--hy, 40%), color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%);
    transition: opacity .6s var(--ease);
}
.hero.is-lit::after { opacity: 1; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-glow { animation: aurora 16s ease-in-out infinite alternate; }
@keyframes aurora {
    0% { translate: 0 0; scale: 1; filter: hue-rotate(0deg); }
    50% { translate: 4% -3%; scale: 1.08; }
    100% { translate: -4% 2%; scale: .96; filter: hue-rotate(35deg); }
}

/* The headline's words arrive one after another, coming into focus. */
.hero-title .word { display: inline-block; animation: word-in .9s var(--ease) both; animation-delay: calc(.12s + var(--i, 0) * .09s); }
@keyframes word-in { from { opacity: 0; translate: 0 .35em; filter: blur(8px); } }

/* Section titles draw an accent line as they come into view. */
.section-head h2 {
    padding-bottom: 8px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #3fc9d8)) 0 100% / 0 3px no-repeat;
    transition: background-size 1s var(--ease) .25s;
}
:root:not(.reveal-ready) .section-head h2, .section-head.is-in h2 { background-size: 52px 3px; }

/* Saving a design scatters a few hearts. */
.heart-spark {
    position: fixed; z-index: 80; pointer-events: none; width: 14px; height: 14px; margin: -7px 0 0 -7px; color: #ff5c7a;
}
.heart-spark svg { width: 100%; height: 100%; display: block; fill: currentColor; }

/* Cards: the dial turns a touch and the title's arrow slides in on hover. */
@media (hover: hover) and (pointer: fine) {
    .card .card-media img { transition: transform .7s var(--ease), scale .7s var(--ease); }
    .card:hover .card-media img { scale: 1.06; transform: rotate(-3deg); }
    .platform-fitbit.card:hover .card-media img { transform: none; }
}

/* The magnetic main buttons spring back when the pointer leaves. */
.btn.is-magnetic { transition: translate .35s cubic-bezier(.2, .9, .3, 1.4), background var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }

/* Numbers that count up keep their width while counting. */
[data-count-up] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .logo-ring, .hero-glow, .hero-title .word { animation: none !important; }
    .hero::after { display: none; }
    .section-head h2 { transition: none; background-size: 52px 3px; }
    ::view-transition-group(face-dial) { animation: none; }
    .card:hover .card-media img { scale: 1; transform: none; }
}
