/* Every Gene. Palette taken from the stains on a microbiology bench: methylene blue, crystal violet,
   safranin, iodine, malachite green, on agar-grey paper. */
:root {
  --paper: #f1f4f1;
  --sheet: #fbfcfb;
  --ink: #16292b;
  --ink-2: #4d6163;
  --rule: #cdd6d3;
  --g-dna: #3454a4;
  --g-make: #74379a;
  --g-care: #bb3f72;
  --g-metab: #a8690f;
  --g-transport: #17806f;
  --g-other: #66777a;
  --g-unknown: #9aa5a3;
  --lethal: #a3262f;
  --slow: #a8690f;
  --fine: #17806f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a1c;
    --sheet: #162426;
    --ink: #e3ebe8;
    --ink-2: #9db0ae;
    --rule: #2c4043;
    --g-dna: #86a2ec;
    --g-make: #c08ee0;
    --g-care: #ee8db4;
    --g-metab: #e0aa55;
    --g-transport: #5fcab8;
    --g-other: #9aacae;
    --g-unknown: #6d7f81;
    --lethal: #f0838a;
    --slow: #e0aa55;
    --fine: #5fcab8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--g-dna); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2rem, 7vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 0.75rem; max-width: 68ch; }
.gene { font-style: italic; font-family: var(--serif); }

.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 16px;
  border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--paper); z-index: 5; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.125rem; text-decoration: none; }
.top nav { display: flex; gap: 4px; }
.top nav a { text-decoration: none; padding: 8px 10px; border-radius: 6px; color: var(--ink-2); }
.top nav a[aria-current="page"] { color: var(--ink); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule); }
main { padding: 20px 16px 64px; max-width: 1080px; margin: 0 auto; }
main:focus { outline: none; }
.loading { color: var(--ink-2); }
.lede { font-size: 1.125rem; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer; font-weight: 600; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule); font-weight: 500; }
.btn.danger { background: var(--lethal); border-color: var(--lethal); color: var(--paper); }
.btn:disabled { opacity: 0.45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* home */
.hero { display: grid; gap: 24px; align-items: center; margin-bottom: 32px; }
@media (min-width: 820px) { .hero { grid-template-columns: 1fr minmax(320px, 440px); } }
.ringwrap { position: relative; max-width: 440px; width: 100%; margin: 0 auto; }
.ring { display: block; width: 100%; height: auto; }
.ring .arc { cursor: pointer; }
.ring .arc.shed { opacity: 0.12; }
.ring .arc.dim { opacity: 0.12; }
.ring .arc:hover, .ring .arc.hot { stroke: var(--ink); stroke-width: 1.5; }
.ring text { fill: var(--ink); font-family: var(--serif); }
.ring .sub { fill: var(--ink-2); font-family: var(--sans); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 8px 0 0; list-style: none; font-size: 0.875rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.sw.unknown, .fill-unknown { background: repeating-linear-gradient(45deg, var(--g-unknown) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--g-unknown); }

.eras { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 8px; counter-reset: era; }
@media (min-width: 720px) { .eras { grid-template-columns: repeat(7, 1fr); } }
.eras li { counter-increment: era; border-top: 3px solid var(--rule); padding: 8px 2px 0; font-size: 0.875rem; color: var(--ink-2); }
.eras li::before { content: counter(era) ". "; font-family: var(--serif); }
.eras li b { display: block; color: var(--ink); font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.eras li.open { border-top-color: var(--ink); }
.eras li.open a { color: var(--ink); }

section.block { margin: 0 0 36px; }
section.block > h2 { margin-bottom: 10px; }

/* coverage figure */
.cov { display: grid; grid-template-columns: max-content 1fr max-content; gap: 6px 10px; align-items: center; font-size: 0.875rem; max-width: 640px; }
.cov .bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--rule); }
.cov .bar i { display: block; height: 100%; }
.cov .bar .d { background: var(--ink); }
.cov .bar .k { background: repeating-linear-gradient(45deg, var(--ink-2) 0 2px, transparent 2px 5px); }
.cov .bar .c { background: transparent; }
figcaption, .cap { font-size: 0.8125rem; color: var(--ink-2); margin-top: 8px; max-width: 68ch; }

/* evidence tags: shape as well as colour */
button.tag { cursor: pointer; font-family: inherit; color: inherit; }
.tag { display: inline-block; font-size: 0.75rem; line-height: 1; padding: 4px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px; border: 1.5px solid var(--ink); }
.tag.measured { background: var(--ink); color: var(--paper); }
.tag.inferred { background: transparent; }
.tag.simulated { border-style: dashed; border-color: var(--slow); color: var(--slow); }
.tag.hypothesis { border-style: dotted; border-color: var(--g-care); color: var(--g-care); }
.tag.gap { border-color: var(--rule); color: var(--ink-2); background: repeating-linear-gradient(45deg, var(--rule) 0 2px, transparent 2px 6px); }

/* glossary terms */
.term:not(.tag) { border: 0; background: none; padding: 0; cursor: pointer; border-bottom: 1.5px dotted var(--g-make); }
.term:not(.tag)[aria-expanded="true"] { border-bottom-style: solid; }
.termcard { display: block; margin: 8px 0 12px; padding: 10px 12px; border-left: 3px solid var(--g-make); background: var(--sheet); border-radius: 0 6px 6px 0; font: 0.9375rem/1.45 var(--sans); font-style: normal; color: var(--ink); max-width: 62ch; }
.termcard b { font-family: var(--serif); }
.termcard dl { margin: 6px 0 0; display: grid; gap: 4px; }
.termcard dt { font-size: 0.75rem; color: var(--ink-2); }
.termcard dd { margin: 0 0 4px; }

/* gene list + filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.filters input[type="search"] { flex: 1 1 220px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); color: var(--ink); font: inherit; }
.filters select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); color: var(--ink); font: inherit; max-width: 100%; }
.explore { display: grid; gap: 20px; }
@media (min-width: 900px) { .explore { grid-template-columns: 360px 1fr; align-items: start; } .explore .ringwrap { position: sticky; top: 72px; } }
.glist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.glist li a { display: grid; grid-template-columns: 10px minmax(64px, 88px) 1fr; gap: 10px; align-items: baseline; padding: 10px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.glist li a:hover { background: var(--sheet); }
.glist .dot { width: 10px; height: 10px; border-radius: 2px; align-self: center; }
.glist .p { color: var(--ink-2); font-size: 0.9375rem; overflow-wrap: anywhere; }

/* play */
.status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); margin: 14px 0 18px; }
.status div { padding: 10px 12px; border-left: 1px solid var(--rule); }
.status div:first-child { border-left: 0; }
.status b { display: block; font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; }
.status span { font-size: 0.8125rem; color: var(--ink-2); }
.hand { display: grid; gap: 12px; margin: 14px 0; }
@media (min-width: 640px) { .hand { grid-template-columns: repeat(2, 1fr); } }
.tile { border: 1px solid var(--rule); border-left-width: 6px; border-radius: 8px; background: var(--sheet); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tile h3 { font-size: 1.375rem; }
.tile .prod { font-size: 0.9375rem; color: var(--ink-2); overflow-wrap: anywhere; }
.tile .kid { margin: 2px 0 6px; }
.tile .row { margin-top: auto; }
.tile.picked { box-shadow: 0 0 0 2px var(--ink); }
.verdict { border-radius: 10px; padding: 16px; margin: 14px 0; background: var(--sheet); border: 1px solid var(--rule); border-top: 6px solid var(--ink-2); }
.verdict.Essential { border-top-color: var(--lethal); }
.verdict.Quasiessential { border-top-color: var(--slow); }
.verdict.Nonessential { border-top-color: var(--fine); }
.verdict h2 { margin-bottom: 6px; }
.twocol { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 640px) { .twocol { grid-template-columns: 1fr 1fr; } }
.twocol > div { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
.note { border-left: 3px solid var(--slow); padding: 6px 12px; margin: 14px 0; font-size: 0.9375rem; color: var(--ink-2); max-width: 68ch; }
.logtable { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.logtable th, .logtable td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.logtable th { font-weight: 600; color: var(--ink-2); font-size: 0.8125rem; }
.scroll { overflow-x: auto; }

/* card panel */
.panel { position: fixed; inset: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 70%, transparent); display: flex; justify-content: flex-end; }
.panel[hidden] { display: none; }
.card { width: min(680px, 100%); height: 100%; overflow-y: auto; background: var(--sheet); border-left: 1px solid var(--rule); padding: 16px 16px 56px; }
.card .close { float: right; margin: 0 0 8px 8px; }
.card .sym { font-size: clamp(2rem, 8vw, 2.75rem); font-style: italic; }
.card .prod { color: var(--ink-2); margin-bottom: 14px; overflow-wrap: anywhere; }
.card .kid { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; margin-bottom: 10px; }
.card .stripe { height: 6px; border-radius: 3px; margin: 0 0 14px; }
details.facet { border-top: 1px solid var(--rule); }
details.facet:last-of-type { border-bottom: 1px solid var(--rule); }
details.facet > summary { list-style: none; cursor: pointer; padding: 13px 2px; display: flex; gap: 10px; align-items: center; min-height: 48px; }
details.facet > summary::-webkit-details-marker { display: none; }
details.facet > summary::before { content: "+"; font-family: var(--serif); font-size: 1.25rem; width: 16px; flex: none; text-align: center; }
details.facet[open] > summary::before { content: "\2212"; }
details.facet > summary .q { flex: 1; font-weight: 600; }
details.facet .inner { padding: 0 2px 14px 26px; }
.claim { margin: 0 0 14px; }
.claim p { margin-bottom: 4px; overflow-wrap: anywhere; }
.claim .meta { font-size: 0.8125rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.claim .meta button { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink-2); }
.claim .how { font-size: 0.875rem; color: var(--ink-2); margin: 6px 0 0; padding: 8px 10px; background: var(--paper); border-radius: 6px; }
.gapline { font-size: 0.9375rem; color: var(--ink-2); margin: 0 0 10px; display: flex; gap: 8px; align-items: flex-start; }
.gapline .tag { flex: none; margin-top: 2px; }
.hidden-facet { padding: 10px 12px; border: 1px dashed var(--rule); border-radius: 8px; color: var(--ink-2); }
.bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: 6px 10px; align-items: center; font-size: 0.875rem; margin: 8px 0; max-width: 460px; }
.bars .b { height: 12px; background: var(--ink); border-radius: 2px; min-width: 1px; }
.bars .b.zero { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); width: 100%; }
.partners { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.partners li { display: grid; grid-template-columns: minmax(70px, 96px) 1fr max-content; gap: 10px; align-items: center; font-size: 0.9375rem; }
.partners .b { height: 8px; background: var(--g-dna); border-radius: 2px; }
.partners .ch { grid-column: 1 / -1; font-size: 0.75rem; color: var(--ink-2); margin-top: -4px; }
.viewer { position: relative; width: 100%; height: 340px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; margin: 8px 0; background: var(--paper); }
.srcbox { margin: 6px 0 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; font-size: 0.875rem; background: var(--paper); }
.srcbox b { font-family: var(--serif); }
.srclist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.srclist li { border-top: 1px solid var(--rule); padding-top: 12px; }
.hash { font-size: 0.75rem; color: var(--ink-2); overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .ring .arc { transition: opacity 0.4s; }
}

.claim .meta .termcard { flex-basis: 100%; }

/* header fits five links on a phone */
.top { flex-wrap: wrap; row-gap: 2px; }
.top nav { flex-wrap: wrap; }
@media (max-width: 480px) { .top nav a { padding: 8px 8px; } }

/* story: a real sequence of papers, so the years carry the order */
.timeline { list-style: none; padding: 0; margin: 20px 0 12px; max-width: 70ch; }
.timeline li { display: grid; grid-template-columns: 3.6rem 1fr; gap: 0 12px; padding: 0 0 22px; }
.timeline .yr { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.timeline li > div { padding-left: 14px; border-left: 1px solid var(--rule); min-width: 0; }
.timeline .kidline { margin: 0; font-size: 1.0625rem; }
.timeline blockquote { margin: 8px 0; padding: 0; font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.timeline details > summary, details.word > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.timeline details > summary { font-size: 0.875rem; color: var(--ink-2); }
.timeline details p { margin: 4px 0 6px; }
.steps { padding-left: 1.3rem; max-width: 70ch; display: grid; gap: 8px; }

/* words */
details.word { border-top: 1px solid var(--rule); max-width: 70ch; scroll-margin-top: 110px; }
details.word:last-of-type { border-bottom: 1px solid var(--rule); }
details.word > summary { font-family: var(--serif); font-size: 1.125rem; font-weight: 600; }
details.word dl { margin: 0 0 8px; display: grid; gap: 4px; }
details.word dt { font-size: 0.75rem; color: var(--ink-2); }
details.word dd { margin: 0 0 6px; }
