/* acmecontrol.ca. One stylesheet, system fonts, no scripts: the server's policy is
   style-src 'self' and no script source. Colours are tokens; the dark set follows the
   reader's system setting. */
:root {
  color-scheme: light dark;
  --paper: #f5f1e7;
  --surface: #fbf8f1;
  --ink: #16233f;
  --text: #1d2535;
  --muted: #586172;
  --rule: #d3cab6;
  --brass: #8c5e14;
  --brass-soft: #b98a35;
  --link: #0b5cad;
  --on-ink: #f5f1e7;
  --serif: 'Palatino Linotype', Palatino, 'Book Antiqua', 'Iowan Old Style', Georgia, serif;
  --sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'Cascadia Code', Consolas, 'SF Mono', Menlo, monospace;
  --bg: var(--paper);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1322;
    --surface: #111a2d;
    --ink: #dbe3f1;
    --text: #e3e8f0;
    --muted: #9ba7ba;
    --rule: #28344d;
    --brass: #d6ab58;
    --brass-soft: #b98a35;
    --link: #86b9f2;
    --on-ink: #0c1322;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.25;
}

p {
  margin: 0 0 1.05rem;
  text-wrap: pretty;
}

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

strong,
b {
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -999rem;
  top: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--on-ink);
  z-index: 2;
}

.skip:focus {
  left: 0.5rem;
}

.wrap {
  width: min(100% - 2.5rem, 70rem);
  margin-inline: auto;
}

.narrow {
  max-width: 44rem;
}

section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  background: var(--bg);
}

section.alt {
  --bg: var(--surface);
  border-block: 1px solid var(--rule);
}

/* Header and footer */
.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 400 1.35rem/1 var(--serif);
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  margin: 0;
}

.brand b {
  font-weight: 400;
  color: var(--brass);
}

.mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
}

nav a {
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.6rem;
}

nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 0.5em;
}

.band {
  display: block;
  width: 100%;
  opacity: 0.75;
}

.defs {
  position: absolute;
}

.foot-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 1.75rem 2.25rem;
  color: var(--muted);
}

.foot-in p {
  margin: 0;
}

.small {
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Text furniture */
.eyebrow,
.stage {
  font: 500 0.76rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-top: 1.5rem;
  max-width: 36rem;
}

.aside {
  color: var(--muted);
  border-left: 2px solid var(--brass-soft);
  padding-left: 1rem;
  margin-top: 1.5rem;
}

.pill {
  display: inline-block;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 99px;
  padding: 0.3rem 0.6rem;
  margin-left: 0.35rem;
  vertical-align: 0.1em;
}

.pill.now {
  color: var(--brass);
  border-color: var(--brass-soft);
}

.pill.done {
  color: var(--on-ink);
  background: var(--ink);
  border-color: var(--ink);
}

.status {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 1.75rem;
}

.status .pill {
  margin: 0 0.5rem 0 0;
}

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

.btn {
  display: inline-block;
  font: 500 0.95rem/1 var(--sans);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0.85rem 1.3rem;
}

.btn.primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn:hover {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px var(--brass);
}

/* Layout */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.split.flip > :first-child {
  order: 2;
}

.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8vw, 6rem);
}

/* Figures */
.fig {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 32rem;
}

.fig-art {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  font: 400 0.76rem/1.6 var(--mono);
  color: var(--muted);
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
}

.ink {
  stroke: var(--ink);
}

.brass {
  stroke: var(--brass);
}

.fill-ink {
  fill: var(--ink);
}

.fill-brass {
  fill: var(--brass);
}

.paper-fill {
  fill: var(--bg);
}

.hair {
  stroke-width: 0.6;
}

.fine {
  stroke-width: 0.75;
}

.heavy {
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.soft {
  stroke-width: 1;
  opacity: 0.7;
}

.dash {
  stroke-dasharray: 3 3.5;
}

/* Hero figure: a heartbeat that travels from the rim to the server. */
@media (prefers-reduced-motion: no-preference) {
  .beat {
    animation: beat 6.4s ease-in-out infinite;
  }

  .b1 { animation-delay: 0.16s; }
  .b2 { animation-delay: 0.32s; }
  .b3 { animation-delay: 0.48s; }
  .b4 { animation-delay: 0.64s; }
  .b5 { animation-delay: 0.8s; }
  .b6 { animation-delay: 0.96s; }
  .b7 { animation-delay: 1.12s; }

  /* Security figure: the three rings turn slowly against each other, about the drawing's centre. */
  .spin {
    animation: spin 300s linear infinite;
  }

  .s2 {
    animation-duration: 220s;
    animation-direction: reverse;
  }

  .s3 {
    animation-duration: 260s;
  }

  /* Product figure: the sites check in one after another, round the circle. */
  .turns > g {
    animation: beat 6.4s ease-in-out infinite;
  }

  .turns > g:nth-child(2) { animation-delay: 0.4s; }
  .turns > g:nth-child(3) { animation-delay: 0.8s; }
  .turns > g:nth-child(4) { animation-delay: 1.2s; }
  .turns > g:nth-child(5) { animation-delay: 1.6s; }
  .turns > g:nth-child(6) { animation-delay: 2s; }
  .turns > g:nth-child(7) { animation-delay: 2.4s; }

  /* Backup figure: the changed blocks are sent, run by run, then the cycle starts again. */
  .sends > path {
    stroke-dasharray: 100;
    animation: send 10s ease-in-out infinite backwards;
  }

  .sends > path:nth-child(2) { animation-delay: 0.35s; }
  .sends > path:nth-child(3) { animation-delay: 0.7s; }
  .sends > path:nth-child(4) { animation-delay: 1.05s; }
  .sends > path:nth-child(5) { animation-delay: 1.4s; }
  .sends > path:nth-child(6) { animation-delay: 1.75s; }
  .sends > path:nth-child(7) { animation-delay: 2.1s; }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes send {
  0% {
    stroke-dashoffset: 100;
    opacity: 1;
  }

  28%,
  88% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

@keyframes beat {
  0%,
  22%,
  100% {
    opacity: 1;
  }

  7% {
    opacity: 0.28;
  }
}

/* Engraved plates: the image is a mask, so the ink takes the theme's colour. */
.engr {
  width: 100%;
  background-color: var(--ink);
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.engr-mainstreet {
  aspect-ratio: 3 / 2;
  -webkit-mask-image: url(/img/mainstreet.png);
  mask-image: url(/img/mainstreet.png);
}

.engr-lighthouse {
  aspect-ratio: 1;
  -webkit-mask-image: url(/img/lighthouse.png);
  mask-image: url(/img/lighthouse.png);
}

.plate.round {
  max-width: 26rem;
}

/* Security points */
.points {
  margin: 0;
}

.points dt {
  font: 400 1.3rem/1.25 var(--serif);
  color: var(--ink);
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}

.points dt:first-child {
  border-top: 0;
  padding-top: 0.25rem;
}

.points dd {
  margin: 0.4rem 0 1.15rem;
}

/* Feature cards */
.cards {
  list-style: none;
  padding: 0;
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2.5rem;
}

.cards li {
  border-top: 1px solid var(--rule);
  padding: 1.3rem 0 1.1rem;
}

.cards h3,
.rules h3,
.road h3 {
  margin-bottom: 0.45rem;
}

.rules h3 {
  font-size: 1.18rem;
}

.cards p,
.rules p,
.road p {
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0;
}

/* Numbered decisions */
.rules {
  list-style: none;
  counter-reset: rule;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem;
}

.rules li {
  counter-increment: rule;
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}

.rules li::before {
  content: '0' counter(rule);
  display: block;
  font: 500 0.76rem/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--brass);
  margin-bottom: 0.9rem;
}

/* Roadmap */
.road {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.road li {
  padding: 1.4rem 1.4rem 1.4rem 0;
  border-right: 1px solid var(--rule);
  margin-right: 1.4rem;
}

.road li:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

.road .stage {
  color: var(--muted);
}

.gate {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brass);
  background: var(--surface);
  max-width: 52rem;
}

.gate b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--ink);
}

@media (max-width: 62rem) {
  .rules,
  .road {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .road li,
  .road li:last-child {
    border-right: 0;
    margin-right: 0;
    padding-right: 1.4rem;
    border-bottom: 1px solid var(--rule);
  }

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

@media (max-width: 48rem) {
  body {
    font-size: 1rem;
  }

  .wrap {
    width: min(100% - 2rem, 70rem);
  }

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

  .split.flip > :first-child {
    order: 0;
  }

  .fig {
    max-width: 26rem;
  }

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

  .lede {
    font-size: 1.1rem;
  }
}

@media print {
  .beat,
  .spin,
  .turns > g,
  .sends > path {
    animation: none;
  }

  section {
    padding-block: 1.5rem;
    break-inside: avoid;
  }
}
