:root {
  --glass: rgba(26, 30, 49, .68);
  --glass-chrome: rgba(17, 20, 31, .88);
  --glass-edge: rgba(199, 204, 255, .17);
  --specular: rgba(238, 240, 255, .14);
  --accent: #cbccff;
  --accent-ink: #101124;
  --glass-shadow: 0 6px 18px #03040b66, 0 22px 54px #03040b45;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

body.presence-site {
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(ellipse at 76% 0, #32375e55, transparent 66%) 0 0 / 100% 640px no-repeat,
    var(--canvas);
}

.sidebar, .topbar {
  background: var(--glass-chrome);
  border-color: var(--glass-edge);
  backdrop-filter: blur(16px);
}

.topbar {
  box-shadow: inset 0 1px 0 var(--specular), 0 5px 24px #03040b40;
}

.sidebar {
  box-shadow: inset -1px 0 #edf0ff06;
}

body.js-ready .sidebar, .portfolio-link { border-color: var(--glass-edge); }
.topbar-divider { color: #81869c; }
.topbar-context { font-family: var(--mono); }

.app-logo, .owner-avatar, .step-number {
  border-color: var(--glass-edge);
  background: linear-gradient(151deg, #363e65, #1c2239 70%);
  color: #e6e7ff;
  box-shadow: inset 0 1px 0 var(--specular), 0 4px 14px #06081255;
}

.app-logo.large {
  background: radial-gradient(ellipse at 20% 0, #6879b95c, transparent 70%),
    linear-gradient(150deg, #383e69, #21263f 75%);
  border-color: #a2a9f070;
  color: #e9eaff;
  box-shadow: inset 0 1px 0 #f2f3ff48, 0 8px 24px #0a0c1a75;
}

.owner-avatar { border: 1px solid var(--glass-edge); }

.nav-link:hover, .sidebar-external:hover, .icon-button:hover {
  background: #252c43b8;
}

.nav-link[aria-current] {
  background: linear-gradient(110deg, #373f68, #222841 95%);
  box-shadow: inset 2px 0 #bdc6ff, inset 0 1px 0 #d8dfff24;
  color: var(--text);
}

.nav-link[aria-current] > .icon { color: var(--accent); }

.button.primary {
  color: var(--accent-ink);
  border-color: #d9dcff;
  background: linear-gradient(159deg, #eff0ff 3%, var(--accent) 54%, #acb3ec 100%);
  box-shadow: inset 0 1px 0 #fff9, 0 4px 14px #8a94f23b, 0 12px 26px #080c2766;
  font-weight: 650;
}

.button.secondary, .platform-label {
  border-color: var(--glass-edge);
  background: linear-gradient(160deg, #e0e5ff0d, transparent 65%), #181c2db8;
  box-shadow: inset 0 1px 0 var(--specular);
}

.source-button, .copy-checksum, .open-menu, .close-menu, .close-image {
  background: #242b4366;
  box-shadow: inset 0 0 0 1px #d3dcff1c, inset 0 1px 0 var(--specular);
}

.hero-lead { font-weight: 600; letter-spacing: -.044em; }
h1 { font-weight: 650; letter-spacing: -.035em; }
.eyebrow, .build-caption, .platform-label, .checksum-heading { font-family: var(--mono); }
.eyebrow, .build-caption { color: #b9c4ee; }

.screenshot, .requirements, .download-panel, .image-dialog, .toast {
  border-color: var(--glass-edge);
  background: linear-gradient(153deg, #a9b7ff0e, transparent 65%), var(--glass);
  box-shadow: inset 0 1px 0 var(--specular), var(--glass-shadow);
  backdrop-filter: blur(16px);
}

.screenshot {
  border-color: #aeb8f55c;
  box-shadow: inset 0 1px 0 #e6ecff36, 0 0 36px #8797fa10, var(--glass-shadow);
}

.screenshot-bar, .screenshot figcaption {
  background: #252b4655;
  border-color: var(--glass-edge);
}

.screenshot-bar > span:first-child .icon, .features > li > .icon { color: #bcc8ff; }
.zoom-label { background: #141b30e6; border-color: #acb9ff66; }

.requirements ul { color: var(--muted); }
.checksum { background: #0d1222b5; border-color: var(--glass-edge); }
.inline-link, .supporting-links a, .faq-answer a { color: #d4daff; }

.faq summary:hover, .faq details[open] summary { background: #222943a8; }
.faq details[open] summary .icon { color: var(--accent); }
.image-dialog > p { color: var(--muted); }

.spatial-stage { position: relative; isolation: isolate; }
.spatial-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -31px -18px -22px;
  pointer-events: none;
  background: radial-gradient(circle, #c6cfff31 1px, transparent 1.5px) 50% 0 / 23px 23px;
  mask-image: radial-gradient(ellipse at 81% 42%, #000 0, #0007 36%, transparent 72%);
}

/* Position a light layer only when a real control or card is tracked. */
[data-spatial-relative] { position: relative; }

.spatial-spotlight {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.spatial-spotlight-rim {
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.spatial-spotlight::before, .spatial-spotlight-rim::before {
  content: "";
  position: absolute;
  inset: -120px auto auto -120px;
  width: 240px;
  aspect-ratio: 1;
  background: radial-gradient(circle closest-side, #d4ddff28, #abbcff11 52%, transparent);
  transform: translate3d(var(--mouse-x, 0px), var(--mouse-y, 0px), 0);
}

.spatial-spotlight-rim::before {
  background: radial-gradient(circle closest-side, #eef2ffb0, #a8baff58 45%, transparent);
}

.button.primary .spatial-spotlight::before {
  background: radial-gradient(circle closest-side, #ffffff73, #ffffff20 52%, transparent);
}

.spatial-active > .spatial-spotlight { opacity: 1; }

@starting-style {
  .spatial-active > .spatial-spotlight { opacity: 0; }
}

:is(.brand, .nav-link, .sidebar-external, .portfolio-link, .topbar-title, .button,
    .icon-button, .zoom-trigger, .inline-link, .footer a, .supporting-links a, .faq summary):not(:disabled) {
  cursor: pointer;
  user-select: none;
  transform: translate3d(0, 0, 0);
  translate: var(--magnet-x, 0px) var(--magnet-y, 0px);
  transition: transform 210ms var(--ease), filter 190ms var(--ease);
}

[data-motion-dock-item] > .icon { scale: var(--dock-scale, 1); }

@media (hover: hover) and (pointer: fine) {
  :is(.brand, .nav-link, .sidebar-external, .portfolio-link, .topbar-title, .button,
      .icon-button, .zoom-trigger, .inline-link, .footer a, .supporting-links a, .faq summary):not(:disabled):hover {
    transform: translate3d(0, -2px, 0) scale(1.02);
    filter: brightness(1.06);
  }

  :is(.button, .icon-button):not(:disabled):hover {
    filter: brightness(1.06) drop-shadow(0 6px 8px #080b2a82);
  }
}

:is(.brand, .nav-link, .sidebar-external, .portfolio-link, .topbar-title, .button,
    .icon-button, .zoom-trigger, .inline-link, .footer a, .supporting-links a, .faq summary):not(:disabled):active {
  transform: translate3d(0, 0, 0) scale(.96);
  translate: none;
  filter: brightness(.95);
  transition-duration: 180ms;
}

/* The screenshot button is clipped by its frame, so keyboard feedback is inset. */
.zoom-trigger:focus-visible { z-index: 2; }

.spatial-stickers {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(30%, calc(100% - 650px));
  display: none;
  pointer-events: none;
}

.spatial-stickers::before, .spatial-stickers::after {
  content: "";
  position: absolute;
  top: 34%;
  left: 57%;
  width: 86%;
  aspect-ratio: 1.26;
  transform: translate(-50%, -50%) rotate(-28deg);
  border: 1px solid #b8c5ff25;
  border-radius: 50%;
  background: radial-gradient(ellipse, #838fec26, transparent 65%);
}

.spatial-stickers::after {
  width: 69%;
  border-color: #e2e8ff19;
  border-style: dashed;
  background: none;
  transform: translate(-50%, -50%) rotate(22deg);
}

.spatial-sticker {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transform: translate3d(var(--float-x, 0px), var(--float-y, 0px), 0);
}

.sticker-float {
  display: block;
  animation: sticker-drift var(--drift) ease-in-out var(--delay) infinite alternate;
}

.sticker-face {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 39px;
  padding: 7px 11px;
  border-radius: 12px;
  border: 1px solid #c9d1ff75;
  background: radial-gradient(ellipse at top left, #9eaaff47, transparent 80%), #222b49c4;
  color: #eef1ff;
  box-shadow: inset 0 1px 0 #eef2ff55, 0 0 0 2px #9fa9ff17, 0 7px 20px #080d245e;
  backdrop-filter: blur(16px);
  font: 650 13px/1 var(--mono);
  white-space: nowrap;
  user-select: none;
  pointer-events: auto;
  cursor: pointer;
  transform: rotate(var(--tilt));
  transition: transform 220ms var(--ease), filter 190ms var(--ease);
}

.sticker-face.sticker-tracked, .sticker-face:hover {
  transform: perspective(280px) translate3d(0, -5px, 0)
    rotateX(var(--sticker-tilt-x, 0deg)) rotateY(var(--sticker-tilt-y, 0deg))
    rotate(calc(var(--tilt) * -.5)) scale(1.07);
  filter: brightness(1.12) drop-shadow(0 5px 12px #b4bbff44);
}

.sticker-face svg { width: 23px; height: 23px; }
.sticker-prism .sticker-face {
  min-width: 73px;
  min-height: 73px;
  border-radius: 24px;
  border-color: #d8dfffaa;
  background: radial-gradient(ellipse at 22% 4%, #b6bbff7a, transparent 78%), #303b65cf;
  box-shadow: inset 0 1px 0 #f4f5ff90, 0 0 0 2px #b3bcff27, 0 0 42px #98a7fb30, 0 12px 18px #0a112c72;
}

.sticker-prism .sticker-face svg { width: 43px; height: 43px; }
.sticker-status .sticker-face { display: flex; gap: 7px; border-radius: 999px; font-size: 10px; }
.sticker-dot { width: 6px; height: 6px; border-radius: 50%; background: #a8d9ff; box-shadow: 0 0 9px #93bcff9c; }
.sticker-prism { --tilt: -8deg; --drift: 5.8s; --delay: -1s; left: 41%; top: 22%; }
.sticker-code { --tilt: 7deg; --drift: 6.7s; --delay: -3s; right: 4%; top: 47%; }
.sticker-terminal { --tilt: -7deg; --drift: 7.6s; --delay: -2s; left: 7%; top: 48%; }
.sticker-status { --tilt: -5deg; --drift: 5.9s; --delay: -4s; right: 12%; top: 78%; }
.sticker-branch { --tilt: 8deg; --drift: 7.2s; --delay: -5s; right: 9%; top: 0; }

@keyframes sticker-drift {
  from { transform: translate3d(0, -3px, 0) rotate(-2deg); }
  to { transform: translate3d(0, 5px, 0) rotate(2deg); }
}

@media (min-width: 1180px) and (min-height: 650px) {
  .spatial-stickers { display: block; }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .sticker-face { pointer-events: none; }
  .sticker-float { animation: none; }
  .spatial-spotlight { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spatial-sticker, .sticker-face, .sticker-face:hover,
  :is(a[href], button, summary) { transform: none !important; translate: none !important; }
  [data-motion-dock-item] > .icon { scale: 1; }
}
