/* Biomorphs (2014 archive): a 1-bit homage to the early Macintosh desktop
   Dawkins wrote the original program on. Everything is scoped to .arc-biomorphs. */

html:has(.arc-biomorphs),
body:has(.arc-biomorphs) {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  color-scheme: light;
}

.arc-biomorphs {
  --bm-ink: #000;
  --bm-paper: #fff;
  --bm-ui: Geneva, "Chicago", "Charcoal", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bm-read: Charter, Georgia, ui-serif, serif;
  --bm-dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23000' fill-opacity='.2'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23000' fill-opacity='.2'/%3E%3C/svg%3E");
  --bm-dither-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23000' fill-opacity='.12'/%3E%3C/svg%3E");
  --bm-stripes: repeating-linear-gradient(to bottom, #000 0 1px, #fff 1px 2px);

  display: block;
  min-height: 100svh;
  background-color: var(--bm-paper);
  background-image: var(--bm-dither);
  color: var(--bm-ink);
  font-family: var(--bm-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.arc-biomorphs *,
.arc-biomorphs *::before,
.arc-biomorphs *::after {
  box-sizing: border-box;
}

.arc-biomorphs a {
  color: inherit;
}

.arc-biomorphs :focus-visible {
  outline: 2px solid var(--bm-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--bm-paper);
}

/* Menu bar ---------------------------------------------------------------- */

.arc-biomorphs .bm-menubar {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--bm-paper);
  border-bottom: 1px solid var(--bm-ink);
  font-size: 14px;
  font-weight: 700;
}

.arc-biomorphs .bm-menubar > * {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

.arc-biomorphs .bm-menubar-home {
  text-decoration: none;
  white-space: nowrap;
}

.arc-biomorphs .bm-menubar-home::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 1px solid currentColor;
  background-image: var(--bm-stripes);
  background-clip: content-box;
  padding: 2px;
}

.arc-biomorphs .bm-menubar-home:hover,
.arc-biomorphs .bm-menubar-archive a:hover {
  background: var(--bm-ink);
  color: var(--bm-paper);
}

.arc-biomorphs .bm-menubar-item {
  font-weight: 400;
}

.arc-biomorphs .bm-menubar-archive {
  gap: 6px;
  margin-left: auto;
  font-weight: 400;
  white-space: nowrap;
}

.arc-biomorphs .bm-menubar-archive a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 6px;
  text-decoration: none;
}

/* Desktop + hero ---------------------------------------------------------- */

.arc-biomorphs .bm-desktop {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 28px 40px;
}

.arc-biomorphs .bm-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "kicker kicker" "title lede";
  align-items: end;
  column-gap: 40px;
  margin: 0 0 32px;
}

.arc-biomorphs .bm-kicker {
  grid-area: kicker;
  justify-self: start;
}

.arc-biomorphs .bm-title {
  grid-area: title;
}

.arc-biomorphs .bm-lede {
  grid-area: lede;
  justify-self: end;
}

.arc-biomorphs .bm-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 3px 10px;
  background: var(--bm-paper);
  border: 1px solid var(--bm-ink);
  font-size: 12px;
  letter-spacing: .02em;
}

/* The one loud gesture: a big title in the classic "Shadow" type style. */
.arc-biomorphs .bm-title {
  margin: 0;
  font-family: var(--bm-ui);
  font-size: clamp(56px, 8.4vw, 108px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.02em;
  color: var(--bm-paper);
  -webkit-text-stroke: 3px var(--bm-ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--bm-ink);
}

.arc-biomorphs .bm-lede {
  max-width: 520px;
  margin: 18px 0 8px;
  padding: 10px 14px;
  background: var(--bm-paper);
  border: 1px solid var(--bm-ink);
  font-family: var(--bm-read);
  font-size: 18px;
  line-height: 1.5;
}

/* Windows ------------------------------------------------------------------ */

.arc-biomorphs .bm-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.arc-biomorphs .bm-side {
  display: grid;
  gap: 28px;
}

.arc-biomorphs .bm-window {
  position: relative;
  background: var(--bm-paper);
  border: 1px solid var(--bm-ink);
  box-shadow: 3px 3px 0 var(--bm-ink);
}

.arc-biomorphs .bm-titlebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  border-bottom: 1px solid var(--bm-ink);
  background: var(--bm-paper);
}

.arc-biomorphs .bm-titlebar--active::before {
  content: "";
  position: absolute;
  inset: 5px 3px;
  background-image: var(--bm-stripes);
}

.arc-biomorphs .bm-titlebar h2,
.arc-biomorphs .bm-titlebar h3 {
  position: relative;
  margin: 0;
  padding: 0 10px;
  background: var(--bm-paper);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 0;
}

.arc-biomorphs .bm-closebox {
  display: none;
}

.arc-biomorphs .bm-titlebar--active .bm-closebox {
  display: block;
  position: absolute;
  left: 10px;
  top: 5px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--bm-ink);
  background: var(--bm-paper);
  box-shadow: 0 0 0 2px var(--bm-paper);
}

.arc-biomorphs .bm-window-body {
  padding: 14px;
}

.arc-biomorphs .bm-statusbar {
  margin: 0;
  padding: 7px 14px;
  border-top: 1px solid var(--bm-ink);
  font-size: 12px;
}

/* Breeding grid ------------------------------------------------------------ */

.arc-biomorphs .bm-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.arc-biomorphs .bm-pane {
  min-width: 0;
  border: 1px solid var(--bm-ink);
  background: var(--bm-paper);
}

.arc-biomorphs .bm-pane-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 19px;
  border-bottom: 1px solid var(--bm-ink);
  font-size: 11px;
  line-height: 1;
  user-select: none;
}

.arc-biomorphs .bm-pane-bar > span {
  position: relative;
  padding: 0 6px;
  background: var(--bm-paper);
}

.arc-biomorphs .bm-pane:has(canvas:hover) .bm-pane-bar::before,
.arc-biomorphs .bm-pane--parent .bm-pane-bar::before {
  content: "";
  position: absolute;
  inset: 4px 3px;
  background-image: var(--bm-stripes);
}

.arc-biomorphs .bm-grid canvas {
  display: block;
  width: 100%;
  height: auto;
}

.arc-biomorphs .bm-pane--parent {
  border-width: 2px;
  box-shadow: 3px 3px 0 var(--bm-ink);
}

.arc-biomorphs .bm-pane--parent .bm-pane-bar {
  font-weight: 700;
}

.arc-biomorphs .bm-pane-stage {
  position: relative;
  background-image: var(--bm-dither-light);
}

.arc-biomorphs .bm-genes-btn {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--bm-ink);
  border-radius: 6px;
  background: var(--bm-paper);
  color: var(--bm-ink);
  box-shadow: 1px 1px 0 var(--bm-ink);
  cursor: pointer;
}

.arc-biomorphs .bm-genes-btn svg {
  color: var(--bm-ink);
}

.arc-biomorphs .bm-genes-btn:hover,
.arc-biomorphs .bm-pane--parent:has(.bm-genes[style*="block"]) .bm-genes-btn {
  background: var(--bm-ink);
}

.arc-biomorphs .bm-genes-btn:hover svg,
.arc-biomorphs .bm-pane--parent:has(.bm-genes[style*="block"]) .bm-genes-btn svg {
  color: var(--bm-paper);
}

.arc-biomorphs .bm-genes-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* Genes dialog: positioned against the grid so it is never narrower than a
   readable slider, even when the parent pane is small on phones. */
.arc-biomorphs .bm-genes {
  position: absolute;
  z-index: 10;
  top: calc(66.667% + 4px);
  left: 50%;
  width: min(100%, 360px);
  transform: translateX(-50%);
  background: var(--bm-paper);
  border: 1px solid var(--bm-ink);
  outline: 3px solid var(--bm-paper);
  box-shadow: 0 0 0 4px var(--bm-ink), 7px 7px 0 4px var(--bm-ink);
}

.arc-biomorphs .bm-genes-body {
  padding: 8px 16px 12px;
}

.arc-biomorphs .bm-genes-group {
  margin: 10px 0 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.arc-biomorphs .bm-gene {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 12px;
}

.arc-biomorphs .bm-gene-num {
  text-align: right;
}

.arc-biomorphs .bm-gene-value {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.arc-biomorphs .bm-gene input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.arc-biomorphs .bm-gene input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border: 1px solid var(--bm-ink);
  background-image: var(--bm-dither);
}

.arc-biomorphs .bm-gene input[type="range"]::-moz-range-track {
  height: 6px;
  border: 1px solid var(--bm-ink);
  background-image: var(--bm-dither);
}

.arc-biomorphs .bm-gene input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 20px;
  margin-top: -8px;
  border: 1px solid var(--bm-ink);
  border-radius: 0;
  background: var(--bm-paper);
  box-shadow: 1px 1px 0 var(--bm-ink);
}

.arc-biomorphs .bm-gene input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 18px;
  border: 1px solid var(--bm-ink);
  border-radius: 0;
  background: var(--bm-paper);
  box-shadow: 1px 1px 0 var(--bm-ink);
}

.arc-biomorphs .bm-gene input[type="range"]:focus-visible {
  outline-offset: 0;
  box-shadow: none;
}

.arc-biomorphs .bm-genes-note {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px dotted var(--bm-ink);
  font-size: 11px;
}

/* Specimens (examples are rendered by the controller, white on transparent,
   so they are inverted to black ink here). */

.arc-biomorphs .bm-side-note {
  margin: 0 0 10px;
  font-size: 12px;
}

.arc-biomorphs .bm-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.arc-biomorphs .bm-examples > div {
  flex-direction: column-reverse;
  align-items: center;
  user-select: none;
}

.arc-biomorphs .bm-examples canvas {
  display: block;
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  filter: invert(1);
}

.arc-biomorphs .bm-examples > div > div {
  margin: 4px 0 0;
  padding: 1px 6px;
  color: var(--bm-ink);
  font-family: var(--bm-ui);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.arc-biomorphs .bm-examples > div:hover canvas {
  filter: none;
  background: var(--bm-ink);
}

.arc-biomorphs .bm-examples > div:hover > div {
  background: var(--bm-ink);
  color: var(--bm-paper);
}

/* Get Info ----------------------------------------------------------------- */

.arc-biomorphs .bm-info {
  margin: 0;
  padding: 12px 14px 4px;
  font-size: 13px;
}

.arc-biomorphs .bm-info > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
}

.arc-biomorphs .bm-info dt {
  font-weight: 700;
}

.arc-biomorphs .bm-info dt::after {
  content: ":";
}

.arc-biomorphs .bm-info dd {
  flex: 1;
  margin: 0;
  text-align: right;
  border-bottom: 1px dotted var(--bm-ink);
}

.arc-biomorphs .bm-tip {
  margin: 8px 14px 14px;
  padding: 10px 12px;
  border: 1px solid var(--bm-ink);
  background-image: var(--bm-dither-light);
  font-size: 12px;
}

/* Read Me document ---------------------------------------------------------- */

.arc-biomorphs .bm-window--doc {
  max-width: 800px;
  margin: 48px auto 0;
}

.arc-biomorphs .bm-doc {
  padding: 28px 44px 36px;
  font-family: var(--bm-read);
  font-size: 18px;
  line-height: 1.65;
}

.arc-biomorphs .bm-doc p {
  margin: 0 0 1em;
}

.arc-biomorphs .bm-doc-lede {
  font-size: 21px;
  line-height: 1.55;
}

.arc-biomorphs .bm-doc h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.8em 0 .6em;
  font-family: var(--bm-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.arc-biomorphs .bm-doc h3::after {
  content: "";
  flex: 1;
  height: 7px;
  background-image: var(--bm-stripes);
}

.arc-biomorphs .bm-doc ul {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.arc-biomorphs .bm-doc li {
  position: relative;
  padding-left: 24px;
  margin: .25em 0;
}

.arc-biomorphs .bm-doc li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .6em;
  width: 8px;
  height: 8px;
  background: var(--bm-ink);
}

.arc-biomorphs .bm-doc a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.arc-biomorphs .bm-doc a:hover {
  background: var(--bm-ink);
  color: var(--bm-paper);
  text-decoration: none;
}

.arc-biomorphs .bm-doc-origin {
  margin: 2em 0 0 !important;
  padding-top: 14px;
  border-top: 1px solid var(--bm-ink);
  font-family: var(--bm-ui);
  font-size: 13px;
  font-style: italic;
}

/* Footer ------------------------------------------------------------------- */

.arc-biomorphs .bm-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  max-width: 800px;
  margin: 36px auto 0;
  padding: 0 4px;
  font-size: 12px;
}

.arc-biomorphs .bm-footer > * {
  background: var(--bm-paper);
  padding: 2px 8px;
}

.arc-biomorphs .bm-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--bm-ink);
  box-shadow: 2px 2px 0 var(--bm-ink);
  font-weight: 700;
  text-decoration: none;
}

.arc-biomorphs .bm-footer a:hover {
  background: var(--bm-ink);
  color: var(--bm-paper);
}

/* Responsive ---------------------------------------------------------------- */

@media (max-width: 980px) {
  .arc-biomorphs .bm-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "kicker" "title" "lede";
  }

  .arc-biomorphs .bm-lede {
    justify-self: start;
    max-width: 620px;
  }

  .arc-biomorphs .bm-app {
    grid-template-columns: minmax(0, 1fr);
  }

  .arc-biomorphs .bm-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 680px) {
  .arc-biomorphs .bm-menubar {
    padding: 0 4px;
    font-size: 13px;
  }

  .arc-biomorphs .bm-menubar > * {
    padding: 0 8px;
  }

  .arc-biomorphs .bm-menubar-item {
    display: none !important;
  }

  .arc-biomorphs .bm-desktop {
    padding: 24px 16px 32px;
  }

  .arc-biomorphs .bm-hero {
    margin-bottom: 24px;
  }

  .arc-biomorphs .bm-kicker {
    font-size: 11px;
  }

  .arc-biomorphs .bm-title {
    -webkit-text-stroke-width: 2px;
    text-shadow: 4px 4px 0 var(--bm-ink);
  }

  .arc-biomorphs .bm-lede {
    font-size: 16px;
  }

  .arc-biomorphs .bm-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .arc-biomorphs .bm-app {
    gap: 24px;
  }

  .arc-biomorphs .bm-window-body {
    padding: 8px;
  }

  .arc-biomorphs .bm-grid {
    gap: 6px;
  }

  .arc-biomorphs .bm-pane-word {
    display: none;
  }

  .arc-biomorphs .bm-pane-bar {
    height: 16px;
    font-size: 10px;
  }

  .arc-biomorphs .bm-genes-btn {
    right: 2px;
    bottom: 2px;
  }

  .arc-biomorphs .bm-genes {
    top: calc(66.667% + 2px);
    width: calc(100% - 8px);
  }

  .arc-biomorphs .bm-window--doc {
    margin-top: 36px;
  }

  .arc-biomorphs .bm-doc {
    padding: 20px 20px 24px;
    font-size: 17px;
  }

  .arc-biomorphs .bm-doc-lede {
    font-size: 19px;
  }
}
