/*
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2026 The Rime Engine Authors.
*/

/* Light by default, dark on request — `prefers-color-scheme` rather than a toggle, because this
   page has no account-level settings store to remember a manual choice in (a per-viewer localStorage
   preference would be invisible to the deployment that has to look reasonable in either mode by
   default). */
:root {
  --bg: #f7f7f8;
  --fg: #1a1a1e;
  --muted: #5b5b63;
  --accent: #2b5fd9;
  --border: #d4d4d9;
  --error-bg: #fdecec;
  --error-fg: #8a1f1f;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #eaeaee;
    --muted: #9a9aa4;
    --accent: #7aa2ff;
    --border: #34343c;
    --error-bg: #3a1414;
    --error-fg: #ff9a9a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

#app {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

label {
  font-size: 0.9rem;
  color: var(--muted);
}

input,
button {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
}

input {
  width: 100%;
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  align-self: flex-start;
}

button:hover {
  filter: brightness(1.08);
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

nav a,
a {
  color: var(--accent);
}

.status {
  min-height: 1.2em;
  color: var(--muted);
}

.error {
  background: var(--error-bg);
  color: var(--error-fg);
  padding: 0.75rem;
  border-radius: 0.4rem;
}

code {
  display: block;
  word-break: break-all;
  padding: 0.75rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  font-size: 1rem;
}

ul.catalogue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

ul.catalogue li {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

ul.catalogue button {
  margin-right: 0.5rem;
}

#session-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 0.4rem;
}

/* Phone width: the 32rem max-width above already reads as a single column there; this only trims
   the outer padding so nothing touches the screen edge. */
@media (max-width: 480px) {
  #app {
    padding: 1rem 0.75rem 2rem;
  }
}
