:root {
  color-scheme: dark;
  --bg: #0a0e12;
  --panel: #121820;
  --panel-2: #171f29;
  --line: #2a3542;
  --text: #ecf1f6;
  --dim: #99a8b8;
  --accent: #e8a15b;
  --accent-2: #67c7ff;
  --good: #61d095;
  --bad: #ff7b72;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(circle at 50% -10%, #202b37 0, var(--bg) 38rem);
  color: var(--text);
}
a {
  color: var(--accent-2);
}
code,
pre,
select,
input,
button {
  font: inherit;
}
code {
  color: #ffd099;
}
.hero,
main,
footer {
  width: min(1540px, calc(100% - 32px));
  margin-inline: auto;
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  padding: 46px 0 24px;
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}
h1 {
  margin: 8px 0;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero > div:first-child p {
  color: var(--dim);
  max-width: 760px;
  font-size: 17px;
  margin: 14px 0 0;
}
.runtime-card {
  min-width: 265px;
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(18, 24, 32, 0.86);
  border-radius: 12px;
  box-shadow: 0 14px 38px #0006;
}
.runtime-card strong {
  margin-bottom: 3px;
}
.runtime-card span {
  color: var(--dim);
  font-size: 13px;
}
.ok {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--good);
  box-shadow: 0 0 10px #61d09599;
}
.callout {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border: 1px solid #3b4857;
  border-left: 4px solid var(--accent);
  background: #151c24;
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--dim);
  font-size: 14px;
}
.callout strong {
  color: var(--text);
}
.callout a {
  white-space: nowrap;
  font-weight: 700;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(480px, 1.55fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  box-shadow: 0 12px 32px #0004;
  padding: 17px;
}
h2 {
  font-size: 17px;
  margin: 0 0 14px;
}
h3 {
  font-size: 14px;
  margin: 24px 0 10px;
}
label {
  color: var(--dim);
  display: block;
  font-size: 12px;
  font-weight: 700;
}
select,
input,
button {
  border: 1px solid #3a4858;
  border-radius: 7px;
  background: #0f151c;
  color: var(--text);
}
select,
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 9px 10px;
  margin-top: 5px;
}
button {
  cursor: pointer;
  padding: 9px 12px;
  font-weight: 720;
}
button:hover {
  border-color: var(--accent-2);
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  width: 100%;
  color: #181007;
  background: linear-gradient(#ffc17b, var(--accent));
  border-color: #ffc17b;
}
.quiet {
  padding: 5px 8px;
  color: var(--dim);
  font-size: 11px;
}
.hint,
.constraint,
.micro {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}
.constraint {
  border-left: 2px solid var(--accent-2);
  padding-left: 9px;
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 15px 0 8px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.section-head h2 {
  margin-bottom: 0;
}
.project-panel .section-head {
  margin: 24px 0 9px;
}
.section-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.state-editor {
  max-height: 380px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}
.state-row {
  display: grid;
  grid-template-columns: 20px 36px 1fr;
  gap: 7px;
  align-items: center;
}
.state-row input[type="color"] {
  width: 36px;
  height: 31px;
  margin: 0;
  padding: 2px;
}
.state-row input[type="text"] {
  margin: 0;
  padding: 7px;
  font-size: 12px;
}
.state-row input[type="radio"] {
  accent-color: var(--accent);
}
.preview-panel {
  min-width: 0;
}
.status {
  font-size: 12px;
  color: var(--accent-2);
}
hexlife-ca {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 14px;
  background: #080b0f;
}
.transport {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}
.stats div,
.checks div {
  background: #10161d;
  padding: 9px 10px;
}
dt {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
dd {
  margin: 4px 0 0;
  font-variant-numeric: tabular-nums;
}
.census {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.census-item {
  border-left: 3px solid var(--swatch);
  background: #0f151c;
  padding: 7px 8px;
  min-width: 0;
}
.census-item span {
  color: var(--dim);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.census-item strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}
.rule-panel {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: clamp(17px, 2.2vw, 28px);
}
.rule-panel > .section-head {
  align-items: flex-start;
}
.rule-panel > .section-head h2 {
  font-size: 21px;
}
.rule-panel > #rule-help {
  max-width: 920px;
  margin: 9px 0 18px;
  font-size: 13px;
}
.transition-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.transition-stage {
  min-width: 0;
  border: 1px solid #344251;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 52%, #223040 0, #111820 62%), var(--panel);
  padding: 16px;
}
.next-stage {
  border-color: #e8a15b66;
  background:
    radial-gradient(circle at 50% 52%, #3a2c213d 0, #111820 62%), var(--panel);
}
.stage-heading {
  display: flex;
  gap: 10px;
  align-items: center;
}
.stage-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}
.stage-heading p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 11px;
}
.stage-number {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #4a5d70;
  border-radius: 99px;
  background: #0c1218;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
}
.next-stage .stage-number {
  border-color: #e8a15b88;
  color: #ffd099;
}
.transition-diagram {
  --hex-width: 110px;
  --hex-height: 95.26px;
  --hex-x-step: 82.5px;
  --hex-y-half-step: 47.63px;
  position: relative;
  width: min(100%, 480px);
  height: 350px;
  margin: 8px auto 0;
}
.transition-diagram::before {
  position: absolute;
  inset: 50%;
  width: 280px;
  height: 295px;
  translate: -50% -50%;
  border: 1px solid #52627445;
  border-radius: 50%;
  background: radial-gradient(circle, #67c7ff0a 0, transparent 67%);
  content: "";
  pointer-events: none;
}
.transition-diagram[data-backend="block"]::before {
  display: none;
}
.transition-diagram[data-backend="block"] {
  --hex-width: 146px;
  --hex-height: 126.44px;
  --hex-x-half-step: 54.75px;
  --hex-y-half-step: 63.22px;
  height: 290px;
}
.rule-cell {
  --cell-colour: #11161c;
  --cell-ink: #f5f7fa;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: var(--hex-width);
  height: var(--hex-height);
  translate: -50% -50%;
  color: var(--dim);
  cursor: pointer;
  text-align: center;
}
.transition-diagram[data-backend="neighborhood"] .rule-cell[data-slot="N"] {
  top: calc(50% - var(--hex-height));
}
.transition-diagram[data-backend="neighborhood"] .rule-cell[data-slot="S"] {
  top: calc(50% + var(--hex-height));
}
.transition-diagram[data-backend="neighborhood"] .rule-cell[data-slot="NW"] {
  left: calc(50% - var(--hex-x-step));
  top: calc(50% - var(--hex-y-half-step));
}
.transition-diagram[data-backend="neighborhood"] .rule-cell[data-slot="SW"] {
  left: calc(50% - var(--hex-x-step));
  top: calc(50% + var(--hex-y-half-step));
}
.transition-diagram[data-backend="neighborhood"] .rule-cell[data-slot="NE"] {
  left: calc(50% + var(--hex-x-step));
  top: calc(50% - var(--hex-y-half-step));
}
.transition-diagram[data-backend="neighborhood"] .rule-cell[data-slot="SE"] {
  left: calc(50% + var(--hex-x-step));
  top: calc(50% + var(--hex-y-half-step));
}
.transition-diagram[data-backend="block"] .rule-cell[data-slot="top"] {
  left: calc(50% - var(--hex-x-half-step));
  top: calc(50% - var(--hex-y-half-step));
}
.transition-diagram[data-backend="block"] .rule-cell[data-slot="down-right"] {
  left: calc(50% + var(--hex-x-half-step));
}
.transition-diagram[data-backend="block"] .rule-cell[data-slot="below"] {
  left: calc(50% - var(--hex-x-half-step));
  top: calc(50% + var(--hex-y-half-step));
}
.rule-cell-location {
  position: absolute;
  z-index: 2;
  top: 13%;
  left: 50%;
  translate: -50% 0;
  color: color-mix(in srgb, var(--cell-ink) 78%, transparent);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 1px 3px #000b;
  text-transform: uppercase;
}
.transition-diagram[data-backend="block"] .rule-cell-location {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.rule-hex {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24% 13% 14%;
  place-content: center;
  appearance: none;
  border: 0;
  border-radius: 0;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background:
    linear-gradient(145deg, #ffffff20 0, transparent 38%, #0000002b 100%),
    var(--cell-colour);
  color: var(--cell-ink);
  cursor: pointer;
  font: inherit;
  filter: drop-shadow(0 6px 9px #0008);
  transition:
    scale 0.16s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.16s ease,
    opacity 0.16s ease;
}
.rule-hex::after {
  position: absolute;
  inset: 2px;
  clip-path: inherit;
  border: 1px solid #ffffff4d;
  content: "";
}
.rule-hex::before {
  position: absolute;
  z-index: 2;
  right: 25%;
  bottom: 13%;
  width: 6px;
  height: 6px;
  rotate: 45deg;
  border-right: 1.5px solid var(--cell-ink);
  border-bottom: 1.5px solid var(--cell-ink);
  content: "";
  opacity: 0.62;
}
.rule-hex-value,
.rule-hex-name {
  position: relative;
  z-index: 1;
  display: block;
  max-width: calc(var(--hex-width) * 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000c;
}
.rule-hex-value {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.78;
}
.rule-hex-name {
  display: -webkit-box;
  margin-top: 6px;
  font-size: clamp(9px, 1.05vw, 12px);
  font-weight: 800;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}
.rule-cell select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}
.rule-cell:hover .rule-hex,
.rule-cell:focus-within .rule-hex {
  z-index: 4;
  scale: 1.055;
  filter: drop-shadow(0 10px 15px #000c) brightness(1.11);
}
.rule-cell:focus-within .rule-hex {
  filter: drop-shadow(0 0 4px var(--accent-2)) drop-shadow(0 10px 15px #000c)
    brightness(1.11);
}
.rule-cell.is-changed .rule-hex {
  filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 8px 12px #000b);
}
.rule-cell.is-focus .rule-hex {
  filter: drop-shadow(0 0 5px #67c7ff99) drop-shadow(0 8px 12px #000b);
}
.rule-cell.is-picker-open .rule-hex {
  z-index: 4;
  scale: 1.055;
  filter: drop-shadow(0 0 7px var(--accent-2)) drop-shadow(0 10px 15px #000c)
    brightness(1.12);
}
.rule-cell.is-ghost {
  pointer-events: none;
  opacity: 0.24;
}
.rule-cell.is-ghost .rule-hex::after {
  border-style: dashed;
}
.rule-cell.is-ghost .rule-hex::before {
  content: none;
}
.state-picker {
  position: fixed;
  z-index: 1000;
  max-height: min(480px, calc(100vh - 24px));
  overflow: hidden;
  padding: 12px;
  border: 1px solid #526274;
  border-radius: 14px;
  background: #101821f7;
  box-shadow:
    0 24px 70px #000d,
    0 0 0 1px #ffffff0a inset;
  backdrop-filter: blur(18px);
}
.state-picker[hidden] {
  display: none;
}
.state-picker-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 10px;
}
.state-picker-heading > div {
  display: grid;
  gap: 2px;
}
.state-picker-heading span {
  color: var(--dim);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.state-picker-heading strong {
  color: var(--text);
  font-size: 15px;
  text-transform: capitalize;
}
.state-picker-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border-radius: 99px;
  color: var(--dim);
  font-size: 22px;
  font-weight: 400;
}
.state-picker-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding: 2px;
}
.state-picker-option {
  display: grid;
  grid-template-columns: 25px 20px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border-color: #344251;
  background: #0b1117;
  color: #dce4ec;
  text-align: left;
}
.state-picker-option:hover,
.state-picker-option:focus-visible {
  border-color: var(--accent-2);
  background: #17222d;
}
.state-picker-option.is-selected {
  border-color: #e8a15b99;
  background: #e8a15b18;
  box-shadow: 0 0 0 1px #e8a15b33 inset;
}
.state-picker-swatch {
  width: 23px;
  height: 20px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--option-colour);
  box-shadow: 0 0 0 1px #ffffff44 inset;
}
.state-picker-option strong {
  color: var(--dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.state-picker-option > span:last-child {
  overflow: hidden;
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transition-flow {
  display: grid;
  align-self: center;
  justify-items: center;
  color: var(--accent);
}
.transition-flow span {
  color: var(--dim);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
.transition-flow strong {
  margin-top: 10px;
  font-size: 36px;
  line-height: 1;
}
.transition-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #2d3946;
  border-radius: 10px;
  background: #0d131a;
}
.summary-lead {
  margin-right: 4px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.summary-change {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #33404d;
  border-radius: 7px;
  background: #141c25;
  color: #dce4ec;
  font-size: 11px;
}
.summary-change.is-changed {
  border-color: #e8a15b88;
  background: #e8a15b12;
}
.summary-location {
  color: var(--dim);
  font-weight: 750;
}
.summary-swatch {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--summary-colour);
  box-shadow: 0 0 0 1px #ffffff33;
}
.summary-arrow {
  color: var(--accent);
}
.transition-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 290px);
  gap: 18px;
  align-items: center;
  margin-top: 12px;
}
.transition-actions .micro {
  margin: 6px 0 0;
}
.edit-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--good);
  font-size: 11px;
  font-weight: 800;
}
.edit-status::before {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
  content: "";
}
.edit-status.is-dirty {
  color: #ffc17b;
}
#apply-transition {
  margin: 0;
}
.checks-title {
  margin-top: 28px;
}
.checks {
  display: grid;
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
  margin: 0;
}
.checks div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.checks dd {
  font-size: 12px;
  text-align: right;
}
.pass {
  color: var(--good);
}
.fail {
  color: var(--bad);
}
.export-panel {
  margin-top: 14px;
}
.export-panel .section-head {
  align-items: start;
}
.export-panel h2 {
  margin-bottom: 5px;
}
.export-panel p {
  margin: 0;
}
.export-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: end;
}
pre {
  max-height: 390px;
  overflow: auto;
  margin: 16px -4px -4px;
  padding: 16px;
  border: 1px solid #26313e;
  border-radius: 8px;
  background: #090d12;
  color: #d9e3ed;
  font:
    12px/1.55 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre;
}
.explainers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.explainers p {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
footer {
  display: flex;
  gap: 9px;
  justify-content: center;
  padding: 30px 0 40px;
  color: var(--dim);
  font-size: 13px;
}
#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  translate: 0 20px;
  opacity: 0;
  pointer-events: none;
  background: #eaf5ee;
  color: #102117;
  padding: 11px 15px;
  border-radius: 8px;
  font-weight: 750;
  transition: 0.18s ease;
  box-shadow: 0 12px 30px #0008;
}
#toast.show {
  translate: 0;
  opacity: 1;
}
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: minmax(250px, 0.8fr) minmax(400px, 1.2fr);
  }
  .transition-diagram {
    height: 390px;
  }
}
@media (max-width: 860px) {
  .transition-workbench {
    grid-template-columns: 1fr;
  }
  .transition-flow {
    grid-auto-flow: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
  }
  .transition-flow span {
    writing-mode: initial;
  }
  .transition-flow strong {
    margin: 0;
    rotate: 90deg;
  }
}
@media (max-width: 760px) {
  .state-picker {
    top: auto !important;
    right: 10px;
    bottom: 10px;
    left: 10px !important;
    width: auto !important;
    max-height: min(58vh, 480px);
    border-color: #66798c;
    border-radius: 18px;
    box-shadow: 0 16px 60px #000f;
  }
  .state-picker-options {
    max-height: calc(min(58vh, 480px) - 62px);
  }
  .hero {
    align-items: stretch;
    flex-direction: column;
  }
  .runtime-card {
    min-width: 0;
  }
  .callout {
    align-items: start;
    flex-direction: column;
  }
  .workspace,
  .explainers {
    grid-template-columns: 1fr;
  }
  .rule-panel {
    grid-column: auto;
  }
  .transition-stage {
    padding: 13px 8px;
  }
  .transition-diagram {
    --hex-width: 86px;
    --hex-height: 74.48px;
    --hex-x-step: 64.5px;
    --hex-y-half-step: 37.24px;
    height: 290px;
  }
  .transition-diagram::before {
    width: 220px;
    height: 230px;
  }
  .transition-diagram[data-backend="block"] {
    --hex-width: 116px;
    --hex-height: 100.46px;
    --hex-x-half-step: 43.5px;
    --hex-y-half-step: 50.23px;
    height: 250px;
  }
  .transition-actions {
    grid-template-columns: 1fr;
  }
  .export-panel .section-head {
    flex-direction: column;
  }
  .export-actions {
    justify-content: start;
  }
}
@media (max-width: 440px) {
  .state-picker-options {
    grid-template-columns: 1fr;
  }
}
