:root {
  --bg: #080808;
  --fg: #f2efe7;
  --dim: #aaa59a;
  --accent: #d8d4c8;
  --accent-dim: #8b877d;
  --melody: #ffb454;
  --chord: #5ad1e6;
  --line: rgba(242, 239, 231, 0.16);
  --display: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 300 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#cam {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#start {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

#start[hidden], #bar[hidden], #stats[hidden], #home[hidden], #exit[hidden], #info[hidden] { display: none; }

a { color: inherit; text-decoration: none; }

#home {
  position: fixed;
  top: max(28px, env(safe-area-inset-top));
  left: 64px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--accent-dim);
  transition: color .3s;
}
#home:hover { color: var(--accent); }

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.seg button {
  padding: 7px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 14px;
}

.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

#go {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 42px;
  background: transparent;
  border: .5px solid rgba(242, 239, 231, .38);
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  transition: border-color .4s, letter-spacing .4s, background .4s;
}
#go .arrow { opacity: .5; transition: transform .4s, opacity .4s; }
#go:hover:not(:disabled) { border-color: var(--accent); background: rgba(242, 239, 231, .06); letter-spacing: .28em; }
#go:hover:not(:disabled) .arrow { transform: translateX(4px); opacity: 1; }
#go:disabled { opacity: .5; cursor: default; }

#status { margin: 0; min-height: 1.4em; font-family: var(--display); font-size: 17px; font-weight: 300; color: var(--dim); }
#status.error { color: var(--fg); }

@media (max-width: 640px) {
  #home { left: 28px; top: max(22px, env(safe-area-inset-top)); }
}

#bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  align-items: center;
}

#bar .seg { background: rgba(8, 8, 8, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

#info, #exit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(8, 8, 8, 0.7);
  border: 1px solid var(--line);
  font-style: italic;
  font-family: Georgia, serif;
}
#exit { font-size: 13px; color: var(--dim); }
#exit:hover { color: var(--fg); }
#info[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

#stats {
  position: fixed;
  /* clear of the chord labels down the left edge */
  left: calc(max(10px, env(safe-area-inset-left)) + 76px);
  top: max(10px, env(safe-area-inset-top));
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 8, 8, 0.75);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg);
  pointer-events: none;
}
