/* The start page and the project switcher. The CMS styles itself; this file touches only
   what the admin adds around it. */
:root {
  color-scheme: light dark;
  --ink: #0a0a0a;
  --paper: #ffffff;
  --muted: #6b6b6b;
  --hairline: rgba(0, 0, 0, 0.1);
  --raised: #f5f5f5;
  --edge: rgba(0, 0, 0, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f5;
    --paper: #0a0a0a;
    --muted: #a0a0a0;
    --hairline: rgba(255, 255, 255, 0.14);
    --raised: #2a2a2a;
    --edge: rgba(255, 255, 255, 0.28);
  }
}

/* ── Start page ── */
body.start {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}
.start main {
  width: 100%;
  max-width: 420px;
}
.start h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.start p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}
#projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
#projects a {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}
#projects a:hover,
#projects a:focus-visible {
  background: var(--raised);
}
#projects img {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
#projects .name {
  font-weight: 600;
}
#projects .site {
  color: var(--muted);
  font-size: 14px;
}

/* ── Switcher on a project's page ──
   Bottom-left, under the CMS's collection list (the sidebar is empty there). It has to read
   as a control at a glance against the CMS's own dark or light chrome, hence its size, the
   label and the stronger outline. */
#project-switch {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--raised);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  font: 14px/1 -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}
#project-switch::before {
  content: 'Project';
  padding: 0 6px 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#project-switch a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}
#project-switch a:hover,
#project-switch a:focus-visible {
  color: var(--ink);
  background: var(--paper);
}
#project-switch a[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
#project-switch img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

/* On a phone the CMS keeps its own controls near the screen's edges, which the switcher must
   never cover: there, a project is picked on the start page (admin.lodefinance.com). */
@media (max-width: 600px) {
  #project-switch {
    display: none;
  }
}
