/* One stylesheet, no build step, no framework. The page has to load fast on a
   phone with two bars of cellular, which is the whole point of the project. */

:root {
  color-scheme: light dark;

  --bg: #f4f2ee;
  --surface: #ffffff;
  --border: #e0dcd4;
  --text: #1e1c19;
  --text-muted: #6d675e;
  --accent: #8a5a2b;
  --accent-text: #ffffff;
  --danger-bg: #fdeceb;
  --danger-border: #f0b8b3;
  --danger-text: #8c2f26;
  --shadow: 0 1px 2px rgb(30 28 25 / 6%), 0 8px 24px rgb(30 28 25 / 6%);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #201e1b;
    --border: #34302b;
    --text: #eeeae3;
    --text-muted: #a39b8f;
    --accent: #d9a066;
    --accent-text: #1e1a15;
    --danger-bg: #35201d;
    --danger-border: #6b3730;
    --danger-text: #f0b4ab;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------- shared ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.button {
  display: inline-block;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.06);
}

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

.button-quiet {
  width: auto;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- login ---------- */

.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 22rem;
}

.auth-title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  margin: 0.25rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.925rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.alert {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 0.9rem;
}

.auth-note {
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- signed-in shell ---------- */

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-inner,
.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.825rem;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.who-name {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.who-avatar {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  /* The directory does not promise square photos; crop rather than squash. */
  object-fit: cover;
}

/* Shown when the account has no jpegPhoto. Same size and shape as the real
   thing so the header does not shift depending on who is signed in. */
.who-initials {
  display: grid;
  place-items: center;
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 700;
}

.page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

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

.empty p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  max-width: 44ch;
}

.empty-hint {
  font-size: 0.85rem;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* ---------- service cards ---------- */

.group + .group {
  margin-top: 2rem;
}

.group-title {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
}

.service:hover {
  border-color: var(--accent);
}

.service-icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.service-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.service-name {
  font-weight: 600;
}

.service-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 30rem) {
  .topbar-inner,
  .page {
    padding-inline: 1rem;
  }

  .brand-sub {
    display: none;
  }
}
