.num {
  font-variant-numeric: tabular-nums;
}

/* Opening */

.open {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 40px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  gap: 24px 64px;
  align-items: center;
}
.open h1 {
  margin: 0 0 14px;
  max-width: 26ch;
  color: var(--text-high);
  font-size: clamp(32px, 3.4vw, 50px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.open p {
  margin: 0;
  max-width: 66ch;
  font-size: 17px;
  line-height: 1.55;
}
.open-action .code-block {
  margin: 0 0 10px;
}
.open-action .code-head {
  min-height: 28px;
}
.open-action .code-block pre {
  font-size: 16px;
  padding: 10px 14px;
}
.open-action .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.open-action .note {
  margin: 8px 0 0;
  color: var(--text-low);
  font-size: 13px;
  line-height: 1.5;
}

/* The simulation: a control bar over the app window */

.sim {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
.sim-bar {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 0 4px 12px 16px;
}
.sim-bar {
  justify-content: flex-end;
}
.sim-tag {
  margin: 0;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-low);
  font-size: 12px;
  font-weight: 500;
}
.sim-bar .tally.merged {
  margin-right: auto;
}
.sim-after {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 48px;
  align-items: baseline;
  padding: 18px 16px 0;
}
.sim-lede {
  margin: 0;
  max-width: 66ch;
  color: var(--text-high);
  font-size: 18px;
  line-height: 1.55;
}
.sim-caption {
  margin: 0;
  max-width: 34ch;
  color: var(--text-low);
  font-size: 13px;
  line-height: 1.5;
}
.tally {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-low);
  font-size: 13px;
  font-weight: 500;
}
.tally strong {
  min-width: 1.4ch;
  color: var(--text-high);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: right;
}
.tally .bar {
  display: inline-flex;
  gap: 3px;
  align-self: center;
}
.tally .bar i {
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: var(--brand);
  transition:
    background-color 0.4s var(--ease-out),
    opacity 0.4s;
}
.tally .bar i.off {
  background: var(--border);
}
.tally.merged strong {
  color: var(--success);
}
.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.seg button,
.ctl {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 13px var(--font-sans);
  cursor: pointer;
}
.seg button[aria-pressed='true'] {
  background: var(--panel);
  color: var(--text-high);
  font-weight: 600;
}
.seg button:hover,
.ctl:hover {
  color: var(--text-high);
}
.ctl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-high);
  font-weight: 600;
}
.ctl:hover {
  background: var(--panel);
}
.ctl svg {
  width: 14px;
  height: 14px;
}

.app {
  position: relative;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  height: clamp(540px, calc(100vh - 250px), 700px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  user-select: none;
}
.app-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--border);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px 6px;
  color: var(--text-high);
  font-size: 17px;
  font-weight: 700;
}
.app-brand svg {
  color: var(--brand);
}
.app-project {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin-bottom: 10px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-high);
  font-size: 14px;
  font-weight: 600;
}
.tile {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-soft-fg);
  font-size: 12px;
  font-weight: 700;
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.app-nav svg {
  width: 16px;
  height: 16px;
  color: var(--text-low);
}
.app-nav.on {
  background: var(--panel);
  color: var(--text-high);
}
.app-nav.on svg {
  color: var(--brand);
}
.mode {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-high);
  font-size: 14px;
  font-weight: 700;
}
.mode p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}
.switch {
  position: relative;
  width: 34px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.25s var(--ease-out);
}
.switch[aria-checked='true'] {
  background: var(--brand);
}
.switch[aria-checked='true']::after {
  transform: translateX(14px);
}
.app-foot {
  display: flex;
  justify-content: space-between;
  padding: 10px 6px 0;
  color: var(--text-low);
  font-size: 12px;
}
.app-foot span:last-child::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--success);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-crumb {
  flex-shrink: 0;
  height: 42px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  line-height: 42px;
}
.app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px 6px;
}
.app-head h2 {
  margin: 0;
  color: var(--text-high);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--attention-soft);
  color: var(--attention-fg);
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.3s;
}
.pill.zero {
  display: none;
}
.app-head .count {
  color: var(--text-low);
  font-size: 13px;
}
.cols {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(176px, 1fr));
  gap: 12px;
  padding: 12px 22px 22px;
  overflow: auto hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.col-head {
  padding: 2px 2px 4px;
}
.col-head b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-high);
  font-size: 14px;
}
.col-head b .dot {
  width: 10px;
  height: 10px;
}
.col-head b em {
  color: var(--text-low);
  font-style: normal;
  font-weight: 500;
}
.col-head small {
  display: block;
  margin-top: 2px;
  color: var(--text-low);
  font-size: 12px;
  line-height: 1.4;
}
.dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.dot.hollow {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--text-low);
}
.dot.green {
  background: var(--success);
}
.dot.amber {
  background: var(--attention);
}

.k {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s var(--ease-out);
}
.k.need {
  border-color: var(--attention-border);
}
.k.lifted {
  border-color: var(--brand);
}
.k-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--attention-soft);
  color: var(--attention-fg);
  font-size: 12px;
  font-weight: 700;
}
.k-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 14px 12px;
}
.k-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.k-key {
  color: var(--text-low);
  font-family: var(--font-mono);
  font-size: 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}
.chip.bug {
  background: var(--error-soft);
  color: var(--error);
}
.chip.inv {
  background: var(--panel);
  color: var(--text);
}
.chip.pr {
  background: var(--brand-soft);
  color: var(--brand-soft-fg);
}
.chip.merged {
  background: var(--success-soft);
  color: var(--success);
}
.k-title {
  margin: 0;
  color: var(--text-high);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}
.k-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  line-height: 1.35;
}
.k-status.working {
  color: var(--brand-text);
  font-weight: 500;
}
.k-status.working .dot {
  animation: breathe 1.6s ease-in-out infinite;
}
.k-status.idle {
  color: var(--text-low);
}
.k-status.idle svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.k-status.attn {
  color: var(--attention-fg);
  font-weight: 600;
}
.k-status.done {
  color: var(--success);
  font-weight: 600;
}
.k-status code {
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.k-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.fbtn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-high);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    transform 0.15s var(--ease-out);
}
.fbtn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}
.fbtn.pressed {
  transform: scale(0.96);
}
.fbtn.primary.pressed {
  background: var(--brand-hover);
}
@keyframes breathe {
  50% {
    opacity: 0.35;
  }
}

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  transform: translate(120px, 380px);
  transition: opacity 0.4s;
}
.cursor svg {
  display: block;
  width: 20px;
  height: 20px;
}
.cursor span {
  position: absolute;
  top: 18px;
  left: 14px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.cursor.rest {
  opacity: 0.55;
}
.cursor.away {
  opacity: 0;
}

.clear {
  position: absolute;
  inset: 42px 0 0 232px;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text-high);
  font-size: 20px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out);
}
.clear.show {
  opacity: 0.94;
}
.clear span {
  display: block;
  margin-top: 4px;
  color: var(--text-low);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* Sections below the board */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.sec {
  padding-top: 112px;
}
.sec h2 {
  margin: 0 0 14px;
  max-width: 22ch;
  color: var(--text-high);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.sec .lede {
  margin: 0 0 40px;
  max-width: 62ch;
  font-size: 18px;
}

.track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.track li {
  position: relative;
  padding-top: 26px;
  border-top: 2px solid var(--brand);
}
.track li:last-child {
  border-top-color: var(--border);
}
.track li::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--bg);
}
.track li:last-child::before {
  background: var(--text-low);
}
.track h3 {
  margin: 0 0 4px;
  color: var(--text-high);
  font-size: 19px;
  font-weight: 700;
}
.track .proves {
  margin: 0 0 10px;
  color: var(--brand-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.track p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}
.track code,
.gate code,
.more code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--panel);
  color: var(--text-high);
  font-size: 0.86em;
}

.gate {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
}
.gate .modes {
  display: grid;
  gap: 20px;
  margin: 28px 0 0;
}
.gate .modes div {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}
.gate .modes b {
  display: block;
  margin-bottom: 4px;
  color: var(--text-high);
  font-size: 16px;
}
.gate .modes p {
  margin: 0;
  font-size: 15px;
}
.gate figure {
  margin: 0 -40px 0 0;
}
.gate img,
.gate video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.gate figcaption {
  margin-top: 10px;
  color: var(--text-low);
  font-size: 13px;
}

.remember {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px 72px;
  align-items: start;
}
.remember-lead h3 {
  margin: 0 0 12px;
  color: var(--text-high);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.remember-lead p {
  margin: 0 0 16px;
  max-width: 52ch;
  color: var(--text-high);
  font-size: 20px;
  line-height: 1.55;
}
.more {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.more li {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.more li:last-child {
  border-bottom: 1px solid var(--border);
}
.more h3 {
  margin: 0 0 8px;
  color: var(--text-high);
  font-size: 18px;
  font-weight: 700;
}
.more p {
  margin: 0 0 10px;
  font-size: 15px;
}
.more a {
  font-size: 14px;
  font-weight: 500;
}
.wire {
  margin: 48px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 8px 24px;
  font-size: 15px;
}
.wire dt {
  color: var(--text-high);
  font-weight: 600;
}
.wire dd {
  margin: 0;
}

.tammy-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 96px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tammy-row img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.tammy-row p {
  margin: 0 auto 0 0;
  max-width: 72ch;
  font-size: 15px;
}
.tammy-row strong {
  color: var(--text-high);
}

.close {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 40px 72px;
  align-items: start;
}
.close .rail {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.close .rail li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.close .rail li:last-child {
  border-bottom: 1px solid var(--border);
}
.close .rail span {
  color: var(--brand-text);
  font-size: 14px;
  font-weight: 600;
}
.close .rail b {
  display: block;
  color: var(--text-high);
}
.close .rail p {
  margin: 0;
  font-size: 15px;
}
.close .code-block {
  margin-bottom: 14px;
}
.close .code-block pre {
  font-size: 16px;
}
.close .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.close .need {
  margin: 18px 0 0;
  color: var(--text-low);
  font-size: 14px;
}

@media (max-width: 1359px) {
  .app {
    grid-template-columns: 192px minmax(0, 1fr);
  }
  .app-side {
    padding: 16px 10px 12px;
  }
  .mode p {
    display: none;
  }
}
@media (max-width: 1099px) {
  .remember,
  .sim-after {
    grid-template-columns: minmax(0, 1fr);
  }
  .open,
  .close,
  .gate {
    grid-template-columns: minmax(0, 1fr);
  }
  .gate figure {
    margin: 0;
  }
  .track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 28px;
  }
}
@media (max-width: 899px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    height: 560px;
  }
  .app-side {
    display: none;
  }
  .clear {
    inset: 42px 0 0 0;
  }
}
@media (max-width: 639px) {
  .open {
    padding: 26px 16px 20px;
    gap: 18px;
  }
  .open p {
    font-size: 16px;
  }
  .open-action .code-block pre {
    padding: 10px 14px;
    font-size: 15px;
  }
  .cols {
    grid-template-columns: repeat(5, 244px);
    padding: 12px 16px 18px;
  }
  .app-head {
    padding: 16px 16px 4px;
  }
  .sim {
    padding: 0 8px;
  }
  .sim-bar {
    padding: 0 8px 10px;
  }
  .sim-bar {
    gap: 10px 14px;
    justify-content: flex-start;
  }
  .sim-tag {
    order: 9;
  }
  .tally strong {
    font-size: 22px;
  }
  .sim-lede {
    font-size: 16px;
  }
  .remember-lead p {
    font-size: 17px;
  }
  .wrap {
    padding: 0 16px;
  }
  .sec {
    padding-top: 80px;
  }
  .sec .lede {
    font-size: 16px;
  }
  .track {
    grid-template-columns: minmax(0, 1fr);
  }
  .wire,
  .close .rail li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .tammy-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .app-head {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-status.working .dot {
    animation: none;
  }
}
