* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 none;
  font: inherit;
  vertical-align: baseline;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1f1d1a;
  --muted: #6b645c;
  --line: #ece7e1;
  --line-strong: #d9d2ca;
  --ring-faint: #cfc8bf;
  --input-bg: #ffffff;
  --hover: rgb(0 0 0 / 0.05);
  --accent: #b45309;
  --accent-soft: rgb(180 83 9 / 0.22);
  --on-accent: #ffffff;
  --alert-bg: #fdecea;
  --alert-line: #f5c2bd;
  --alert-text: #b42318;
  --notice-bg: #e8f5ee;
  --notice-line: #b7dfc8;
  --notice-text: #146c43;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181614;
    --text: #f2eee8;
    --muted: #a59d93;
    --line: #2e2a26;
    --line-strong: #3d3833;
    --ring-faint: #4a443e;
    --input-bg: #1f1c19;
    --hover: rgb(255 255 255 / 0.06);
    --accent: #c9834e;
    --accent-soft: rgb(201 131 78 / 0.28);
    --on-accent: #181614;
    --alert-bg: #3a1d1a;
    --alert-line: #5c2b25;
    --alert-text: #ffb4a9;
    --notice-bg: #15291f;
    --notice-line: #24442f;
    --notice-text: #8fd5ad;
  }
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
    "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nav */

/* The side padding lines the nav's contents up with main's column. */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.5rem max(1rem, (100% - 48rem) / 2);
  border-bottom: 1px solid var(--line);
}

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

nav > a {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.logo {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

nav ul {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
  list-style-type: none;
}

/* A long email shrinks to an ellipsis instead of pushing Log out off a phone's screen. */
nav .email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav ul a,
nav button {
  display: flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.625rem;
  border: 0;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
}

nav ul a:hover,
nav button:hover {
  background-color: color-mix(in srgb, var(--text) 10%, transparent);
}

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

nav .primary {
  background-color: color-mix(in srgb, var(--text) 12%, transparent);
  font-weight: 600;
}

nav .primary:hover {
  background-color: color-mix(in srgb, var(--text) 20%, transparent);
}

/* Page */

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: min(100% - 2rem, 48rem);
  padding-block: 2rem 3rem;
}

main a {
  color: var(--accent);
}

/* Account forms (log in, sign up, passwords): fields stacked, submit button on the right. */
main > form {
  display: flex;
  flex-direction: column;
  width: 15rem;
}

main > form input[type="submit"] {
  align-self: flex-end;
  margin-top: 0.25rem;
}

main > form a {
  align-self: flex-start;
  font-size: 0.8125rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

button,
input[type="submit"] {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* :where keeps this at a class's specificity, so the bubble states below still win. */
:where(button, input[type="submit"]):hover {
  background-color: var(--hover);
}

input[type="submit"] {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

input[type="submit"]:hover {
  filter: brightness(0.92);
}

/* Landing */

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-block: 3rem;
  text-align: center;
}

.intro h1 {
  max-width: 22ch;
  font-size: 1.875rem;
  line-height: 1.25;
  text-wrap: balance;
}

.intro p {
  color: var(--muted);
  font-size: 0.875rem;
}

.demo {
  max-width: 100%;
  margin-top: 1.5rem;
}

.demo img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.cta {
  padding: 0.875rem 2.25rem;
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.125rem;
  font-weight: 600;
}

.cta:hover {
  background: var(--accent);
  filter: brightness(0.92);
}

.cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 15rem;
  margin: 0.25rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--input-bg);
}

input:not([type="submit"]):focus {
  outline: 2px solid transparent; /* still drawn in forced-colors mode, where box-shadow isn't */
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.alert,
.notice {
  padding: 0.625rem 0.875rem;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.875rem;
}

.alert {
  border-color: var(--alert-line);
  background: var(--alert-bg);
  color: var(--alert-text);
}

.notice {
  border-color: var(--notice-line);
  background: var(--notice-bg);
  color: var(--notice-text);
}

/* Dims what was just acted on until the server answers: Turbo marks a submitting form
   aria-busy, and sortable_controller marks a dragged item. Scoped to main because
   Turbo also marks <html> during page visits. */
main [aria-busy] {
  opacity: 0.5;
}

.guest-banner {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  font-size: 0.875rem;
}

.guest-banner p + p {
  color: var(--muted);
}

.add-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.add-form {
  position: relative;
  flex: 1 1 14rem;
}

.add-form::before {
  content: "+";
  position: absolute;
  top: 50%;
  left: 0.875rem;
  translate: 0 -50%;
  color: var(--muted);
  pointer-events: none;
}

.add-form input[type="text"] {
  width: 100%;
  height: 2.75rem;
  margin: 0;
  padding-left: 2rem;
}

/* Board */

.board-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

thead th {
  min-width: 4.5rem;
  max-width: 8rem;
  border-bottom-color: var(--line-strong);
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: break-word;
}

thead th:first-child,
tbody th {
  padding-inline: 1rem;
}

thead th:first-child {
  color: var(--muted);
}

tbody th {
  min-width: 8rem;
  font-weight: 500;
  text-align: start;
  overflow-wrap: break-word;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

.grabbable {
  cursor: move; /* fallback if grab cursor is unsupported */
  cursor: grab;
}

.grabbable:active {
  cursor: grabbing;
}

.trash {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Unassigned bubbles are a faint ring. Assigned ones are an accent ring that fills
   from the centre as progress goes up, with a check once full. */
.bubble {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-inline: auto;
  padding: 0;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  background-color: transparent;
  transition: box-shadow 0.15s;
}

.bubble:hover {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.bubble:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.bubble-na {
  border: 1.5px solid var(--ring-faint);
}

.bubble-25,
.bubble-50,
.bubble-75 {
  background-image: radial-gradient(
    circle,
    var(--accent) calc(var(--fill) - 0.5px),
    transparent calc(var(--fill) + 0.5px)
  );
}

.bubble-25 {
  --fill: 25%;
}

.bubble-50 {
  --fill: 42%;
}

.bubble-75 {
  --fill: 53%;
}

.bubble-100 {
  background-color: var(--accent);
}

.bubble-100::after {
  content: "";
  width: 0.25rem;
  height: 0.55rem;
  margin-top: -0.125rem;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

#howto {
  width: 100%;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

#howto summary {
  width: fit-content;
  cursor: pointer;
}

#howto summary:hover {
  color: var(--text);
}

#howto ul {
  margin-top: 0.25rem;
  padding-left: 1.125rem;
}
