/* One page, no scripts, system fonts only. Colours follow the system's light or dark setting. */
:root {
  --bg: #ffffff;
  --text: #1b1e24;
  --muted: #4a4f59;
  --line: #dddad0;
  --panel: #f6f4ee;
  --link: #0b57b0;
  --note: #f7cd3e;
  --built-bg: #dcefe0;
  --built-text: #1d5b2b;
  --progress-bg: #fbeec2;
  --progress-text: #6b4c00;
  --design-bg: #ebe4fb;
  --design-text: #4a2585;
  --planned-bg: #e8e9ee;
  --planned-text: #3d4250;
  --gate-bg: #fde2e1;
  --gate-text: #8a1c17;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171c;
    --text: #e9e7e1;
    --muted: #b3b6bf;
    --line: #343843;
    --panel: #1e2128;
    --link: #8ab8ff;
    --built-bg: #1f3a26;
    --built-text: #a8e2b5;
    --progress-bg: #3d3214;
    --progress-text: #f7d978;
    --design-bg: #2f2447;
    --design-text: #d7c4ff;
    --planned-bg: #2b2f39;
    --planned-text: #c9ccd6;
    --gate-bg: #4a1f1e;
    --gate-text: #ffb4ae;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.top,
main,
footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 24px;
}

.mark {
  width: auto;
  height: 40px;
}

.org {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

h1 {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  line-height: 1.1;
  margin: 1.2rem 0 0.8rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 2.6rem 0 0.8rem;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.45;
  margin-top: 0;
}

.note {
  border-left: 4px solid var(--note);
  background: var(--panel);
  padding: 0.7rem 1rem;
  border-radius: 0 6px 6px 0;
}

/* The diagram may be wider than the text column on large screens. */
.diagram {
  margin: 1rem 0 1.2rem;
}

@media (min-width: 64rem) {
  .diagram {
    width: min(90rem, calc(100vw - 32px));
    margin-left: calc(50% - min(45rem, calc(50vw - 16px)));
  }
}

.diagram-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff; /* the drawing has a white background in both themes */
  padding: 8px;
}

.diagram img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

@media (min-width: 64rem) {
  figcaption {
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
  }
}

.parts {
  padding-left: 1.2rem;
}

.parts li,
.lanes li {
  margin: 0.35rem 0;
}

.lanes {
  padding-left: 1.6rem;
}

.gate {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0 0.5em;
  border-radius: 999px;
  background: var(--gate-bg);
  color: var(--gate-text);
  margin-right: 0.2em;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.97rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.6rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

thead th {
  color: var(--muted);
  font-weight: 600;
}

tbody th {
  font-weight: 600;
}

.status {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.05em 0.6em;
  border-radius: 999px;
}

.status.built {
  background: var(--built-bg);
  color: var(--built-text);
}

.status.progress {
  background: var(--progress-bg);
  color: var(--progress-text);
}

.status.design {
  background: var(--design-bg);
  color: var(--design-text);
}

.status.planned {
  background: var(--planned-bg);
  color: var(--planned-text);
}

footer {
  margin-top: 3rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin: 0;
}

/* Phones: let the status table stack so it never scrolls sideways. */
@media (max-width: 36rem) {
  body {
    font-size: 16px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  tbody tr {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
  }

  tbody th,
  tbody td {
    border: 0;
    padding: 0.1rem 0;
  }
}
