/* Atomic manual: one typeface, the panels as the pictures, light or dark. */

:root {
  --ink: #1d1d1f;
  --soft: #6e6e73;
  --line: #d9d9de;
  --ground: #fbfbfa;
  --glow: #f2c500;
  --lift: rgba(0, 0, 0, 0.16);
  --plate-h: 608px;
  --panel-h: 456px;
}

html[data-mode="dark"] {
  --ink: #f2f2f2;
  --soft: #9a9aa0;
  --line: #3a3a3e;
  --ground: #161617;
  --lift: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Every picture is there twice; the mode shows one. */
html:not([data-mode="dark"]) .pic-dark,
html[data-mode="dark"] .pic-light { display: none; }
/* on the dark page a dark panel needs an edge where light ones have a shadow */
html[data-mode="dark"] .detail .plate img, html[data-mode="dark"] .card img { outline: 1px solid rgba(255, 255, 255, 0.14); }

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

header, main, footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

header { padding-top: 40px; padding-bottom: 48px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
}

.brand {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.5em;
  color: var(--soft);
}

.brand a { text-decoration: none; }

/* the switch: two words, the one in force in ink */
.mode {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.mode span {
  padding: 3px 12px;
  border-radius: 999px;
  color: var(--soft);
}

html:not([data-mode="dark"]) .mode [data-to="light"],
html[data-mode="dark"] .mode [data-to="dark"] {
  background: var(--ink);
  color: var(--ground);
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.blurb {
  max-width: 640px;
  margin: 20px 0 0;
  font-size: 19px;
  color: var(--soft);
}

nav {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

nav a { color: var(--soft); text-decoration: none; }
nav a:hover { color: var(--ink); }

figure { margin: 0; }
img { display: block; }

figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--soft);
}

figcaption b { color: var(--ink); font-weight: 600; }

/* a big picture, the hero and each example: as wide as the page, never too tall */
.big img {
  max-width: 100%;
  max-height: 600px;
  width: auto;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 2px var(--lift), 0 12px 32px var(--lift);
}

/* a rig in a row, at the panels' own size, shrinking to fit */
.row { margin: 24px 0 8px; }
.row img {
  max-width: 100%;
  height: auto;
  /* a filmed rig is transparent round its panels and cables, so the shadow
     follows what is drawn, not the picture's box */
  filter: drop-shadow(0 1px 1px var(--lift)) drop-shadow(0 4px 9px var(--lift));
}

section { padding-top: 96px; }

h2 {
  margin: 0 0 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft);
}

section > p, .text p, .step p { max-width: 640px; }
section p b, .text b { font-weight: 600; }

/* the modules */

.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 72px 24px;
}

.name {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft);
}

.module h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module .line {
  margin: 8px 0 24px;
  min-height: 3em;
  max-width: 290px;
  color: var(--soft);
}

.more {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.more::after { content: " \2192"; }
.more:hover { border-color: var(--ink); }

.panel {
  position: relative;
  height: var(--panel-h);
}

.panel img {
  height: var(--panel-h);
  width: auto;
  box-shadow: 0 1px 2px var(--lift), 0 6px 18px var(--lift);
}

.panel ul {
  position: absolute;
  inset: 0 0 0 54px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.panel li {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  padding-left: 30px;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--soft);
  white-space: nowrap;
}

/* the leader: a hairline from the panel's edge to the words */
.panel li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 20px;
  border-top: 1px solid var(--line);
}

.panel li b { margin-right: 4px; color: var(--ink); font-weight: 600; }

/* how to build your own rig */

.step { margin-bottom: 72px; }

.step h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.step .n {
  display: inline-block;
  width: 2em;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  vertical-align: 3px;
}

.step p { margin: 0 0 0 2.15em; font-size: 17px; color: var(--soft); }
.step .row { margin-left: 26px; }


/* the examples */

.sub { margin: -16px 0 32px; font-size: 17px; color: var(--soft); }
.examples .sub:last-child { margin: 24px 0 0; font-size: 13px; }


/* a module's own page */

.guide section { padding-top: 72px; }

.split { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.split .panel { width: 300px; }
.split .text { flex: 1; min-width: 260px; }
.split .text p:first-child { margin-top: 0; }


h3 { font-size: 15px; font-weight: 600; margin: 40px 0 12px; }

.keys {
  width: 100%;
  max-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

.keys th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  padding: 0 16px 8px 0;
}

.keys td {
  padding: 7px 16px 7px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.keys td:first-child { color: var(--soft); width: 30%; }
.keys td:nth-child(2) { width: 26%; }

kbd {
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.back { margin-top: 72px; font-size: 13px; }

footer {
  padding-top: 120px;
  padding-bottom: 64px;
  font-size: 13px;
  color: var(--soft);
}

/* ---- the third draft's parts ---- */

/* the news strip, above everything */
.news {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--soft);
}
.news p { max-width: 1080px; margin: 0 auto; padding: 9px 32px; }
.news a { color: var(--ink); }

/* the way back, at the top of a module's page */
.bar .up {
  margin-left: auto;
  margin-right: 20px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--soft);
}
.bar .up::before { content: "\2190  "; }
.bar .up:hover { color: var(--ink); }

/* a module's code under its name, on its own page */
header .name { font-size: 13px; }
/* the rule above a page's footer, as wide as the text and no wider */
.guide + footer, main + footer { margin-top: 120px; padding-top: 0; }
.guide + footer::before, main + footer::before { content: ""; display: block; border-top: 1px solid var(--line); margin-bottom: 32px; }

/* a card's variants: the faces turn over by a small switch above the panel */
.look { position: relative; }
.look .panel[hidden] { display: none; }
.flip { display: flex; align-items: baseline; gap: 4px; margin-bottom: 14px; }
.flip span { margin-right: 6px; color: var(--soft); font-size: 11px; letter-spacing: 0.08em; }
.flip button {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.flip button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }

/* the faces of a module, side by side, at the panels' size */
.faces, .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 36px;
  margin: 24px 0;
}
.faces figure { width: min-content; min-width: 170px; }
.faces img { height: auto; box-shadow: 0 1px 2px var(--lift), 0 6px 18px var(--lift); }
.buttons figure { width: 200px; }
.buttons img { height: auto; border-radius: 2px; box-shadow: 0 1px 2px var(--lift), 0 3px 8px var(--lift); }

/* two rigs that do the same thing */
.pair { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.pair .eq { font-size: 40px; font-weight: 300; color: var(--soft); }
.pair figcaption { flex-basis: 100%; }

/* a loop: as a picture, without controls unless motion is turned down */
.loop video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* a panel in detail: the panel large, a label for every control, each led to
   its control by a line (manual.js lays them out and draws the lines) */
.detail {
  position: relative;
  margin: 8px 0 40px;
  min-height: var(--plate-h);
}
.detail .plate {
  position: absolute;
  top: 0;
  left: calc(50% - 36px);
  width: 72px;
}
.detail .plate img {
  width: 72px;
  height: var(--plate-h);
  box-shadow: 0 1px 2px var(--lift), 0 6px 18px var(--lift);
}
.detail .calls { margin: 0; padding: 0; list-style: none; }
.detail .calls li {
  position: absolute;
  width: calc(50% - 36px - 64px);
  max-width: 340px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--soft);
}
.detail .calls li[data-side="l"] { right: calc(50% + 36px + 64px); text-align: right; }
.detail .calls li[data-side="r"] { left: calc(50% + 36px + 64px); }
.detail .calls b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.detail .leads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.detail .leads polyline { fill: none; stroke: var(--soft); stroke-width: 1; opacity: 0.7; }
html[data-mode="dark"] .detail .leads polyline { opacity: 1; }
.detail .leads circle { fill: var(--glow); stroke: var(--ink); stroke-width: 1; }

/* the deeper details, folded until asked for */
details {
  max-width: 640px;
  margin: 0 0 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 4px; color: var(--soft); }

.foot { margin-top: 48px; font-size: 13px; color: var(--soft); }
.star { text-decoration: none; color: var(--soft); vertical-align: super; font-size: 0.75em; }

.back { margin-top: 56px; font-size: 16px; }
.back a { text-decoration: none; border-bottom: 1px solid var(--line); }
.back a::before { content: "\2190  "; }

/* the build: a loop a step, the new module lit underneath */
.step .loop { margin-left: 26px; }

/* the examples: one stage of one height, the arrows at its middle, every
   picture fitted into it and centred */
.gallery {
  --stage: 560px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 12px;
}
.gallery > button {
  align-self: start;
  margin-top: calc(var(--stage) / 2 - 20px);
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.gallery > button:hover { color: var(--ink); border-color: var(--ink); }
.slides { min-width: 0; }
.slides .stage {
  height: var(--stage);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slides .stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 2px var(--lift), 0 12px 32px var(--lift);
}
.slides figcaption { margin: 20px auto 0; min-height: 3em; }

footer .links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer .links a { text-decoration: none; color: var(--ink); }
footer p { margin: 0 0 8px; }

@media (max-width: 720px) {
  header, main, footer { padding-left: 20px; padding-right: 20px; }
  .news p { padding: 8px 20px; }
  h1 { font-size: 32px; }
  .blurb { font-size: 17px; }
  :root { --plate-h: 560px; }
  .detail .plate { left: 0; width: 66px; }
  .detail .plate img { width: 66px; }
  .detail .calls li, .detail .calls li[data-side="l"], .detail .calls li[data-side="r"] { left: 104px; right: auto; width: auto; max-width: none; text-align: left; }
  .gallery { --stage: 64vw; grid-template-columns: 32px 1fr 32px; gap: 6px; }
  .gallery > button { width: 32px; height: 32px; margin-top: calc(var(--stage) / 2 - 16px); font-size: 18px; }
  .step .loop, .step .row { margin-left: 0; }
  .step p { margin-left: 0; }
}
