/* Equitable by position. The PedSimCity house style (one typeface, a black bar, a large title,
   sections with a short label on the left), set throughout on the night plate of its map sections. */

:root {
  --night: #07090f;          /* the page */
  --plate: #0d1017;          /* raised: the city, cards on the page */
  --bar: #000;
  --ink: #f4f3ee;
  --ink-2: #c4c2ba;
  --ink-3: #8d8b84;
  --rule: #1d2130;
  --rule-2: #2a2e3b;
  --sodium: #e0610e;
  --tram: #ffcf7a;
  --bus: #a9c4e8;
  --least: #2fb7a5;          /* the least deprived third: teal, lighter and greener than the blue of the water */
  --most: #f0604f;           /* the most deprived third */
  --paper: #f4f3ee;          /* the card on the map */
  --paper-ink: #111110;
  --paper-ink-3: #75736b;
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wide: 76rem;
  --text: 40rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); }
.site { background: var(--night); color: var(--ink); font-family: var(--sans);
        font-size: 1.06rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.site a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.site a:hover { color: var(--sodium); }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 2rem; }
@media (max-width: 40rem) { .wrap { padding: 0 1rem; } .site { font-size: 1rem; } }
.site :focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; }
[id] { scroll-margin-top: 1rem; }

/* --- header: a black bar --- */
.topbar { background: var(--bar); color: var(--ink); border-bottom: 1px solid var(--rule); }
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { text-decoration: none !important; white-space: nowrap; font-size: 1.02rem;
         display: flex; align-items: baseline; gap: .8rem; }
.brand b { font-weight: 700; letter-spacing: -.01em; }
.brand span { color: var(--ink-3); padding-left: .8rem; border-left: 1px solid #fff; line-height: 1.1; }
.brand:hover { color: var(--ink) !important; }
@media (max-width: 30rem) { .brand { flex-direction: column; gap: 0; }
                            .brand span { border-left: 0; padding-left: 0; font-size: .85rem; } }
.topnav { display: flex; margin-left: auto; }
.topnav a { text-decoration: none; font-size: .98rem; padding: 0 .9rem; line-height: 1.1;
            border-left: 1px solid #fff; color: var(--ink) !important; }
.topnav a:first-child { border-left: 0; }
.topnav a:hover { color: var(--ink-3) !important; }
.topnav a[aria-current="page"] { color: var(--ink-3) !important; }
.lang { display: inline-flex; gap: .1rem; font-size: .9rem; }
.lang button { font: inherit; border: 0; background: none; padding: .2rem .3rem; cursor: pointer;
               color: var(--ink-3); }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline;
                                    text-underline-offset: .25em; }
@media (max-width: 46rem) {
  .topbar .wrap { flex-wrap: wrap; gap: .2rem 1rem; padding-top: .8rem; padding-bottom: .7rem; }
  .lang { margin-left: auto; }
  .topnav { order: 3; width: 100%; margin: 0 0 0 -.9rem; }
  .topnav a:first-child { padding-left: .9rem; }
  .topnav a { font-size: .92rem; }
}

/* --- opening: a large title, then picture and text side by side --- */
.opening { padding: 5.5rem 0 4.5rem; }
.opening h1 { font-weight: 700; font-size: clamp(3rem, 8.4vw, 6.6rem); line-height: .95;
              letter-spacing: -.035em; margin: 0 0 1.6rem; max-width: 12ch; }
.opening .sub { font-weight: 600; font-size: clamp(1.3rem, 2.3vw, 1.75rem); line-height: 1.25;
                letter-spacing: -.01em; margin: 0 0 3.5rem; max-width: 34ch; }
.opening .pair { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3rem 4.5rem;
                 align-items: start; }
.opening figure { margin: 0; }
.opening figure img { display: block; width: 100%; height: auto; background: var(--night); }
.opening .text p { margin: 0 0 1.1rem; max-width: var(--text); color: var(--ink-2); }
.opening .text p:first-child { color: var(--ink); }
figcaption, .credit { font-size: .8rem; color: var(--ink-3); margin-top: .55rem; line-height: 1.4; }
.go { display: inline-block; margin-top: .9rem; padding: .7rem 1.15rem; background: var(--ink); border: 0;
      color: var(--night) !important; text-decoration: none !important; font: inherit; font-weight: 600; cursor: pointer; }
.go:hover { background: var(--sodium); color: #fff !important; }
.go.quiet { background: none; color: var(--ink) !important; box-shadow: inset 0 0 0 1px var(--ink-3); margin-left: .5rem; }
.go.quiet:hover { box-shadow: inset 0 0 0 1px var(--sodium); color: var(--sodium) !important; background: none; }
@media (max-width: 52rem) {
  .opening { padding: 3rem 0 3rem; }
  .opening .sub { margin-bottom: 2.2rem; }
  .opening .pair { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- a section: a short label on the left, the matter on the right --- */
.part { padding: 3.5rem 0; border-top: 1px solid var(--rule-2); }
.part > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 1.5rem 3rem; }
.part .label { font-size: 1rem; margin: .45rem 0 0; font-weight: 400; color: var(--ink-2); }
.part .say { font-size: clamp(1.3rem, 2.25vw, 1.7rem); line-height: 1.32; letter-spacing: -.012em;
             margin: 0 0 1.6rem; max-width: 34em; }
.part .say:last-child { margin-bottom: 0; }
.part p { margin: 0 0 1rem; max-width: var(--text); color: var(--ink-2); }
.part p.say { color: var(--ink); }
.part strong { font-weight: 650; color: var(--ink); }
.source { font-size: .8rem !important; color: var(--ink-3) !important; line-height: 1.45; }
.part figure { margin: 2.2rem 0 0; }
.part figure img { display: block; width: 100%; height: auto; }
@media (max-width: 52rem) {
  .part { padding: 2.5rem 0; }
  .part > .wrap { grid-template-columns: 1fr; gap: .8rem; }
  .part .label { margin: 0; font-weight: 600; color: var(--ink); }
}

/* the two ends of the gradient, side by side: a measure, then the most and the least deprived third */
.pairs { display: grid; gap: 0; max-width: 46rem; margin: 2rem 0 1.2rem; }
.pairs .row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 7.5rem; gap: .2rem 1rem; align-items: baseline;
              padding: .7rem 0; border-top: 1px solid var(--rule-2); }
.pairs .row:last-child { border-bottom: 1px solid var(--rule-2); }
.pairs .head { border-top: 0; padding-bottom: .35rem; font-size: .78rem; color: var(--ink-3); }
.pairs .head span { padding-top: .35rem; }
.pairs .head .m { border-top: 6px solid var(--most); }
.pairs .head .l { border-top: 6px solid var(--least); }
.pairs .what { color: var(--ink-2); font-size: .95rem; }
.pairs b { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pairs b small { font-size: .8rem; font-weight: 400; color: var(--ink-3); margin-left: .15rem; letter-spacing: 0; }
@media (max-width: 34rem) { .pairs .row { grid-template-columns: minmax(0, 1fr) 5.2rem 5.2rem; }
                            .pairs b { font-size: 1.25rem; } }

/* the model, as a list of terms */
dl.terms { margin: 1.4rem 0 0; max-width: 46rem; }
dl.terms + p { margin-top: 1.4rem; }
dl.terms div { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: .2rem 1.5rem;
               padding: .8rem 0; border-top: 1px solid var(--rule-2); }
dl.terms div:last-child { border-bottom: 1px solid var(--rule-2); }
dl.terms dt { font-weight: 600; }
dl.terms dd { margin: 0; color: var(--ink-2); }
dl.terms dd .source { display: block; margin-top: .3rem; }
@media (max-width: 40rem) { dl.terms div { grid-template-columns: 1fr; } }

/* buttons in a row: tabs on the map, switches on the figures */
.st-tabs, .switch { display: flex; flex-wrap: wrap; gap: 0 1.7rem; border-bottom: 1px solid var(--rule-2); }
.st-tabs button, .switch button { font: inherit; font-size: 1.02rem; background: none; border: 0; cursor: pointer;
                  color: var(--ink-3); padding: .6rem 0 .55rem; margin-bottom: -1px;
                  border-bottom: 2px solid transparent; }
.st-tabs button:hover, .switch button:hover { color: var(--ink); }
.st-tabs button[aria-selected="true"], .switch button[aria-pressed="true"] { color: var(--ink); font-weight: 600;
                                        border-bottom-color: var(--ink); }
.switch { margin: 1.8rem 0 0; max-width: 46rem; gap: 0 1.4rem; }
.switch button { font-size: .95rem; }
.sub-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 0 0; }
.sub-tabs[hidden] { display: none; }
.sub-tabs button { font: inherit; font-size: .86rem; background: none; cursor: pointer; color: var(--ink-2);
                   border: 1px solid var(--rule-2); padding: .3rem .7rem; }
.sub-tabs button:hover { border-color: var(--ink-3); color: var(--ink); }
.sub-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--night); border-color: var(--ink); }
.sub-tabs .lab { font-size: .82rem; color: var(--ink-3); align-self: center; margin-right: .3rem; }
.sub-tabs select { font: inherit; font-size: .86rem; background: var(--plate); color: var(--ink); border: 1px solid var(--rule-2);
                   padding: .28rem .5rem; max-width: 100%; }
.sub-tabs button.tram[aria-pressed="true"] { background: var(--tram); border-color: var(--tram); }
.sub-tabs button.tram { min-width: 2.3rem; }

/* --- stop by stop: the map, full-bleed on the night plate --- */
.part.map { padding-bottom: 3rem; }
.st-map { margin-top: 1.6rem; }
.part p.st-about { margin: 1rem 0 1.2rem; color: var(--ink-2); min-height: 3.1em; max-width: 46rem; }
.st-plate { position: relative; background: var(--night); overflow: hidden; border-top: 1px solid var(--rule);
            border-bottom: 1px solid var(--rule); }
.st-plate canvas { display: block; width: 100%; height: min(86vh, 920px); cursor: crosshair; touch-action: pan-y; }
.st-plate canvas.zoomed { touch-action: none; cursor: grab; }
.st-plate canvas.dragging { cursor: grabbing; }
.st-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: .9rem; }
.st-loading[hidden] { display: none; }
.st-zoom { position: absolute; right: max(1rem, calc(50% - 38rem + 2rem)); top: 1rem; display: flex;
           flex-direction: column; gap: 1px; }
.st-zoom button { font: inherit; font-size: 1rem; min-width: 2.3rem; height: 2.3rem; padding: 0 .55rem;
                  border: 0; cursor: pointer; background: rgba(244, 243, 238, .94); color: var(--paper-ink); }
.st-zoom button:hover { background: var(--paper); color: var(--sodium); }
.st-zoom .st-reset { font-size: .8rem; }
.st-hint { position: absolute; right: max(1rem, calc(50% - 38rem + 2rem)); bottom: .8rem; font-size: .75rem; color: var(--ink-3);
           pointer-events: none; }
.st-card { position: absolute; z-index: 2; left: max(1rem, calc(50% - 38rem + 2rem)); top: 1rem;
           width: 19.5rem; background: var(--paper); color: var(--paper-ink); padding: .85rem 1rem .8rem;
           font-size: .86rem; line-height: 1.35; pointer-events: none; }
.st-card .st-name { font-weight: 650; font-size: 1.12rem; letter-spacing: -.012em; }
.st-card .st-hint2 { margin: .3rem 0 0; color: var(--paper-ink-3); font-size: .86rem; }
.st-card .st-len { color: var(--paper-ink-3); font-size: .78rem; margin-bottom: .5rem; }
.st-card table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.st-card th, .st-card td { padding: .3rem 0; border-top: 1px solid #cfccc2; text-align: left;
                           font-weight: 400; color: var(--paper-ink-3); vertical-align: baseline; }
.st-card td { text-align: right; padding-left: .6rem; }
.st-card tr.on th, .st-card tr.on td { color: var(--paper-ink); font-weight: 600; }
.st-card .chip { display: inline-block; width: .65rem; height: .65rem; margin-right: .35rem; vertical-align: -.02rem; }
.readout { display: grid; grid-template-columns: repeat(2, minmax(0, 15rem)); gap: .6rem 2rem; margin: 1.3rem 0 0; }
.readout > div { border-top: 6px solid var(--c, var(--ink-3)); padding-top: .4rem; font-size: .8rem; color: var(--ink-3); line-height: 1.3; }
.readout b { display: block; font-size: 1.9rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em;
             font-variant-numeric: tabular-nums; }
.readout-note { font-size: .8rem; color: var(--ink-3); margin: .7rem 0 0; max-width: 46rem; }
.st-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; margin: 1rem 0 .9rem;
             font-size: .82rem; color: var(--ink-3); min-height: 2.4rem; }
.st-legend .ramp { display: flex; flex-wrap: wrap; row-gap: .4rem; }
.st-legend .ramp > span { min-width: 3.4rem; padding-right: .5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-legend .ramp i { display: block; height: .7rem; margin: 0 -.5rem .25rem 0; }
.st-legend .grad { display: inline-block; width: 12rem; height: .7rem; vertical-align: -.05rem; margin: 0 .5rem; }
.st-legend .sw i { display: inline-block; width: 1.1rem; height: .25rem; margin-right: .4rem; vertical-align: .2rem; }
.st-legend .sw i.dot { width: .75rem; height: .75rem; border-radius: 50%; vertical-align: -.05rem; }
@media (max-width: 40rem) {
  .st-tabs { gap: 0 1.1rem; }
  .st-tabs button { font-size: .92rem; }
  .st-plate canvas { height: 68vh; }
  .st-card { position: static; width: auto; margin: 0; min-height: 4.5rem; }
  .st-hint { display: none; }
  .st-legend .ramp > span { min-width: 2.7rem; }
  .readout b { font-size: 1.5rem; }
}

/* --- the same network, deprivation moved: two bars per measure --- */
.bars { max-width: 46rem; margin: 1.4rem 0 1.2rem; }
.bars .row { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: .15rem 1.2rem; align-items: center;
             padding: .65rem 0; border-top: 1px solid var(--rule-2); }
.bars .row:last-child { border-bottom: 1px solid var(--rule-2); }
.bars .what { color: var(--ink-2); font-size: .95rem; grid-row: span 2; }
.bars .bar { position: relative; height: 1.15rem; }
.bars .bar i { position: absolute; left: 0; top: .15rem; bottom: .15rem; width: 0; background: var(--c);
               transition: width .7s cubic-bezier(.3, .7, .2, 1); }
.bars .bar span { position: absolute; top: -.05rem; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--ink);
                  transition: left .7s cubic-bezier(.3, .7, .2, 1); padding-left: .45rem; white-space: nowrap; }
.bars .key { display: flex; gap: 1.2rem; font-size: .8rem; color: var(--ink-3); margin: .2rem 0 0; }
.bars .key i { display: inline-block; width: .8rem; height: .8rem; margin-right: .35rem; vertical-align: -.1rem; }
@media (prefers-reduced-motion: reduce) { .bars .bar i, .bars .bar span { transition: none; } }
@media (max-width: 40rem) { .bars .row { grid-template-columns: 1fr; } .bars .what { grid-row: auto; } }

/* --- the 22 gaps, step by step --- */
.gaps { max-width: 52rem; margin: 1.2rem 0 1rem; }
.gaps .row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1rem; align-items: center;
             padding: .28rem 0; border-top: 1px solid var(--rule); }
.gaps .what { font-size: .9rem; color: var(--ink-2); line-height: 1.25; }
.gaps .track { position: relative; height: 1.3rem; }
.gaps .band { position: absolute; top: 0; bottom: 0; background: rgba(244, 243, 238, .06); }
.gaps .zero { position: absolute; top: -.3rem; bottom: -.3rem; width: 1px; background: var(--ink-3); }
.gaps .ci { position: absolute; top: calc(50% - 1px); height: 2px; background: var(--ink-3);
            transition: left .6s cubic-bezier(.3, .7, .2, 1), width .6s cubic-bezier(.3, .7, .2, 1); }
.gaps .dot { position: absolute; top: 50%; width: .75rem; height: .75rem; margin: -.375rem 0 0 -.375rem; border-radius: 50%;
             background: var(--night); box-shadow: inset 0 0 0 2px var(--ink-2);
             transition: left .6s cubic-bezier(.3, .7, .2, 1), background .3s; }
.gaps .dot.sure { background: var(--sodium); box-shadow: none; }
.gaps .axis { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1rem; margin-top: .4rem; }
.gaps .axis div { position: relative; height: 1.2rem; font-size: .72rem; color: var(--ink-3); }
.gaps .dir { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; margin: 0 0 0 16rem;
             font-size: .72rem; color: var(--ink-3); }
.gaps .axis div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.gaps .key { display: flex; flex-wrap: wrap; gap: .3rem 1.3rem; font-size: .8rem; color: var(--ink-3); margin-top: .5rem; }
.gaps .key i { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: -.1rem; margin-right: .35rem; }
.gaps .key i.band-key { border-radius: 0; width: 1.4rem; background: rgba(244, 243, 238, .12); }
@media (prefers-reduced-motion: reduce) { .gaps .ci, .gaps .dot { transition: none; } }
@media (max-width: 40rem) { .gaps .row, .gaps .axis { grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: .6rem; }
                            .gaps .what { font-size: .8rem; } .gaps .dir { margin-left: 9.1rem; } }

/* --- moving residents out: a slider and three numbers --- */
.move { max-width: 46rem; margin: 1.8rem 0 1.2rem; padding: 1.2rem 0 0; border-top: 1px solid var(--rule-2); }
.move label { display: block; font-size: .95rem; color: var(--ink-2); }
.move .slider { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem; gap: 1rem; align-items: center; margin: .6rem 0 1rem; }
.move input[type="range"] { width: 100%; accent-color: var(--sodium); }
.move output { font-size: 1.5rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.move .dest { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.4rem; }
.move .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.move .nums div { border-top: 6px solid var(--c, var(--ink-3)); padding-top: .4rem; font-size: .8rem; color: var(--ink-3); line-height: 1.3; }
.move .nums b { display: block; font-size: 1.9rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.move .nums s { text-decoration: none; color: var(--ink-3); font-size: .85rem; display: block; margin-top: .15rem; }
@media (max-width: 34rem) { .move .nums { grid-template-columns: 1fr; } }

/* team */
.team { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 2rem 2.5rem;
        grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); max-width: 46rem; }
.team li { border-top: 1px solid var(--ink); padding-top: .9rem; }
.team h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .25rem; }
.team p { margin: 0 0 .5rem; color: var(--ink-2); font-size: .98rem; line-height: 1.45; }
.cite { border-left: 2px solid var(--sodium); padding: .2rem 0 .2rem 1rem; margin: 0 0 1.2rem; max-width: var(--text); }
.cite p { margin: 0 0 .3rem !important; }

/* footer: black, as the header */
.sitefoot { background: var(--bar); color: var(--ink-3); padding: 2rem 0 2.6rem; font-size: .88rem; border-top: 1px solid var(--rule); }
.sitefoot .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; align-items: baseline; }
.sitefoot .grow { flex: 1; color: var(--ink); }
.sitefoot a { color: var(--ink); }
