@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fg: #fff;
  --soft: rgba(255, 255, 255, 0.82);
  --dim: rgba(255, 255, 255, 0.46);
  --faint: rgba(255, 255, 255, 0.18);
  --pad: 20px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: #000;
  color: var(--fg);
  scroll-snap-type: y proximity;
  overscroll-behavior: none;
  scrollbar-width: none;
  -webkit-text-size-adjust: 100%;
}
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: #000;
  font: 400 12px/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
}

#c {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100lvh;
  display: block;
  pointer-events: none;
}

main section {
  height: 100lvh;
  scroll-snap-align: start;
}

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

/* corner meta lines */
.meta {
  position: fixed;
  z-index: 2;
  color: var(--dim);
  transition: opacity 400ms ease, color 400ms ease;
  user-select: none;
}
.tl { top: max(var(--pad), env(safe-area-inset-top)); left: max(var(--pad), env(safe-area-inset-left)); }
.tr { top: max(var(--pad), env(safe-area-inset-top)); right: max(var(--pad), env(safe-area-inset-right)); }
.bl { bottom: max(var(--pad), env(safe-area-inset-bottom)); left: max(var(--pad), env(safe-area-inset-left)); }
.br { bottom: max(var(--pad), env(safe-area-inset-bottom)); right: max(var(--pad), env(safe-area-inset-right)); text-align: right; }
.brand { color: var(--fg); font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }

#ref { opacity: 0; pointer-events: none; }
#ref.on { opacity: 1; pointer-events: auto; }
#ref.tap { color: var(--soft); cursor: pointer; }

/* the coach: one instruction at a time, bottom centre */
#coach {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: calc(max(var(--pad), env(safe-area-inset-bottom)) + 44px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: opacity 500ms ease;
}
#coach.done { opacity: 0; pointer-events: none; }

#steps { display: flex; gap: 6px; }
#steps i {
  display: block;
  width: 14px;
  height: 1px;
  background: var(--faint);
  transition: background 400ms ease, width 400ms ease;
}
#steps i.now { width: 22px; background: var(--fg); }
#steps i.past { background: var(--dim); }

#cue {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--soft);
  white-space: nowrap;
  cursor: default;
  transition: opacity 400ms ease, transform 400ms ease;
}
#cue.out { opacity: 0; transform: translateY(4px); }
#cue.tap { cursor: pointer; color: var(--fg); }
#cue kbd {
  font: inherit;
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  margin: 0 0.15em;
  border: 1px solid var(--faint);
  border-radius: 4px;
  color: var(--fg);
  text-align: center;
}
#cue .caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--fg);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* chapter ticks */
#ticks {
  position: fixed;
  z-index: 2;
  right: max(var(--pad), env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#ticks button {
  width: 14px;
  height: 14px;
  cursor: pointer;
  position: relative;
}
#ticks button::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  height: 1px;
  width: 6px;
  background: var(--dim);
  transition: width 400ms ease, background 400ms ease;
}
#ticks button.on::before { width: 14px; background: var(--fg); }

/* invisible input that brings up the phone keyboard */
#ti {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 16px;
  pointer-events: none;
}

@media (max-width: 640px) {
  #ticks { right: max(8px, env(safe-area-inset-right)); gap: 8px; }
  #cue { font-size: 14px; }
}

.ns {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--fg);
  font-size: 14px;
}
