/* Page chrome: top bar, footer, custom cursor, right-click menu, toast. */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sfx-space-4) var(--sfx-space-6);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.topbar__mark {
  opacity: 0;
  transition: opacity var(--sfx-base) var(--sfx-ease);
}
.is-scrolled .topbar__mark { opacity: 1; }

.topbar__sound {
  padding: var(--sfx-space-2);
  border: 0;
  background: none;
  font: 500 var(--sfx-text-xs) / 1 var(--sfx-font-mono);
  color: var(--sfx-grey-400);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--sfx-base) var(--sfx-ease), color var(--sfx-fast) var(--sfx-ease);
}
.topbar__sound::before { content: "_"; color: var(--sfx-red); }
.topbar__sound:hover { color: var(--sfx-red-hot); }
.is-ready .topbar__sound { opacity: 1; }

.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--sfx-space-16) var(--sfx-space-6) var(--sfx-space-12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sfx-space-4) var(--sfx-space-8);
  border-top: var(--sfx-border);
  color: var(--sfx-grey-400);
  font-size: var(--sfx-text-sm);
}
.footer__links { display: flex; gap: var(--sfx-space-6); margin-right: auto; }
.footer__links .sfx-btn { font-size: var(--sfx-text-sm); }
.footer__studio a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: var(--sfx-ink);
  text-decoration: none;
}
.footer__studio a:hover { color: var(--sfx-red-hot); }
.footer__legal { font: 400 var(--sfx-text-xs) / 1.4 var(--sfx-font-mono); }

/* Custom cursor: a small slanted underscore, plus a ring that fills while holding. */
.cursor { display: none; }

@media (pointer: fine) {
  .has-cursor,
  .has-cursor * { cursor: none !important; }

  .has-cursor .cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    pointer-events: none;
  }
}

.cursor__bar {
  position: absolute;
  left: -8px;
  top: 4px;
  width: 16px;
  height: 4px;
  background: var(--sfx-red);
  transform: skewX(-10deg);
  transition: width var(--sfx-fast) var(--sfx-ease), left var(--sfx-fast) var(--sfx-ease), background var(--sfx-fast) var(--sfx-ease);
}
.cursor.is-hover .cursor__bar { left: -14px; width: 28px; background: var(--sfx-red-hot); }
.cursor.is-down .cursor__bar { background: var(--sfx-red-deep); }

.cursor__ring {
  position: absolute;
  left: -28px;
  top: -28px;
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity var(--sfx-base) var(--sfx-ease);
}
.cursor__ring circle {
  fill: none;
  stroke: var(--sfx-red);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: var(--offset, 1);
}
.cursor.is-charging .cursor__ring { opacity: 1; }

.menu {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  padding: var(--sfx-space-2) 0;
  background: var(--sfx-surface-2);
  border-left: 3px solid var(--sfx-red);
  border-radius: var(--sfx-radius);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.5);
  transform-origin: 0 0;
  animation: menu-in var(--sfx-fast) var(--sfx-ease);
}
.menu[hidden] { display: none; }

.menu__item {
  display: block;
  width: 100%;
  padding: var(--sfx-space-2) var(--sfx-space-4);
  border: 0;
  background: none;
  text-align: left;
  font: 500 var(--sfx-text-sm) / 1.4 var(--sfx-font-mono);
  color: var(--sfx-ink);
  cursor: pointer;
}
.menu__item::before { content: "_"; color: var(--sfx-red); opacity: 0; }
.menu__item:hover,
.menu__item:focus-visible { background: var(--sfx-surface-3); outline: none; }
.menu__item:hover::before,
.menu__item:focus-visible::before { opacity: 1; }
.menu__sep { height: 1px; margin: var(--sfx-space-2) 0; background: var(--sfx-surface-3); }

@keyframes menu-in {
  from { opacity: 0; transform: translate(2px, -6px); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sfx-space-8);
  z-index: 60;
  opacity: 0;
  translate: -50% 8px;
  pointer-events: none;
  transition: opacity var(--sfx-base) var(--sfx-ease), translate var(--sfx-base) var(--sfx-ease);
}
.toast.is-shown { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) {
  .menu { animation: none; }
}
