/* Neutral light and dark. Other stylesheets use only these tokens. */
:root {
  color-scheme: light dark;
  --font: system-ui, sans-serif;
  --bg: light-dark(#f4f4f5, #18181b);
  --surface: light-dark(#ffffff, #27272a);
  --text: light-dark(#18181b, #fafafa);
  --muted: light-dark(#52525b, #a1a1aa);
  --border: light-dark(#e4e4e7, #3f3f46);
  --field-border: light-dark(#a1a1aa, #71717a);
  --accent: light-dark(#3f3f46, #e4e4e7);
  --accent-ink: light-dark(#fafafa, #18181b);
  --danger: light-dark(#9f1239, #fda4af);
  --focus: light-dark(#3f3f46, #e4e4e7);
  --shadow: light-dark(rgb(24 24 27 / 0.06), rgb(0 0 0 / 0.4));
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --line: 1.5;
  --radius: 0.5rem;
  --max: 28rem;
  --max-wide: 40rem;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: var(--line);
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
}

a:hover {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  transform: translateY(-200%);
  background: var(--surface);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
}

.skip-link:focus {
  transform: none;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand,
.brand-mark {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: 0.01em;
}

.top nav {
  display: flex;
  gap: var(--space-4);
}

main {
  padding: var(--space-6) var(--space-5) var(--space-7);
  max-width: var(--max-wide);
}

h1 {
  font-size: var(--text-xl);
  font-weight: 650;
  margin: 0 0 var(--space-4);
}

h2 {
  font-size: var(--text-lg);
  font-weight: 650;
  margin: 0 0 var(--space-3);
}

p {
  margin: 0 0 var(--space-4);
}

form {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}

label {
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

input[type="email"],
input[type="text"],
input[type="password"] {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}

button,
.signin-method {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  display: inline-block;
}

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

.error {
  color: var(--danger);
}

.site-foot {
  margin-top: var(--space-6);
  color: var(--muted);
  font-size: var(--text-sm);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
}

legend {
  padding: 0 var(--space-1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.auth-card {
  max-width: var(--max);
  margin: var(--space-6) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-6);
}

.auth-divider {
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
}

.signin-methods {
  margin: 0 0 var(--space-3);
}

.signin-method {
  width: 100%;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  border-color: var(--field-border);
}

.auth-switch {
  font-size: var(--text-sm);
}

section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}

section form {
  max-width: var(--max);
}

/* Projects and the plan page. The viewer stylesheet supplies the drawing. */

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
  max-width: var(--max);
}

.project {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}

.note {
  color: var(--muted);
  font-size: var(--text-sm);
}

.issues {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}

.history {
  list-style: none;
  padding: 0;
}

.history li {
  margin: 0 0 var(--space-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.actions form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: end;
  margin: 0;
}

.variants {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.variants a[aria-current="page"] {
  font-weight: 650;
}

body:has(.plan) {
  display: block;
  height: auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

main:has(.plan) {
  max-width: 96rem;
}

.plan .panes {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  min-height: 0;
}

/* A set height, so the drawing fits its pane instead of setting the pane's height. */
.plan .stage {
  height: clamp(22rem, 68vh, 46rem);
  background: var(--surface);
}

.plan .stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 48rem) {
  .plan .panes {
    grid-template-columns: 1fr;
  }

  .plan .pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .plan .stage {
    height: clamp(16rem, 60vh, 30rem);
  }

  body:has(.plan) .top {
    align-items: flex-start;
    flex-direction: column;
  }
}

