/* Control OS 0.3 look: living background, glass, neon focus, and motion.
   Animations use transform, the individual translate/scale/rotate properties, and opacity only.
   <html data-motion="full | reduced | off"> is set by ui/core/motion.js. */

:root {
  --aurora-1: #6f5bff;
  --aurora-2: #18c6b4;
  --aurora-3: #ff5fa2;
  --glow: color-mix(in srgb, var(--accent) 70%, #86ded1);
  --glass: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  --glass-strong: color-mix(in srgb, var(--surface-raised) 93%, transparent);
  --card: color-mix(in srgb, var(--surface) 76%, transparent);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --sheen: linear-gradient(105deg, transparent 30%, #ffffff40 48%, #ffffff10 56%, transparent 70%);
}

:root[data-theme="dusk"] {
  --aurora-1: #b06bff;
  --aurora-2: #ff7ac0;
  --aurora-3: #5f7bff;
}

body { background: var(--background); }

#shell {
  position: relative;
  z-index: 1;
}

/* ---------- Boot ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 50% 55%, #1a2440 0%, transparent 60%),
    radial-gradient(40rem 30rem at 30% 30%, #2a1c4a 0%, transparent 60%),
    #07090f;
}

.boot-core {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.4rem;
}

.boot-logo {
  inline-size: 9.5rem;
  block-size: 9.5rem;
  overflow: visible;
}

.boot-orbit, .boot-mark {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.boot-orbit { transform-origin: 60px 60px; }

.boot-word {
  display: flex;
  align-items: baseline;
  color: #f4f5f2;
  font-size: 3rem;
  font-weight: 650;
  letter-spacing: -0.05em;
}

.boot-word strong {
  display: flex;
  margin-inline-start: 0.25em;
  font-weight: inherit;
  background: linear-gradient(100deg, #e3ff9a, #86ded1 55%, #c0abff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.boot-word span { display: inline-block; }
.boot-gap { inline-size: 0.05em; }

.boot-bar {
  inline-size: 14rem;
  block-size: 0.18rem;
  overflow: hidden;
  background: #ffffff14;
  border-radius: 1rem;
}

.boot-bar > span {
  display: block;
  block-size: 100%;
  background: linear-gradient(90deg, #e3ff9a, #86ded1, #c0abff);
  border-radius: inherit;
  transform-origin: left;
}

.boot-burst {
  position: absolute;
  inset: 50% auto auto 50%;
  inline-size: 30rem;
  aspect-ratio: 1;
  margin: -15rem 0 0 -15rem;
  border-radius: 50%;
  background: radial-gradient(circle, #86ded155 0%, #6f5bff22 35%, transparent 65%);
  opacity: 0;
}

:root[data-motion="full"] .boot.is-playing .boot-orbit {
  animation: boot-draw 1.1s var(--ease-out) both, boot-spin 6s linear infinite;
}
:root[data-motion="full"] .boot.is-playing .boot-mark { animation: boot-draw 0.95s var(--ease-out) 0.15s both; }
:root[data-motion="full"] .boot.is-playing .boot-mark-inner { animation-delay: 0.45s; }
:root[data-motion="full"] .boot.is-playing .boot-logo { animation: boot-pop 0.9s var(--ease-spring) both; }
:root[data-motion="full"] .boot.is-playing .boot-word span {
  animation: boot-letter 0.6s var(--ease-spring) both;
}
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(1) { animation-delay: 0.35s; }
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(2) { animation-delay: 0.39s; }
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(3) { animation-delay: 0.43s; }
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(4) { animation-delay: 0.47s; }
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(5) { animation-delay: 0.51s; }
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(6) { animation-delay: 0.55s; }
:root[data-motion="full"] .boot.is-playing .boot-word > span:nth-child(7) { animation-delay: 0.59s; }
:root[data-motion="full"] .boot.is-playing .boot-word strong span:first-child { animation-delay: 0.7s; }
:root[data-motion="full"] .boot.is-playing .boot-word strong span:last-child { animation-delay: 0.76s; }
:root[data-motion="full"] .boot.is-playing .boot-bar > span { animation: boot-load 1.45s cubic-bezier(0.65, 0, 0.35, 1) 0.1s both; }
:root[data-motion="full"] .boot.is-playing .boot-burst { animation: boot-burst 1.6s var(--ease-out) 0.2s both; }

.boot.is-leaving { opacity: 0; transition: opacity 0.5s ease; }
:root[data-motion="full"] .boot.is-leaving .boot-core { scale: 1.12; transition: scale 0.5s var(--ease-out); }
:root[data-motion="reduced"] .boot.is-leaving { transition-duration: 0.2s !important; }

@keyframes boot-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes boot-spin { to { rotate: 360deg; } }
@keyframes boot-pop { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
@keyframes boot-letter { from { opacity: 0; translate: 0 0.6em; scale: 0.7; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes boot-load { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes boot-burst { 0% { opacity: 0; scale: 0.4; } 45% { opacity: 1; } 100% { opacity: 0.55; scale: 1.25; } }

/* The shell rises in as the splash leaves. */
:root[data-motion="full"] body.shell-intro .top-bar { animation: drop-in 0.7s var(--ease-out) both; }
:root[data-motion="full"] body.shell-intro .remote-bar { animation: rise-in 0.7s var(--ease-out) 0.1s both; }
:root[data-motion="full"] body.is-booting #shell { opacity: 0; }
body.is-booting #shell *, body.is-booting #shell *::before { animation-play-state: paused !important; }

@keyframes drop-in { from { opacity: 0; translate: 0 -100%; } }
@keyframes rise-in { from { opacity: 0; translate: 0 100%; } }

/* ---------- Living background ---------- */

.os-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.os-bg-photos {
  position: absolute;
  inset: -4%;
  --px: 0;
  --py: 0;
  transform: translate3d(calc(var(--px) * -1.1%), calc(var(--py) * -0.9%), 0);
  transition: transform 1.6s var(--ease-out);
}

.os-bg-photo {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity 2.4s ease;
  will-change: opacity;
}

.os-bg-photo[data-active] { opacity: 0.34; }
.os-bg-photo[data-art="coast"] { background-image: url("../assets/coast.webp"); }
.os-bg-photo[data-art="night"] { background-image: url("../assets/night.webp"); }
.os-bg-photo[data-art="ridge"] { background-image: url("../assets/ridge.webp"); }
.os-bg-photo[data-art="desert"] { background-image: url("../assets/desert.webp"); }

.os-bg-aurora {
  position: absolute;
  inline-size: 70vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.32;
  will-change: transform;
}

.aurora-1 { inset: -35vmax auto auto -20vmax; background: radial-gradient(circle, var(--aurora-1) 0%, transparent 62%); }
.aurora-2 {
  inset: auto -25vmax -40vmax auto;
  background:
    radial-gradient(circle at 50% 50%, var(--aurora-2) 0%, transparent 55%),
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--aurora-3) 60%, transparent) 0%, transparent 40%);
  opacity: 0.26;
}

.os-bg-particles {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

.os-bg-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--background) 55%, transparent) 0%, color-mix(in srgb, var(--background) 72%, transparent) 55%, var(--background) 100%),
    radial-gradient(120% 90% at 50% 0%, transparent 40%, color-mix(in srgb, var(--background) 80%, transparent) 100%);
}

:root[data-motion="full"] .os-bg-photo[data-active] { animation: ken-burns 34s ease-in-out infinite alternate; }
:root[data-motion="full"] .aurora-1 { animation: aurora-a 26s ease-in-out infinite alternate; }
:root[data-motion="full"] .aurora-2 { animation: aurora-b 32s ease-in-out infinite alternate; }
.os-bg[data-paused] *, .os-bg[data-paused] { animation-play-state: paused !important; }
:root:not([data-motion="full"]) .os-bg-particles, :root[data-fx="lite"] .os-bg-particles { display: none; }
/* Lite: the device could not keep up, so the background holds still (see ui/core/motion.js). */
:root[data-fx="lite"] .os-bg * { animation: none !important; }

@keyframes ken-burns {
  from { transform: scale(1.04) translate3d(-1%, 0.5%, 0); }
  to { transform: scale(1.16) translate3d(1.5%, -1%, 0); }
}
@keyframes aurora-a { to { transform: translate3d(18vmax, 12vmax, 0) scale(1.25); } }
@keyframes aurora-b { to { transform: translate3d(-22vmax, -10vmax, 0) scale(0.85); } }

/* Media and full-screen apps cover the background; while they run it stays still. */
body.app-expanded .os-bg { opacity: 0; }

/* ---------- Top bar, nav glider, clock ---------- */

.top-bar {
  background:
    radial-gradient(40rem 6rem at 20% 0%, color-mix(in srgb, var(--aurora-1) 10%, transparent), transparent),
    var(--background);
  box-shadow: 0 1px 0 #ffffff0d;
}

.top-bar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  block-size: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--aurora-1) 50%, transparent), transparent);
  opacity: 0.6;
}

.brand-mark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 9%, #0b0f18);
  box-shadow: 0 0 1.1rem color-mix(in srgb, var(--accent) 28%, transparent);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 60%, color-mix(in srgb, var(--accent) 55%, transparent) 80%, transparent);
  opacity: 0.55;
}

:root[data-motion="full"] .brand-mark::before { animation: spin 5s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

.brand strong {
  background: linear-gradient(100deg, var(--accent), #86ded1 60%, #c0abff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.primary-nav { position: relative; isolation: isolate; }
.primary-nav .nav-item { position: relative; z-index: 1; }

.nav-glider {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 0;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, #222932), #222932 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: 0 0 1.2rem color-mix(in srgb, var(--accent) 18%, transparent);
  opacity: 0;
  transition: transform 0.45s var(--ease-spring), width 0.45s var(--ease-out), opacity 0.2s ease;
  pointer-events: none;
}

.nav-glider.is-visible { opacity: 1; }
.nav-glider.is-visible ~ .nav-item[aria-current="page"] { background: transparent; border-color: transparent; }
.nav-item[aria-current="page"] { color: var(--text); }

#clock {
  display: inline-flex;
  overflow: hidden;
  block-size: 1.3em;
  align-items: center;
  font-weight: 640;
}

.clock-ch { display: inline-block; white-space: pre; }
:root[data-motion="full"] .clock-tick { animation: clock-roll 0.5s var(--ease-spring) both; }
:root[data-motion="full"] .clock-colon { animation: blink 2s steps(1) infinite; }

@keyframes clock-roll { from { opacity: 0; translate: 0 -0.9em; } to { opacity: 1; translate: 0 0; } }
@keyframes blink { 50% { opacity: 0.35; } }

.remote-bar {
  background: var(--background);
  box-shadow: 0 -1.5rem 2rem -0.5rem color-mix(in srgb, var(--background) 85%, transparent);
}

:root[data-motion="full"] .version > span { animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: 0.35; scale: 0.7; } }

/* ---------- Cards and glass ---------- */

.app-card { background: linear-gradient(142deg, color-mix(in srgb, var(--tone, #6d91ad) 30%, transparent) -40%, var(--card) 72%); }
.input-card, .quick-card, .setting-card, .feature-card, .empty-shelf, .utility-panel { background: var(--card); }
.media-image { background-color: var(--card); }

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.section-heading h2::before {
  content: "";
  inline-size: 0.32rem;
  block-size: 1.05em;
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--accent), #86ded1);
  box-shadow: 0 0 0.8rem color-mix(in srgb, var(--accent) 50%, transparent);
}

.page-heading h1, .library-heading h1 {
  background: linear-gradient(100deg, var(--text) 40%, color-mix(in srgb, var(--accent) 70%, var(--text)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.action-button.primary {
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #86ded1));
  box-shadow: 0 0.4rem 1.2rem color-mix(in srgb, var(--accent) 22%, transparent);
}

.overlay {
  background: radial-gradient(120% 100% at 50% 40%, #0a0e1899, #04060bd9);
}

.panel {
  background: var(--glass);
  border-color: #ffffff24;
  box-shadow: inset 0 1px 0 #ffffff1f, 0 1.5rem 5rem #02040acc, 0 0 3rem color-mix(in srgb, var(--aurora-1) 12%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

:root[data-theme] .panel, .system-panel { background: var(--glass); }
.quick-panel .quick-card, .system-center .quick-card { background: color-mix(in srgb, var(--surface-raised) 55%, #ffffff0a); }
.search-result, .keyboard-key { background: color-mix(in srgb, var(--surface-raised) 70%, transparent); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, :root[data-theme] .panel, .system-panel { background: var(--glass-strong); }
}

.standby-panel, :root[data-theme] .standby-panel { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* High contrast keeps solid surfaces. */
:root[data-high-contrast] .panel, :root[data-high-contrast] .system-panel { background: var(--surface-raised); backdrop-filter: none; }
:root[data-high-contrast] :is(.app-card, .input-card, .quick-card, .setting-card, .feature-card, .empty-shelf, .utility-panel, .bookmark-tile) { background: var(--surface); }
:root[data-high-contrast] .os-bg-photo[data-active] { opacity: 0.12; }

/* ---------- Focus: travelling ring, lift, and light sweep ---------- */

.focus-ring {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 4;
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent),
    0 0 1.4rem color-mix(in srgb, var(--glow) 55%, transparent),
    inset 0 0 0.8rem color-mix(in srgb, var(--glow) 25%, transparent);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.26s var(--ease-out),
    width 0.26s var(--ease-out),
    height 0.26s var(--ease-out),
    border-radius 0.26s ease,
    opacity 0.18s ease;
  contain: layout style;
}

.focus-ring.is-visible { opacity: 1; }
.focus-ring.is-field { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 1rem color-mix(in srgb, var(--glow) 35%, transparent); }
.focus-ring.no-glide { transition: none !important; }
:root[data-motion="reduced"] .focus-ring { transition: opacity 0.12s ease !important; }
:root[data-motion="off"] .focus-ring { display: none; }

/* The ring replaces the outline. Off and High contrast keep the outline. */
:root:is([data-motion="full"], [data-motion="reduced"]):not([data-high-contrast]) [data-focus]:focus { outline-color: transparent; }
:root[data-high-contrast] .focus-ring { display: none; }

[data-focus] {
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, scale 0.32s var(--ease-spring), translate 0.32s var(--ease-out), opacity 0.3s ease;
}

.app-card, .input-card, .quick-card, .setting-card, .feature-card, .bookmark-tile, .search-result {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

:is(.app-card, .input-card, .quick-card, .setting-card, .feature-card, .bookmark-tile, .search-result)::before,
.media-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--sheen);
  translate: -110% 0;
  pointer-events: none;
}

:is(.app-card, .input-card, .quick-card, .setting-card, .feature-card, .bookmark-tile, .media-card, .store-card):focus {
  z-index: 1;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

:root[data-motion="full"] :is(.app-card, .input-card, .quick-card, .setting-card, .feature-card, .bookmark-tile):focus { scale: 1.06; }
:root[data-motion="full"] .media-card:focus { scale: 1.045; }
:root[data-motion="full"] :is(.action-button, .nav-item, .icon-button, .profile-button, .media-tab):focus { scale: 1.06; }
:root[data-motion="full"] .keyboard-key:focus { scale: 1.14; }
:root[data-motion="full"] .search-result:focus { translate: 0.35rem 0; }
:root[data-motion="full"] :is(.app-card, .input-card, .quick-card, .setting-card, .feature-card, .bookmark-tile, .search-result):focus::before,
:root[data-motion="full"] .media-card:focus .media-image::before { animation: sweep 0.9s var(--ease-out) 0.05s both; }

.media-card:focus .media-image { border-color: color-mix(in srgb, var(--accent) 75%, white); }
:root[data-motion="full"] .media-card:focus .media-glyph { scale: 1.15; background: var(--accent); color: var(--accent-ink); }
.media-glyph { transition: scale 0.3s var(--ease-spring), background-color 0.2s ease; }
:root[data-motion="full"] .app-card:focus .app-icon { scale: 1.12; rotate: -4deg; }
.app-icon { transition: scale 0.35s var(--ease-spring), rotate 0.35s var(--ease-spring); }
.keyboard-key:focus { background: color-mix(in srgb, var(--accent) 22%, var(--surface-raised)); }

@keyframes sweep { from { translate: -110% 0; } to { translate: 110% 0; } }

/* ---------- Page transitions and staggered entrances ---------- */

:root[data-motion="full"] .view-enter > * { animation: page-in 0.6s var(--ease-out) calc(var(--i, 0) * 55ms) both; }
:root[data-motion="full"] .view-enter[data-enter="right"] > * { animation-name: page-in-right; }
:root[data-motion="full"] .view-enter[data-enter="left"] > * { animation-name: page-in-left; }
:root[data-motion="full"] .view-enter[data-enter="back"] > * { animation-name: page-in-back; }
:root[data-motion="full"] .view-enter > :only-child > * { animation: page-in 0.6s var(--ease-out) calc(var(--i, 0) * 55ms) both; }
:root[data-motion="full"] .view-enter > :only-child { animation-name: fade-in; }
:root[data-motion="full"] .view-enter :is(.app-card, .media-card, .input-card, .quick-card, .setting-card, .feature-card, .bookmark-tile) {
  animation: card-in 0.55s var(--ease-spring) calc(var(--i-parent, 0ms) + var(--j, 0) * 45ms + 120ms) both;
}
:root[data-motion="full"] .view-enter .hero-content > * { animation: page-in 0.7s var(--ease-out) both; }
:root[data-motion="full"] .view-enter .hero-content > :nth-child(2) { animation-delay: 0.08s; }
:root[data-motion="full"] .view-enter .hero-content > :nth-child(3) { animation-delay: 0.14s; }
:root[data-motion="full"] .view-enter .hero-content > :nth-child(4) { animation-delay: 0.2s; }
:root[data-motion="full"] .view-enter .hero-content > :nth-child(5) { animation-delay: 0.26s; }

:root[data-motion="reduced"] .view-enter > * { animation: fade-in 0.18s ease both !important; }

@keyframes page-in { from { opacity: 0; translate: 0 1.4rem; } }
@keyframes page-in-right { from { opacity: 0; translate: 3rem 0; } }
@keyframes page-in-left { from { opacity: 0; translate: -3rem 0; } }
@keyframes page-in-back { from { opacity: 0; scale: 0.98; } }
@keyframes card-in { from { opacity: 0; translate: 0 1.2rem; } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Heroes ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-image: none;
  box-shadow: 0 1.5rem 4rem #02040a80, inset 0 1px 0 #ffffff1a;
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero::before {
  z-index: -2;
  background: var(--artwork) center 19% / cover no-repeat;
  transform-origin: 65% 40%;
}

.hero::after {
  z-index: -1;
  background:
    linear-gradient(90deg, #0b1420f8 0%, #0b1420e0 21%, #0b142098 39%, transparent 75%),
    linear-gradient(0deg, #0a11167d, transparent 39%),
    radial-gradient(60% 90% at 85% 10%, color-mix(in srgb, var(--aurora-1) 22%, transparent), transparent 70%);
}

:root[data-motion="full"] .hero::before { animation: hero-drift 28s ease-in-out infinite alternate; }

@keyframes hero-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-2%, 1%, 0); }
}

.hero-label { text-shadow: 0 0 1rem color-mix(in srgb, var(--accent) 50%, transparent); }

.store-hero-halo {
  position: absolute;
  inset: 50% 7% auto auto;
  z-index: 0;
  inline-size: 13.5rem;
  aspect-ratio: 1;
  margin: -6.75rem -2rem 0 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, color-mix(in srgb, var(--tone) 80%, transparent) 50%, transparent 75%, color-mix(in srgb, var(--accent) 60%, transparent) 92%, transparent);
  -webkit-mask: radial-gradient(circle, transparent 57%, #000 58%, #000 62%, transparent 63%);
  mask: radial-gradient(circle, transparent 57%, #000 58%, #000 62%, transparent 63%);
  opacity: 0.85;
  pointer-events: none;
}

.store-hero-icon { z-index: 1; box-shadow: 0 1.2rem 3rem #03060b8c, 0 0 2.5rem color-mix(in srgb, var(--tone) 35%, transparent); }

:root[data-motion="full"] .store-hero-halo { animation: spin 9s linear infinite; }
:root[data-motion="full"] .store-hero-icon { animation: float 5s ease-in-out infinite; }
:root[data-motion="full"] .store-hero-icon .icon { animation: icon-glow 5s ease-in-out infinite; }

@keyframes float { 50% { transform: translateY(-0.6rem); } }
@keyframes icon-glow { 50% { opacity: 0.8; scale: 1.06; } }

/* ---------- App Store progress and buttons ---------- */

.store-progress-track > span {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), #86ded1);
  box-shadow: 0 0 0.8rem color-mix(in srgb, var(--accent) 60%, transparent);
}

.store-progress-track > span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #ffffffb0, transparent);
  translate: -100% 0;
}

:root[data-motion="full"] .store-progress-track > span::after { animation: shimmer 1.1s ease-in-out infinite; }
:root[data-motion="full"] .store-actions > * { animation: pop-in 0.42s var(--ease-spring) both; }
:root[data-motion="full"] .store-actions > :nth-child(2) { animation-delay: 0.05s; }

@keyframes shimmer { from { translate: -100% 0; } to { translate: 100% 0; } }
@keyframes pop-in { from { opacity: 0; scale: 0.85; } }

.store-badge[data-state="owned"] { background: color-mix(in srgb, var(--accent) 12%, #ffffff08); }

/* ---------- Overlays, Control Center ---------- */

:root[data-motion="full"] .overlay:not([hidden]) { animation: fade-in 0.22s ease both; }
:root[data-motion="full"] .panel { animation: panel-pop 0.36s var(--ease-spring) both; }
:root[data-motion="full"] .quick-panel { animation: panel-slide 0.5s var(--ease-out) both; }
:root[data-motion="full"] .quick-panel .quick-panel-row { animation: card-in 0.5s var(--ease-spring) both; }
:root[data-motion="full"] .quick-panel .quick-panel-row:nth-child(2) { animation-delay: 0.05s; }
:root[data-motion="full"] .quick-panel .quick-panel-row:nth-child(3) { animation-delay: 0.1s; }
:root[data-motion="full"] .quick-panel .quick-panel-row:nth-child(4) { animation-delay: 0.15s; }
:root[data-motion="full"] .standby-panel { animation: fade-in 0.6s ease both; }
:root[data-motion="full"] .standby-panel .brand-mark { animation: breathe 4s ease-in-out infinite; }
:root[data-motion="reduced"] :is(.panel, .overlay:not([hidden])) { animation: fade-in 0.16s ease both !important; }

@keyframes panel-pop { from { opacity: 0; scale: 0.94; translate: 0 0.8rem; } }
@keyframes panel-slide { from { opacity: 0; translate: 110% 0; } }
@keyframes breathe { 50% { scale: 1.12; opacity: 0.7; } }

/* ---------- Notifications and volume ---------- */

.notification, .volume-indicator {
  position: relative;
  overflow: hidden;
  background: var(--glass-strong);
  border-color: #ffffff22;
  box-shadow: inset 0 1px 0 #ffffff1a, 0 0.8rem 2rem #02040a99, 0 0 1.6rem color-mix(in srgb, var(--accent) 10%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.notification::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  inline-size: 0.2rem;
  background: linear-gradient(180deg, var(--accent), #86ded1);
}

.notification-icon {
  display: grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  flex: none;
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.notification-timer {
  position: absolute;
  inset: auto 0 0;
  block-size: 2px;
  background: linear-gradient(90deg, var(--accent), #86ded1);
  transform-origin: left;
  opacity: 0.7;
}

:root[data-motion="full"] .notification { animation: toast-in 0.48s var(--ease-spring) both; }
:root[data-motion="full"] .notification-icon { animation: pop-in 0.5s var(--ease-spring) 0.12s both; }
:root[data-motion]:not([data-motion="off"]) .notification-timer { animation: countdown var(--duration, 4200ms) linear both; }
:root[data-motion="full"] .notification.is-updated { animation: bump 0.35s var(--ease-spring); }
:root[data-motion="full"] .notification.is-leaving { animation: toast-out 0.26s ease-in both; }
:root[data-motion="reduced"] :is(.notification, .volume-indicator) { animation: fade-in 0.16s ease both !important; }
:root[data-motion="reduced"] .notification.is-leaving { animation: fade-out 0.2s ease both !important; }
:root[data-motion="full"] .volume-indicator:not([hidden]) { animation: toast-in 0.4s var(--ease-spring) both; }
.volume-fill { background: linear-gradient(90deg, var(--accent), #86ded1); box-shadow: 0 0 0.6rem color-mix(in srgb, var(--accent) 60%, transparent); transition: width 0.25s var(--ease-out); }

@keyframes toast-in { from { opacity: 0; translate: 115% 0; scale: 0.9; } }
@keyframes toast-out { to { opacity: 0; translate: 60% 0; scale: 0.92; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes bump { 40% { scale: 1.035; } }
@keyframes countdown { from { scale: 1 1; } to { scale: 0 1; } }

/* ---------- Browser app ---------- */

.browser-layout { display: grid; gap: 0.4rem; }
.browser-panel { inline-size: min(100%, 44rem); }
.bookmarks { inline-size: min(100%, 64rem); margin-block-start: 1rem; }
.bookmark-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.bookmark-tile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-inline-size: 0;
  min-block-size: 4.6rem;
  padding: 0.75rem 0.9rem;
  text-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
}

.bookmark-copy { display: grid; min-inline-size: 0; }
.bookmark-copy .card-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bookmark-mark {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 2.7rem;
  aspect-ratio: 1;
  border-radius: 0.8rem;
  color: #0b0f18;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--h1), var(--h2));
  box-shadow: 0 0.4rem 1rem color-mix(in srgb, var(--h1) 30%, transparent);
  transition: scale 0.35s var(--ease-spring), rotate 0.35s var(--ease-spring);
}

.hue-sky { --h1: #9ad0ff; --h2: #6f8bff; }
.hue-ember { --h1: #ff8f86; --h2: #ff5f7a; }
.hue-silver { --h1: #f1f3f7; --h2: #aab4c4; }
.hue-sunset { --h1: #ffc58a; --h2: #ff7f5c; }
.hue-violet { --h1: #c0abff; --h2: #7f6bff; }
.hue-flame { --h1: #ffb07a; --h2: #ff6a3d; }
.hue-grape { --h1: #d6a8ff; --h2: #9a5cff; }
.hue-lime { --h1: #e3ff9a; --h2: #86ded1; }

:root[data-motion="full"] .bookmark-tile:focus .bookmark-mark { scale: 1.12; rotate: -6deg; }

/* ---------- Small screens ---------- */

@media (max-width: 850px) {
  .bookmark-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-hero-halo { display: none; }
}
