:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #ffffff;
  --muted: #a8a8a8;
  --line: #2b2b2b;
  --line-strong: #6f6f6f;
  --surface: #0b0b0b;
  --field: #141414;
  --idle: #262626;
  --range: #777777;
  --miss: #ffb4a8;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

h1,
h2 {
  font-weight: 400;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1:focus,
[tabindex="-1"]:focus {
  outline: none;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

button,
input,
textarea {
  font: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  width: min(800px, 100%);
  flex: 1;
  margin: 0 auto;
  padding: clamp(16px, 6vw, 64px) 16px 32px;
}

.card {
  padding: clamp(20px, 5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.view {
  animation: rise 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 15px;
}

.card h1 {
  font-size: clamp(30px, 6.5vw, 42px);
  line-height: 1.12;
}

.lede {
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
  text-wrap: pretty;
}

.btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  background: var(--idle);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}

.btn-primary {
  color: var(--bg);
  background: var(--fg);
}

.btn:disabled {
  color: var(--muted);
  background: var(--idle);
  cursor: not-allowed;
}

.btn-small {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
}

.text-link {
  min-height: 24px;
  padding: 0;
  color: var(--fg);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- forms ---------- */

form {
  display: grid;
  gap: 10px;
}

.input-card form {
  margin-top: 22px;
}

textarea {
  display: block;
  width: 100%;
  resize: vertical;
  padding: 14px;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

textarea[readonly] {
  color: var(--muted);
}

.form-note,
.form-hint {
  color: var(--muted);
  font-size: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 6px;
}

.form-error,
.proof-status.is-miss {
  color: var(--miss);
}

.cancel {
  margin-top: 20px;
  font-size: 15px;
}

/* ---------- result ---------- */

.result-head,
.next-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.total {
  display: grid;
  flex: none;
  text-align: right;
}

.total span {
  color: var(--muted);
  font-size: 15px;
}

.total strong {
  font-size: 22px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reason {
  margin-top: 12px;
  text-wrap: pretty;
}

.spectrum {
  display: grid;
  height: 96px;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 5px;
  margin-top: 26px;
}

.spectrum li {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.spectrum .bar {
  display: block;
  height: calc(10px + (var(--step) - 1) * 6.5px);
  background: var(--idle);
  border-radius: 3px 3px 0 0;
}

.spectrum .is-past .bar {
  background: var(--range);
}

.spectrum .is-current .bar {
  background: var(--fg);
}

.spectrum .is-next .bar {
  background: transparent;
  border: 1px dashed var(--fg);
}

.spectrum .is-current,
.spectrum .is-next {
  color: var(--fg);
}

hr {
  height: 1px;
  margin: 28px 0 24px;
  background: var(--line);
  border: 0;
}

.next-head {
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.next-head h2 {
  font-size: 22px;
  line-height: 1.25;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  vertical-align: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.next-xp {
  color: var(--muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 8px;
  margin: 14px 0 16px;
  overflow: hidden;
  background: var(--idle);
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--fg);
  border-radius: inherit;
  transition: width 220ms ease;
}

.next-copy {
  color: var(--muted);
  text-wrap: pretty;
}

.next-copy a {
  color: var(--fg);
}

.level-up {
  width: 100%;
  margin-top: 18px;
}

.tasks-label {
  margin: 26px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.circle {
  width: 24px;
  height: 24px;
  margin: 0;
  appearance: none;
  background: transparent;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
}

.circle:disabled {
  cursor: default;
}

.circle:checked {
  background:
    no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 7.5 3 3 6-7'/%3E%3C/svg%3E"),
    var(--fg);
  border-color: var(--fg);
}

.task-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  font-size: 17px;
  line-height: 1.35;
}

.task-title label {
  cursor: pointer;
}

.task-meta,
.task-sub {
  color: var(--muted);
  font-size: 14px;
}

.task-meta {
  font-variant-numeric: tabular-nums;
}

.task-sub {
  margin-top: 3px;
  text-wrap: pretty;
}

.task-panel {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 12px;
}

.task-panel form {
  width: 100%;
}

.proof-status:empty {
  display: none;
}

.caution {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.all-levels {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}

.all-levels summary {
  min-height: 44px;
  padding: 12px 0 0;
  cursor: pointer;
}

.all-levels ol {
  padding-top: 8px;
}

.all-levels li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 8px 0;
  color: var(--muted);
}

.all-levels strong {
  font-weight: 400;
}

.all-levels p {
  font-size: 14px;
}

.all-levels .is-current,
.all-levels .is-current strong {
  color: var(--fg);
  font-weight: 700;
}

.all-levels .is-current p {
  color: var(--fg);
  font-weight: 400;
}

.list-number {
  font-variant-numeric: tabular-nums;
}

.share {
  margin-top: 18px;
}

.share-panel {
  margin-top: 14px;
  padding: 16px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.share-form {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.share-form textarea {
  background: var(--bg);
}

.share-form .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.share-form .form-note:empty {
  display: none;
}

.share-page {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.share-page .lede {
  margin-top: -6px;
}

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

.credit {
  width: min(800px, 100%);
  margin: 0 auto;
  padding: 0 16px 28px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .task {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .task > .btn {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view {
    animation: none;
  }

  .progress span {
    transition: none;
  }
}
