/* Dark only, on purpose: the audience lives in a terminal and the wheel's
   colours are tuned against a dark ground. */
:root {
  --bg: #0a0d13;
  --bg-soft: #0f141d;
  --surface: #141b26;
  --surface-2: #1b2431;
  --line: #263141;
  --text: #e6edf3;
  --muted: #93a1b1;
  --dim: #6b7a8c;
  --accent: #4ade80;
  --accent-dim: #22c55e;

  --d1: #4ade80; /* Gentle   */
  --d2: #60a5fa; /* Involved */
  --d3: #fbbf24; /* Hard     */
  --d4: #f87171; /* Infernal */

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 50% -8%, #16202e 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 19, .72);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  font-family: var(--mono); font-weight: 700; color: var(--accent);
  background: var(--surface); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 6px; font-size: 14px;
}
.brand-name { font-family: var(--mono); font-weight: 600; letter-spacing: -.02em; }
.brand-dim { color: var(--dim); }
.topnav { display: flex; gap: 22px; font-size: 14px; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }

/* ---------- hero ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 28px 80px; }

.hero { padding: 64px 0 24px; text-align: center; }

.kicker {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); margin: 0 0 18px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.08; letter-spacing: -.03em; font-weight: 700;
}
.hl {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  margin: 0 auto; max-width: 56ch; color: var(--muted); font-size: 17px;
}
.lede strong { color: var(--text); font-weight: 600; }

/* ---------- wheel ---------- */
.stage {
  margin-top: 48px;
  display: flex; align-items: center; justify-content: center;
  gap: 56px; flex-wrap: wrap;
}

.wheel-wrap { position: relative; width: 320px; height: 320px; flex: none; }

.wheel-shell {
  width: 100%; height: 100%; border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 10px var(--bg-soft), 0 26px 60px -18px rgba(0,0,0,.85);
  overflow: hidden;
}

#wheel {
  width: 100%; height: 100%; display: block;
  transform: rotate(0deg);
  transition: transform 4.6s cubic-bezier(.13, .82, .13, 1);
}

.wheel-hub {
  position: absolute; inset: 0; margin: auto;
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0,0,0,.6);
  pointer-events: none;
}

.pointer {
  position: absolute; top: -14px; left: 50%; translate: -50% 0; z-index: 3;
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--accent);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.7));
}

.stage-side { display: flex; flex-direction: column; gap: 12px; width: 264px; }

.btn {
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 13px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: .16s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #06210f; }
.btn-primary:hover:not(:disabled) { background: #5eeb93; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: #33445a; }

.hint { margin: 4px 0 0; font-size: 13px; color: var(--dim); line-height: 1.5; }

/* ---------- challenge card ---------- */
.card {
  margin-top: 56px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 28px 30px 24px;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.9);
  animation: rise .45s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.card-kicker {
  margin: 0 0 4px; font-family: var(--mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.card-head h2 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid currentColor; white-space: nowrap;
}
.pill-quiet { color: var(--muted); border-color: var(--line); background: var(--surface-2); }
.pill[data-d="1"] { color: var(--d1); }
.pill[data-d="2"] { color: var(--d2); }
.pill[data-d="3"] { color: var(--d3); }
.pill[data-d="4"] { color: var(--d4); }

.progress { display: flex; align-items: center; gap: 14px; margin: 18px 0 4px; }
.progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width .3s ease;
}
.progress-text {
  margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--dim);
  white-space: nowrap;
}

.tasks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.tasks li { margin: 0; }
.tasks label {
  display: flex; gap: 13px; align-items: flex-start; cursor: pointer;
  padding: 13px 15px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid transparent;
  transition: .15s ease;
}
.tasks label:hover { border-color: var(--line); }
.tasks input { margin: 3px 0 0; accent-color: var(--accent-dim); width: 16px; height: 16px; flex: none; }
.tasks .done span { color: var(--dim); text-decoration: line-through; }
.tasks .done { background: transparent; }

.hints { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.hints summary {
  cursor: pointer; font-size: 14px; color: var(--muted);
  font-family: var(--mono); list-style: none;
}
.hints summary::-webkit-details-marker { display: none; }
.hints summary::before { content: "> "; color: var(--dim); }
.hints[open] summary::before { content: "v "; }
.hint-count { color: var(--dim); }
.hints ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.hints li { margin-bottom: 7px; }

.card-foot {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.badge-preview {
  display: inline-flex; font-family: var(--mono); font-size: 11.5px;
  border-radius: 4px; overflow: hidden; flex: none; opacity: .5;
  filter: grayscale(1); transition: .3s ease;
}
.badge-preview.earned { opacity: 1; filter: none; }
.badge-left { background: #3b4351; color: #fff; padding: 4px 8px; }
.badge-right { background: var(--accent-dim); color: #06210f; padding: 4px 8px; font-weight: 700; }
.badge-note { margin: 0; font-size: 13px; color: var(--dim); flex: 1; min-width: 220px; }
.badge-note em { color: var(--muted); font-style: normal; }

/* ---------- how ---------- */
.how { margin-top: 84px; }
.how h2 {
  font-size: 13px; font-family: var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim); margin: 0 0 22px; font-weight: 600;
}
.how-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.how article {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 22px 20px;
}
.step { font-family: var(--mono); font-size: 12px; color: var(--accent-dim); }
.how h3 { margin: 10px 0 8px; font-size: 17px; letter-spacing: -.01em; }
.how p { margin: 0; color: var(--muted); font-size: 14.5px; }

.foot {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 26px 28px; text-align: center; color: var(--dim); font-size: 14px;
}
.foot p { margin: 0; }

@media (max-width: 720px) {
  .stage { gap: 32px; }
  .stage-side { width: 100%; max-width: 320px; }
  .card { padding: 22px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  #wheel { transition-duration: .3s; }
  .card { animation: none; }
}
