:root {
  --fg: #FF5A36;
  --bg: #0B0710;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  scrollbar-width: none;
  -webkit-text-size-adjust: 100%;
  transition: background-color 600ms ease;
}
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 600ms ease;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  display: block;
  opacity: 0;
  animation: in 1.6s 120ms cubic-bezier(.2,.7,.2,1) forwards;
}

#track { width: 1px; pointer-events: none; }

/* chapter pips */
#pips {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
  opacity: 0;
  animation: in 1s 1.2s ease forwards;
}
#pips button {
  all: unset;
  cursor: pointer;
  width: 7px;
  height: 7px;
  position: relative;
  border: 1px solid var(--fg);
  transition: background-color 400ms ease, border-color 600ms ease, transform 300ms cubic-bezier(.2,.7,.2,1);
}
#pips button::after { content: ""; position: absolute; inset: -8px; }
#pips button:hover { transform: scale(1.5); }
#pips button.on { background: var(--fg); }
#pips button:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* scroll hint: a falling line */
#hint {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 1px;
  height: 48px;
  margin-left: -0.5px;
  overflow: hidden;
  z-index: 5;
  opacity: 0;
  animation: in 1s 1.8s ease forwards;
  transition: opacity 500ms ease;
}
#hint.gone { opacity: 0 !important; animation: none; }
#hint i {
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: translateY(-100%);
  animation: fall 2.2s cubic-bezier(.7,0,.3,1) infinite;
}

/* hold to invert */
#invert {
  position: fixed;
  inset: 0;
  background: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 400ms 60ms ease;
}
body.hold #invert { opacity: 1; }

@keyframes in { to { opacity: 1; } }
@keyframes fall {
  0%   { transform: translateY(-100%); }
  50%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
  #hint i { animation-duration: 6s; }
}
