/* QS palette -----------------------------------------------------------------
   `main` and `comp1` arrive from qs-data.json and are written onto :root by
   /media/qs-palette.js. Every foreground below is derived from its own
   background, so neither colour has to be light or dark for the page to stay
   legible.

   These defaults are only ever seen on a first visit — after that the <head>
   replays the cached palette before first paint. They are deliberately neutral
   greys rather than a plausible-looking palette: whatever `comp1` turns out to
   be, settling onto it from grey reads as the page finishing, where settling
   onto it from some other saturated hue read as a fault.
   See the vault note projects/qs-colours.md. */
:root {
  --qs-page-bg: #efefef;        /* what .tab-content is, for link contrast */
  --qs-main: #f4f3f1;           /* card / chart-panel background */
  --qs-comp1: #6b6b6b;          /* accent: buttons and pills */
  --qs-on-main: #000000;        /* text on --qs-main */
  --qs-on-comp1: #ffffff;       /* text on --qs-comp1 */
  --qs-link: #6b6b6b;           /* accent made legible on --qs-page-bg */
  --qs-link-on-main: #6b6b6b;   /* accent made legible on --qs-main */
  --qs-chart-dim: #808080;      /* third chart line, >=3:1 on --qs-main */
  --qs-accent-on-comp1: #ffffff; /* --qs-main made legible on --qs-comp1 */
  --qs-dim-on-comp1: #c8c8c8;   /* header hairlines, >=3:1 on --qs-comp1 */
  --qs-edge: #e2e1de;           /* where --qs-main meets --qs-page-bg */
}

.padding-top {
  padding-top: 30px;
}
.padding-bottom {
  padding-bottom: 30px;
}

.padding-top-small {
  padding-top: 10px;
}
.padding-bottom-small {
  padding-bottom: 10px;
}

.padding-all {
  padding: 10px;
}

.nav-item .nav-link.active {
  background-color: var(--qs-comp1);
  color: var(--qs-on-comp1);
  text-decoration: none;
}

.btn.btn-primary,
a.btn.btn-primary {
  background-color: var(--qs-comp1);
  border-color: var(--qs-comp1);
  color: var(--qs-on-comp1);
}

a {
  color: var(--qs-link);
}

/* The quote links to Bluesky but should read as text: Bootstrap's a:hover
   would recolour it blue and underline it. */
a.twitter-quote:hover {
  color: var(--qs-link);
  text-decoration: none;
}

body.background {
  background-color: var(--qs-page-bg);
}

/* The masthead keeps the white the page opens on. It is full-bleed and the
   nav's own container sits inside it, so the white spans the window while the
   pills stay aligned with everything below them.

   It is also the sky: /media/qs-sun.js inserts an absolutely positioned SVG as
   its first child, so the masthead has to be the positioning context, and the
   container has to be lifted off it so the title and the pills sit in front of
   the sun rather than behind it. */
.masthead {
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
}

.masthead > .container {
  position: relative;
  z-index: 1;
}
/* CSS columns for true masonry layout */
.card-grid {
  column-count: 3;
  column-gap: 30px;
}

@media (max-width: 992px) {
  .card-grid {
    column-count: 2;
  }
}

@media (max-width: 576px) {
  .card-grid {
    column-count: 1;
  }

  /* Desktop columns fill top-to-bottom (3 per column), so on mobile reorder
     the projects to read like the desktop rows, left to right. */
  #projects .card-grid {
    display: flex;
    flex-direction: column;
  }
  #projects .card-wrapper:nth-child(2) { order: 3; }
  #projects .card-wrapper:nth-child(3) { order: 6; }
  #projects .card-wrapper:nth-child(4) { order: 1; }
  #projects .card-wrapper:nth-child(5) { order: 4; }
  #projects .card-wrapper:nth-child(6) { order: 7; }
  #projects .card-wrapper:nth-child(7) { order: 2; }
  #projects .card-wrapper:nth-child(8) { order: 5; }
  #projects .card-wrapper:nth-child(9) { order: 8; }
}

/* Row-based grid layout for profiles and paid */
.card-grid-row {
  column-count: unset;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  align-items: stretch;
}

#paid .card-wrapper {
  display: flex;
}

#paid .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#paid .card-body {
  flex-grow: 1;
}

@media (max-width: 992px) {
  .card-grid-row {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .card-grid-row {
    grid-template-columns: 1fr;
  }
}

.card-wrapper {
  break-inside: avoid;
  margin-bottom: 30px;
  display: inline-block;
  width: 100%;
}

/* A card is --qs-main on --qs-page-bg, and on a light day those two are
   within 1.05:1 of each other — the fill cannot draw the boundary, so the
   border does. --qs-edge is the card's own hue walked away from the PAGE
   until it reads as a hairline, and on a day the card stands clear of the
   page by itself the var IS the card and this border disappears. See the
   derivation in media/qs-palette.js. */
.card {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: auto;
  background-color: var(--qs-main);
  color: var(--qs-on-main);
  border: 1px solid var(--qs-edge);
}

/* Links sitting on a card are on --qs-main, not on the page background. */
.card a:not(.btn) {
  color: var(--qs-link-on-main);
}

/* Add padding to images in paid section */
#paid .card-img-top {
  padding: 16px;
}
.tab-content {
  background-color: var(--qs-page-bg);
  padding-bottom: 60px;
}
.echeader {
  /*background-color: #efefef;*/
  padding-top: 6px;
  padding-bottom: 6px;
  text-align: justify;

}
.nav-link {
  padding-top: 0.5rem;
  padding-right: 0.4rem;
  padding-bottom: 0.5rem;
  padding-left: 0.4rem;
}
/*li.nav-item {
    text-align: unset;
    width: unset;
    width:;
}*/

.page-foot {
  padding-bottom: 40px;
}

.under-content {
  height: 120px;
  background-color: var(--qs-main);
  border-top: 1px solid var(--qs-edge);
}

/* All three lines are drawn on --qs-main, so all three are derived from it. */
.ct-series-a .ct-line {
  stroke: var(--qs-on-main);
}

.ct-series-b .ct-line {
  stroke: var(--qs-link-on-main);
}

.ct-series-c .ct-line {
  stroke: var(--qs-chart-dim);
}

.float-right {
  float: right;
}


/* Page headers ---------------------------------------------------------------
   A full-width band at the top of each tab, drawn by /media/qs-headers.js.

   Until 2026-09-18 these were the only thing on the site that sat ON
   --qs-comp1, inverting the pair to make a band read as a different kind of
   object. At a full-bleed band's size that was simply too much accent at the
   top of every tab, so the inversion is now smaller than the band: the ground
   is --qs-main like every other surface, and what carries the day's colour is
   the TEXT, in --qs-link-on-main — the accent already walked to AA against
   this exact ground. A band is still a different kind of object because it is
   full-bleed where the cards are inset, and it still costs the palette
   nothing: two hexes, no third colour, and the accent stays a fill on the
   buttons, the pills and the review's tag.

   Each band ships hidden and is opened by the script once it has content, so
   a field that came back null is a band that never appears rather than an
   empty stripe of accent. */
.qs-head[hidden] {
  display: none;
}

.qs-head {
  background-color: var(--qs-main);
  color: var(--qs-link-on-main);
  padding: 16px 0;
  /* Full-bleed, so only the two horizontal boundaries exist to be drawn. */
  border-top: 1px solid var(--qs-edge);
  border-bottom: 1px solid var(--qs-edge);
}

.tab-pane > .container {
  padding-top: 30px;
}

.qs-head-narrow {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.qs-head-eyebrow {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--qs-chart-dim);
  margin-bottom: 7px;
}

/* Links on a band are on --qs-comp1, not on the page background and not on a
   card, so neither --qs-link nor --qs-link-on-main is the right colour here.
   There is no third derivation for it: text on the band is --qs-on-comp1, and
   an underline is what carries the linkness. */
.qs-head a {
  color: var(--qs-link-on-main);
}

/* Both bands are a musing — the latest one on Projects, an older one on Paid —
   so they are one piece of typography, shown with a label above it on Paid and
   without one, unattributed, on Projects. */
.qs-musing,
.qs-lookback-text {
  display: block;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* The Projects one is an anchor to Bluesky, so it has to be told to keep the
   band's own foreground rather than take Bootstrap's link colour. */
a.qs-musing,
a.qs-musing:hover {
  color: var(--qs-link-on-main);
  text-decoration: none;
}

/* The newest review, on Press. */
.qs-osmr-head {
  display: block;
  margin-bottom: 8px;
}

.qs-osmr-title {
  font-weight: 700;
  font-size: 1.05rem;
}

a.qs-osmr-title,
a.qs-osmr-title:hover {
  color: var(--qs-link-on-main);
  text-decoration: underline;
}

/* A filing label: the accent, borrowed onto the band. It inverted when the
   band did — it is the one thing here that still wants to be a coloured
   object rather than coloured text. */
.qs-osmr-tag {
  display: inline-block;
  background-color: var(--qs-comp1);
  color: var(--qs-on-comp1);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 2px;
  margin-left: 10px;
  vertical-align: 2px;
}

.qs-osmr-tag[hidden] {
  display: none;
}

.qs-osmr-text {
  display: block;
  line-height: 1.5;
}

/* The gauges, on Profiles -----------------------------------------------------
   Instrument faces on the band. The plate used to be --qs-main, which worked
   while the band was the accent and stopped working the moment the band went
   quiet: a face the same colour as the thing behind it. Putting the accent on
   the plate instead fixed that and cost too much — four saturated discs is
   more accent than the whole band was.

   So the plate is white and stays white. It is the one thing on the site
   outside the palette, deliberately: an instrument face is white with black
   markings, that is what makes it read as an instrument at all, and a fixed
   ground has to have fixed marks on it or the pair comes apart on a dark
   night. The palette's only say here is the danger arc and the rim.

   That leaves --qs-accent-on-comp1 and --qs-dim-on-comp1 with no consumers
   again — see the note in media/qs-palette.js. */
.qs-gauges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
}

.qs-gauge {
  width: 112px;
  margin: 0;
  text-align: center;
}

.qs-gauge svg {
  display: block;
  width: 100%;
  height: auto;
}

.qs-gauge-plate {
  fill: #ffffff;
  /* The rim is what holds a white plate off a light band; on a dark night the
     plate separates itself and this is barely seen. */
  stroke: var(--qs-chart-dim);
  stroke-width: 1;
}

.qs-gauge-arc {
  fill: none;
  stroke: #000000;
  stroke-width: 0.8;
}

/* The top of the scale, and the one place the day's colour reaches the dial.
   The accent clears 3:1 against the page ground by construction, and a white
   plate is lighter still, so it is legible here on any night. */
.qs-gauge-danger {
  fill: none;
  stroke: var(--qs-comp1);
  stroke-width: 2.6;
}

.qs-gauge-tick {
  stroke: #000000;
  stroke-width: 0.7;
  opacity: 0.55;
}

.qs-gauge-tick-major {
  stroke-width: 1.4;
  opacity: 1;
}

.qs-gauge-num {
  fill: #000000;
  font-size: 6.5px;
  text-anchor: middle;
  opacity: 0.8;
}

.qs-gauge-needle {
  fill: #000000;
}

/* The sweep up from rest is added a frame after the band opens, so it actually
   runs; without the class the needle is simply placed. */
.qs-gauges-live .qs-gauge-needle {
  transition: transform 1.1s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@media (prefers-reduced-motion: reduce) {
  .qs-gauges-live .qs-gauge-needle {
    transition: none;
  }
}

/* A sensor that did not answer loses its needle. With no printed readout there
   is nothing else to say "no reading" with, and a needle resting on zero would
   say the opposite of the truth. */
.qs-gauge-missing .qs-gauge-needle {
  display: none;
}

.qs-gauge-name {
  display: block;
  margin-top: 5px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--qs-chart-dim);
}

/* The scene ------------------------------------------------------------------
   The twelve-words-or-fewer image the night's two colours were taken off, at
   the foot of the page in parentheses. No panel and no label: it is a caption
   for the whole page rather than a section of it, and --qs-link is the accent
   made legible on the page ground — the sentence that produced the palette,
   rendered in it.

   Empty on a fallback night, and hidden rather than stale when it is: the other
   prose stays true when it ages, but a scene describing colours that are not on
   screen does not. */
.qs-scene[hidden] {
  display: none;
}

/* Parenthesised, which is the tone of the thing: an aside at the foot of the
   page rather than a caption announcing itself. The brackets are pseudo-
   elements because renderScene() writes el.textContent and would wipe any
   literal ones out of the markup; this way they also vanish with the line on a
   fallback night, instead of leaving an empty "()" behind. */
.qs-scene::before {
  content: "(";
}

.qs-scene::after {
  content: ")";
}

.qs-scene {
  padding: 0 0 14px;
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--qs-link);
}


/* The sun --------------------------------------------------------------------
   Today's solar production, drawn behind the title by /media/qs-sun.js: a
   ribbon along the sun's own arc whose thickness is the roof's output hour by
   hour, rays down from the hours that cleared the floor, and the disc itself at
   the current time in Chicago. The script's own header comment has the rest.

   Two colours, one warm pair: the gold is midday and the rosier one is both
   ends of the day, which is the only thing here that is decoration rather than
   reading. They are deliberately NOT derived from the nightly palette — the sun
   is the sun whatever colour the day picked, and this sits on the masthead's
   fixed white rather than on --qs-main or --qs-comp1, so nothing about it needs
   to move when the palette does.

   Everything is pale on purpose. The site title sits directly on top of it, so
   the strongest thing here is the disc at 0.34 alpha over white — about
   #fbe2b8, which still clears AA against the title's black by a wide margin.
   Raising these is a contrast change, not a taste change. */
:root {
  --qs-sun-core: #f7b733;   /* midday gold */
  --qs-sun-edge: #e8836a;   /* dawn and dusk, rosier */
}

.qs-sun {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;  /* the pills are underneath it in the stacking order */
}

.qs-sun-stop-core {
  stop-color: var(--qs-sun-core);
}

.qs-sun-stop-edge {
  stop-color: var(--qs-sun-edge);
}

.qs-sun-ribbon {
  fill: url(#qs-sun-ribbon-fill);
  opacity: 0.3;
}

/* Blurred as a group rather than one beam at a time: the wedges are cut with
   hard edges and overlap each other, and softening the whole comb at once is
   what turns a row of triangles into light. */
.qs-sun-rays {
  filter: blur(1.8px);
}

.qs-sun-ray {
  fill: url(#qs-sun-ray-fill);
}

.qs-sun-halo {
  fill: url(#qs-sun-halo-fill);
  opacity: 0.5;
}

.qs-sun-core {
  fill: var(--qs-sun-core);
  opacity: 0.34;
}
