/* Fotolane. Neutral greys only: the photographs carry the colour, the yellow marks what changed. */

@font-face {
  font-family: "Recursive Text";
  src: url("/rec-text.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Recursive Code";
  src: url("/rec-code.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Recursive Note";
  src: url("/rec-note.woff2") format("woff2");
  font-weight: 750;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --ink: #000000;
  --card: #767676;   /* 18% grey card, the surface prints are judged on */
  --shade: #f2f2f2;
  --rule: #cfcfcf;
  --quiet: #595959;
  --mark: #ffd60a;   /* chinagraph pencil */
  --up: #1a7f37;
  --slow: #9a6700;

  --text: "Recursive Text", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --code: "Recursive Code", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --note: "Recursive Note", "Recursive Text", ui-sans-serif, sans-serif;

  --edge: clamp(1.25rem, 5vw, 4.5rem);
  --gap: clamp(3.5rem, 8vw, 7rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --ink: #ffffff;
    --shade: #1b1b1b;
    --rule: #3d3d3d;
    --quiet: #b3b3b3;
    --up: #56d364;
    --slow: #e3b341;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  font-synthesis: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin: 0;
}

h1,
h2 {
  font-weight: 850;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 7.4vw, 5.75rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.625rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--mark);
  text-decoration-thickness: 0.22em;
}

:focus-visible {
  outline: 3px solid var(--mark);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
}

::selection {
  background: var(--mark);
  color: #000000;
}

code,
pre,
kbd {
  font-family: var(--code);
  font-variant-ligatures: none;
}

code {
  font-size: 0.94em;
}

.shell {
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: var(--edge);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.jump {
  position: absolute;
  left: var(--edge);
  top: -5rem;
  z-index: 5;
  padding: 0.5rem 0.9rem;
  background: var(--mark);
  color: #000000;
  font-weight: 650;
}

.jump:focus {
  top: 0.75rem;
}

/* ---------- masthead ---------- */

.masthead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.375rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.375rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark svg {
  width: 1.9rem;
  height: auto;
}

.wordmark .frame-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
}

.wordmark .frame-crop {
  fill: var(--mark);
  stroke: var(--ink);
  stroke-width: 2.5;
}

.mainnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  font-weight: 550;
}

.mainnav a {
  text-decoration: none;
  padding-block: 0.2rem;
}

.mainnav a:hover,
.mainnav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 0.24em;
  text-underline-offset: 0.3em;
}

/* ---------- opening ---------- */

.opening {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  padding-block: clamp(1.5rem, 4.5vw, 3.75rem) clamp(2.25rem, 4.5vw, 3.75rem);
}

/* the headline runs the full measure on one line, the way the address does further down */
.opening h1 {
  grid-column: 1 / -1;
  font-size: clamp(2.5rem, 6.25cqi, 4.75rem);
}

.lead {
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
  line-height: 1.5;
  max-width: 34em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagehead .actions {
  margin-top: 1.75rem;
}

.button {
  display: inline-block;
  padding: 0.7em 1.15em;
  border: 2px solid var(--ink);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

.button--mark {
  background: var(--mark);
  border-color: var(--mark);
  color: #000000;
}

.button--mark:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- the booth: one original, one delivered variant ---------- */

.booth {
  background: var(--card);
  color: #000000;
  padding-block: clamp(1.75rem, 4vw, 3.5rem);
}

.booth :focus-visible {
  box-shadow: 0 0 0 5px #000000;
}

.booth__table {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  align-items: start;
  gap: 2rem clamp(1.5rem, 5vw, 5rem);
}

.sheet figcaption,
.sheet__cap {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.source {
  position: relative;
  aspect-ratio: 3 / 2;
  background: #5e5e5e;
}

.source img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.source .outside {
  fill: #000000;
  fill-opacity: 0.55;
  fill-rule: evenodd;
}

.source .pencil {
  fill: none;
  stroke: var(--mark);
  stroke-width: 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* the result column keeps room for the tallest variant, so the dials below never jump */
.result {
  display: grid;
}

.result::before {
  content: "";
  grid-area: 1 / 1;
  width: min(100%, 25rem);
  aspect-ratio: 4 / 5;
}

.result__in {
  grid-area: 1 / 1;
}

.out {
  width: calc(min(100%, 25rem) * var(--ow, 960) / 1280);
  aspect-ratio: var(--ow, 960) / var(--oh, 960);
  background: #ffffff;
  transition: width 0.4s cubic-bezier(0.3, 0.7, 0.2, 1), aspect-ratio 0.4s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.out img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.out[data-fit="pad"] img {
  object-fit: contain;
}

.pencil-note {
  margin-top: 0.6rem;
  font: 750 clamp(1.375rem, 2.2vw, 1.75rem) / 1.15 var(--note);
  color: var(--mark);
  font-variant-numeric: tabular-nums;
}

.address {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding: 0.8em 1em;
  background: #ffffff;
  color: #000000;
  font: 500 clamp(0.9375rem, 2.05vw, 1.5rem) / 1.4 var(--code);
  overflow-wrap: anywhere;
}

.address .faint {
  color: #595959;
}

.address b {
  font-weight: 700;
}

.address .is-new {
  animation: fresh 1s ease-out;
}

@keyframes fresh {
  from { background: var(--mark); }
  to { background: transparent; }
}

.dials {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 1.25rem clamp(2rem, 5vw, 4.5rem);
  margin-top: 1.5rem;
}

.dials fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.dials legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 650;
}

.dials fieldset:disabled {
  opacity: 0.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  position: relative;
  display: block;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: block;
  padding: 0.3em 0.7em;
  border: 1.5px solid #000000;
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.chip input:hover + span {
  background: #ffffff;
}

.chip input:checked + span {
  background: #000000;
  color: #ffffff;
}

.chip input:focus-visible + span {
  outline: 3px solid var(--mark);
  outline-offset: 2px;
}

.chip--photo span {
  padding: 0;
  border: 0;
  outline: 0 solid var(--mark);
}

.chip--photo img {
  width: 4.5rem;
  height: 3rem;
  object-fit: cover;
}

.chip--photo input:hover + span,
.chip--photo input:checked + span {
  background: none;
}

.chip--photo input:checked + span {
  outline: 3px solid var(--mark);
  outline-offset: 0;
}

.chip--photo input:focus-visible + span {
  outline: 3px solid var(--mark);
  outline-offset: 0;
  box-shadow: 0 0 0 5px #000000;
}

.booth__foot {
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

html:not(.has-js) .dials,
html:not(.has-js) .booth__foot {
  display: none;
}

/* ---------- bands of ordinary content ---------- */

.band {
  padding-block: var(--gap) 0;
}

.band:last-of-type {
  padding-bottom: var(--gap);
}

.band__head {
  max-width: 44rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}

.band__head p {
  margin-top: 1rem;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
}

.trio p {
  margin-top: 0.5rem;
}

.route {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem clamp(1.25rem, 2.5vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stop;
}

.route li {
  counter-increment: stop;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.route li::before {
  content: counter(stop);
  display: block;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 3px solid var(--ink);
  font-weight: 850;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.route h3 {
  margin-bottom: 0.35rem;
  font-size: 1.0625rem;
}

.twin {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
}

.twin__text p + p {
  margin-top: 1rem;
}

.twin h2 {
  margin-bottom: 1.25rem;
}

.lanes {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: 1fr 1fr;
  gap: 1.25rem 0;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.lanes__end {
  grid-row: 1 / 3;
  display: grid;
  place-content: center;
  padding: 1rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 650;
  text-align: center;
}

.lanes__end--far {
  grid-column: 3;
}

.lane {
  grid-column: 2;
  display: grid;
  align-content: center;
  gap: 0.4rem;
  padding: 0.75rem 0;
}

.lane::before {
  content: "";
  order: 2;
  height: 0.5rem;
  background: var(--ink);
}

.lanes .lane code {
  order: 1;
  justify-self: center;
  padding: 0.05em 0.4em;
  background: var(--mark);
  color: #000000;
  font-weight: 600;
}

.lane span {
  order: 3;
  padding-inline: 0.9rem;
  text-align: center;
  color: var(--quiet);
}

/* ---------- inner pages ---------- */

.pagehead {
  padding-block: clamp(1.5rem, 4vw, 3.25rem) clamp(1.75rem, 3vw, 2.75rem);
}

.pagehead h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.25rem);
}

.pagehead .lead {
  margin-top: 1.25rem;
}

.prose {
  max-width: 41rem;
}

.prose > * + * {
  margin-top: 1.1rem;
}

.prose > h2 {
  margin-top: 3.25rem;
  font-size: clamp(1.5rem, 2.4vw, 1.9375rem);
}

.prose > h3 {
  margin-top: 2rem;
}

.aside-note {
  color: var(--quiet);
  font-size: 0.9375rem;
}

.manual {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  align-items: start;
  gap: 2rem clamp(2rem, 5vw, 5rem);
  padding-bottom: var(--gap);
}

.manual__toc {
  position: sticky;
  top: 1.5rem;
  font-size: 0.9375rem;
}

.manual__toc p {
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.manual__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.manual__toc li + li {
  margin-top: 0.4rem;
}

.manual__toc a {
  text-decoration: none;
}

.manual__toc a:hover {
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 0.24em;
}

.manual__body {
  max-width: 48rem;
}

.manual__body > section + section {
  margin-top: 3.5rem;
}

.manual__body h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.9375rem);
}

.manual__body h2 + p {
  margin-top: 0.75rem;
}

.manual__body section > * + * {
  margin-top: 1.1rem;
}

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

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.spec th,
.spec td {
  padding: 0.7rem 1.25rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.spec th:last-child,
.spec td:last-child {
  padding-right: 0;
}

.spec thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.spec td:first-child code {
  white-space: nowrap;
}

.spec td code,
.prose code,
.lead code,
.manual__body p code,
.band code {
  padding: 0.08em 0.32em;
  background: var(--shade);
}

.sample {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  background: var(--shade);
  font-size: 0.875rem;
  line-height: 1.6;
  tab-size: 2;
}

.sample .rem {
  color: var(--quiet);
}

.sample b {
  font-weight: 650;
}

/* pricing */

.meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem clamp(1.5rem, 4vw, 4rem);
}

.meters h2 {
  font-size: 1.1875rem;
  letter-spacing: 0;
  font-weight: 700;
}

.price {
  margin-top: 0.4rem;
  font-weight: 850;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.price small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 550;
  letter-spacing: 0;
  color: var(--quiet);
}

.meters p:not(.price) {
  margin-top: 0.9rem;
}

.sums {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: start;
  gap: 2rem clamp(2rem, 5vw, 5rem);
}

.sums label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  align-items: center;
  gap: 0.25rem 1rem;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--rule);
}

.sums label small {
  grid-column: 1;
  color: var(--quiet);
  font-size: 0.875rem;
}

.sums input {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 550 1.0625rem/1.2 var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bill {
  padding: 1.5rem 1.6rem;
  background: var(--card);
  color: #000000;
}

.bill output {
  display: block;
  font: 750 clamp(2.25rem, 4.6vw, 3.25rem) / 1.05 var(--note);
  color: var(--mark);
  font-variant-numeric: tabular-nums;
}

.bill ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.bill li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.25rem;
}

html:not(.has-js) .sums {
  display: none;
}

/* status */

.signal {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  font-weight: 650;
}

.signal::before {
  content: "";
  flex: none;
  width: 0.72em;
  height: 0.72em;
  background: var(--up);
}

.signal--slow::before {
  background: var(--slow);
}

.log {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 48rem;
}

.log li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.25rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.log time {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.log p {
  margin-top: 0.4rem;
}

.log .aside-note {
  margin-top: 0.6rem;
}

/* not found */

.blank {
  display: grid;
  place-items: center;
  width: min(100%, 30rem);
  aspect-ratio: 3 / 2;
  border: 3px dashed var(--mark);
  font: 750 clamp(1.5rem, 4vw, 2.25rem) / 1.1 var(--note);
  color: var(--mark);
}

/* ---------- colophon ---------- */

.colophon {
  margin-top: 0;
  padding-block: 2.25rem 3rem;
  border-top: 3px solid var(--ink);
  font-size: 0.9375rem;
}

.colophon__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 3rem;
}

.colophon nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-weight: 550;
}

.colophon nav a {
  text-decoration: none;
}

.colophon nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 0.24em;
}

.colophon p {
  color: var(--quiet);
}

/* ---------- narrower screens ---------- */

@media (max-width: 68rem) {
  .route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 56rem) {
  .opening,
  .twin,
  .sums {
    grid-template-columns: minmax(0, 1fr);
  }

  .opening h1 {
    font-size: clamp(2.5rem, 10.4cqi, 4.75rem);
  }

  .trio,
  .meters {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .manual {
    grid-template-columns: minmax(0, 1fr);
  }

  .manual__toc {
    position: static;
  }

  .manual__toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
  }

  .manual__toc li + li {
    margin-top: 0;
  }
}

@media (max-width: 44rem) {
  .booth__table {
    grid-template-columns: minmax(0, 1fr);
  }

  .dials {
    grid-template-columns: minmax(0, 1fr);
  }

  .route {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .log li {
    grid-template-columns: minmax(0, 1fr);
  }

  .lanes {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 0.5rem;
  }

  .lanes__end,
  .lanes__end--far,
  .lane {
    grid-column: 1;
    grid-row: auto;
  }

  .lane span {
    padding-inline: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .out {
    transition: none;
  }

  .address .is-new {
    animation: none;
  }
}

@media print {
  .dials,
  .mainnav,
  .actions,
  .jump {
    display: none;
  }
}
