:root {
  --glass: rgba(18, 26, 42, .76);
  --glass-chrome: rgba(14, 21, 35, .89);
  --glass-edge: rgba(177, 206, 255, .19);
  --specular: rgba(226, 241, 255, .15);
  --accent: #a9c8ff;
  --accent-ink: #071425;
  --glass-shadow: 0 6px 18px #02061266, 0 22px 54px #02061245;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

body.presence-site {
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(ellipse at 76% 0, #2b4e8850, 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); }

.language-switch {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: #07101fcf;
}

.language-link {
  min-width: 28px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  color: var(--muted);
  font: 600 10px/1 var(--mono);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.language-link:hover { color: var(--text); background: var(--hover); }
.language-link[aria-current="page"] {
  background: #243e65;
  color: #d7e7ff;
  box-shadow: inset 0 0 0 1px #9bcaff32;
}

.download-label-short { display: none; }

@media (max-width: 400px) {
  .topbar-start { flex: 1 1 0; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { flex-shrink: 0; }
  .download-label { display: none; }
  .download-label-short { display: inline; }
}

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

.app-logo.large {
  background: radial-gradient(ellipse at 20% 0, #649bf165, transparent 70%),
    linear-gradient(150deg, #304f7b, #182943 75%);
  border-color: #9dc9ff70;
  color: #e4f0ff;
  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: #253954b8;
}

.nav-link[aria-current] {
  background: linear-gradient(110deg, #2b4873, #1b2c48 95%);
  box-shadow: inset 2px 0 var(--accent), inset 0 1px 0 #d8e8ff24;
  color: var(--text);
}

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

.button.primary {
  color: var(--accent-ink);
  border-color: #d3e5ff;
  background: linear-gradient(159deg, #e9f4ff 3%, var(--accent) 54%, #85aef1 100%);
  box-shadow: inset 0 1px 0 #fff9, 0 4px 14px #70a7f23b, 0 12px 26px #080f2766;
  font-weight: 650;
}

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

.source-button, .copy-checksum, .open-menu, .close-menu, .close-image {
  background: #24395966;
  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: #b2c8ee; }

.surface-drift-accent {
  display: inline-block;
  color: #b9d7ff;
}

@media (prefers-reduced-motion: no-preference) {
  .surface-drift {
    animation: surface-drift 10s cubic-bezier(.45, 0, .55, 1) infinite;
  }

  .surface-drift-accent { animation-delay: -3s; }
  .surface-drift-mark { animation-delay: -6s; }

  .spatial-stage:focus-within .surface-drift { animation-play-state: paused; }
}

@keyframes surface-drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  25% { transform: translate3d(1px, -2.5px, 0) rotate(.24deg); }
  50% { transform: translate3d(0, 1px, 0) rotate(0); }
  75% { transform: translate3d(-1px, 2.5px, 0) rotate(-.24deg); }
}

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

.screenshot {
  border-color: #a1c7fa5c;
  box-shadow: inset 0 1px 0 #e6f1ff36, 0 0 36px #7aaefa10, var(--glass-shadow);
}

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

.screenshot-bar > span:first-child .icon, .features > li > .icon { color: var(--accent); }
.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: #d4e6ff; }

.faq summary:hover, .faq details[open] summary { background: #203653a8; }
.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; }
}
