/* Homepage only. Layers, back to front:
     body background (ink)  →  .hp-toy feedback canvas (full stage)  →  .hp-ticker + .hp-menu (DOM, not in the loop) */

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.hp {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--page-bg);
  /* fallbacks until JS measures the stage */
  --ticker-top: 46.5%;
  --ticker-h: 5.8%;
  --ticker-fs: 3.2vh;
  --menu-top: 56%;
  --menu-fs: 7.5vmin;
  --menu-lh: 1.22;
  --menu-left: 4vw;
  --menu-right: 6vw;
}
.hp--embedded { position: absolute; height: 100%; }

/* ?layout=mobile on a wide window: preview inside a phone-shaped frame */
html[data-forced-layout="mobile"] .hp {
  width: min(100vw, calc(100dvh * 390 / 844));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  outline: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
}

/* ── feedback toy ── */
.hp-toy {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
}
.toy-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── ticker bar ── */
.hp-ticker {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--ticker-top);
  height: var(--ticker-h);
  z-index: 2;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--ticker-bg);
  color: var(--ticker-text);
  font-family: var(--font-display);
  font-size: var(--ticker-fs);
  line-height: 1;
  cursor: default;           /* hovering does nothing */
  pointer-events: auto;      /* …and objects behind it can't be grabbed through it */
  -webkit-user-select: none;
  user-select: none;
}
.hp-ticker__track {
  display: flex;
  flex: none;
  white-space: pre;
  will-change: transform;
}
.hp-ticker__seq { flex: none; white-space: pre; }

/* ── menu ── */
.hp-menu {
  position: absolute;
  top: var(--menu-top);
  z-index: 3;
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: var(--menu-fs);
  line-height: var(--menu-lh);
  pointer-events: none;      /* gaps between links pass through to the toy */
}
.hp-menu[data-align="left"]  { left: var(--menu-left);  align-items: flex-start; }
.hp-menu[data-align="right"] { right: var(--menu-right); align-items: flex-end; }

.menu-item {
  pointer-events: auto;
  color: var(--menu-text);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.menu-item .word {
  display: inline-block;
  padding: 0.03em 0.1em;
  background-color: var(--menu-chip);
  color: var(--menu-text);
  transition: background-color 0.07s ease, color 0.07s ease;
}
@media (hover: hover) {
  .menu-item:hover .word {
    background-color: var(--menu-chip-hover);
    color: var(--menu-text-hover);
  }
}
.menu-item:focus-visible .word,
.menu-item.is-pressed .word {
  background-color: var(--menu-chip-hover);
  color: var(--menu-text-hover);
}
.menu-item:focus-visible { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
