/* Design system copied from llos.xyz:
   ABCSyntMono 15px, #f8f8f8 background, #707070 gray, #0000ff blue,
   12-col grid, px-4 / lg:px-8 gutters, rounded-xl, pill buttons. */

@font-face {
  font-display: swap;
  font-family: ABCSyntMono;
  font-style: normal;
  font-weight: 400;
  src:
    url(/fonts/font-regular.woff2) format('woff2'),
    url(/fonts/font-regular.woff) format('woff');
}

:root {
  --body: #f8f8f8;
  --default: #000;
  --gray: #707070;
  --blue: #0000ff;
  --white: #fff;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-600: #57534e;
  --gutter: 1rem;
  --radius: 0.75rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

@media (min-width: 1024px) {
  :root {
    --gutter: 2rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--stone-200);
}

html {
  background: var(--body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100svh;
  background: var(--body);
  color: var(--default);
  font-family: ABCSyntMono, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

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

a:focus {
  outline: none;
}

a:focus-visible {
  text-decoration: underline;
}

button,
input {
  font: inherit;
  color: inherit;
  background: none;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--blue);
  color: var(--white);
}

.muted {
  color: var(--gray);
}

.blue {
  color: var(--blue);
}

/* Header ---------------------------------------------------------------- */

.site-header {
  position: fixed;
  z-index: 30;
  top: 0.5rem;
  left: var(--gutter);
  display: flex;
  align-items: center;
  padding-right: 1rem;
}

@media (min-width: 1024px) {
  .site-header {
    top: 1rem;
    height: 62px;
  }
}

.nav {
  display: flex;
  gap: 0 6px;
  list-style: none;
}

.nav a {
  display: inline-flex;
  padding: 0.5rem 0;
}

@media (min-width: 1024px) {
  .nav a {
    padding: 0;
  }
}

.nav a.is-current {
  color: var(--gray);
}

/* Page ------------------------------------------------------------------ */

.page {
  padding: 5rem var(--gutter) 4rem;
}

@media (min-width: 1024px) {
  .page {
    padding-top: 6rem;
  }
}

/* Info line, same grid as the project info on llos.xyz */
.info {
  display: flex;
  column-gap: 0.75rem;
}

.info .status {
  flex: 0 0 auto;
  min-width: 4.5rem;
}

.info-fields > span {
  display: inline;
}

.info-fields > span:not(:last-child)::after {
  content: ', ';
}

@media (min-width: 1024px) {
  .info {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .info .status {
    grid-column: span 1;
    min-width: 0;
  }

  .info-fields {
    grid-column: span 11;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
  }

  .info-fields > span {
    grid-column: span 3;
  }

  .info-fields > span:not(:last-child)::after {
    content: '';
  }
}

.description {
  margin-top: 2.5rem;
  max-width: 42rem;
  white-space: pre-line;
}

@media (min-width: 1024px) {
  .description {
    margin-left: calc((100% - 11 * 0.75rem) / 12 + 0.75rem);
  }
}

/* Poll card ------------------------------------------------------------- */

.poll {
  margin-top: 3rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.poll-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

th,
td {
  padding: 0.25rem;
  text-align: center;
  vertical-align: middle;
  font-weight: 400;
  white-space: nowrap;
}

thead th {
  padding: 1rem 0.25rem 0.75rem;
  vertical-align: bottom;
}

tbody tr + tr td,
tbody tr + tr th,
tfoot td,
tfoot th {
  border-top-width: 1px;
}

/* Sticky name column */
.col-name {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 9rem;
  min-width: 9rem;
  max-width: 9rem;
  padding-left: 1rem;
  padding-right: 0.75rem;
  text-align: left;
  background: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1024px) {
  .col-name {
    width: 16rem;
    min-width: 16rem;
    max-width: 16rem;
    padding-left: 1.5rem;
  }
}

.col-name::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: var(--stone-200);
}

th.col-name {
  vertical-align: bottom;
}

.option-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  line-height: 1.3;
}

.option-head .day {
  font-size: 1.75rem;
  line-height: 1.1;
}

.option-head.is-best {
  color: var(--blue);
}

.option-head.is-best .muted {
  color: var(--blue);
}

/* Name button (click to edit a row) */
.name-btn {
  display: block;
  line-height: 2.5rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  transition: color 0.15s var(--ease);
}

.name-btn:hover {
  color: var(--gray);
}

.name-btn:focus {
  outline: none;
}

.name-btn:focus-visible {
  text-decoration: underline;
}

.name-btn .you {
  color: var(--gray);
}

/* Answer chips ---------------------------------------------------------- */

.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 5.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  line-height: 1;
  color: var(--stone-300);
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.15s var(--ease-out);
}

.chip[data-value='yes'] {
  background: var(--blue);
  color: var(--white);
}

.chip[data-value='maybe'] {
  background: var(--stone-200);
  color: var(--stone-600);
}

.chip[data-value='no'] {
  color: var(--gray);
}

button.chip {
  border: 1px dashed var(--stone-300);
}

button.chip[data-value] {
  border-color: transparent;
}

button.chip[data-value='no'] {
  border: 1px solid var(--stone-200);
}

button.chip:active {
  transform: scale(0.96);
}

button.chip:focus {
  outline: none;
}

button.chip:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (hover: hover) {
  button.chip:not([data-value]):hover {
    border-color: var(--blue);
    color: var(--blue);
  }
}

/* Editing row */
tr.is-editing td,
tr.is-editing th {
  background: var(--body);
}

.name-input {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--stone-300);
  border-radius: 0.5rem;
  background: var(--white);
  transition: border-color 0.15s var(--ease);
  /* 16px avoids iOS zoom on focus */
  font-size: 16px;
}

@media (min-width: 1024px) {
  .name-input {
    font-size: inherit;
  }
}

.name-input::placeholder {
  color: var(--gray);
}

.name-input:focus {
  outline: none;
  border-color: var(--blue);
}

/* Totals */
tfoot th,
tfoot td {
  padding-top: 0.75rem;
  padding-bottom: 1rem;
}

.total.is-best {
  color: var(--blue);
}

/* Actions --------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  background: var(--white);
  color: var(--blue);
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

@media (hover: hover) {
  .btn:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
  }
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.link {
  color: var(--gray);
}

.link:hover {
  color: var(--default);
}

.message {
  color: var(--gray);
}

.message.is-error {
  color: var(--blue);
}

.legend {
  margin-top: 3rem;
  color: var(--gray);
}

.empty {
  min-height: 60svh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
