/* DSNV Technologies: contact sheet and index ledger. See DESIGN.md. */

:root {
  color-scheme: light dark;

  --fog: #E9ECEF;
  --leaf: #F6F7F9;
  --raven: #14161C;
  --pewter: #5A6171;
  --sheen: #3341A6;
  --lamp: #F2B23A;

  --rule: #CBD0D8;
  --rule-strong: #A9B0BC;
  --tile-bg: #F6F7F9;
  --tile-edge: #D3D8DF;
  --tile-a: #D9DEE5;
  --tile-b: #B7C0CC;
  --tile-c: #8792A4;
  --tile-ink: #14161C;
  --mark-band: rgba(242, 178, 58, .55);

  --serif: ui-serif, "New York", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 16px;
  --margin-col: 13rem;
  --measure: 65ch;
}

@media (min-width: 640px) { :root { --gutter: 28px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; } }

@media (prefers-color-scheme: dark) {
  :root {
    --fog: #0E1117;
    --leaf: #161A22;
    --raven: #E6E8EE;
    --pewter: #9AA1B1;
    --sheen: #9CA8FF;
    --lamp: #F2B23A;

    --rule: #262C37;
    --rule-strong: #3A4250;
    --tile-bg: #171B23;
    --tile-edge: #262C37;
    --tile-a: #262C37;
    --tile-b: #343C4A;
    --tile-c: #4D576A;
    --tile-ink: #E6E8EE;
    --mark-band: rgba(242, 178, 58, .38);
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--fog);
  color: var(--raven);
  font: 400 1.0625rem/1.6 var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a { color: var(--sheen); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--lamp); color: #14161C; }

h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

mark {
  color: inherit;
  background: linear-gradient(to top, var(--mark-band) 0 .62em, transparent .62em);
  padding: 0 .08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

q, .ask { font-family: var(--serif); font-style: italic; }
q { quotes: "\201C" "\201D"; }

.shell {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label {
  font: 500 .75rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pewter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: .5rem .75rem;
  background: var(--raven);
  color: var(--fog);
  font: 500 .875rem/1 var(--mono);
}
.skip:focus { top: 12px; }

/* Header */

.site-header { border-bottom: 1px solid var(--rule); }

.site-header .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 2rem;
  padding-block: 1.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--raven);
  text-decoration: none;
  font: 600 .8125rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.brand svg { width: 22px; height: 22px; flex: none; }
.brand .lite { color: var(--pewter); font-weight: 400; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: .35rem;
  color: var(--raven);
  text-decoration: none;
  font-size: .9375rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--lamp); }

/* Mark (logo grid) */

.mark-grid rect { fill: var(--raven); }
.mark-grid rect.on { fill: var(--lamp); }

/* Hero */

.hero { padding-block: clamp(2.5rem, 7vw, 6.5rem) clamp(3rem, 7vw, 6rem); }

.hero .shell {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 960px) {
  .hero .shell {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: end;
  }
}

.hero .label { margin-bottom: 1.5rem; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.35rem, 1.2rem + 4.6vw, 4.75rem);
  line-height: 1.03;
  letter-spacing: -.018em;
  max-width: 16ch;
}

.hero .lead {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.55;
  color: var(--raven);
}

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  margin-top: 2rem;
}

.status .pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .85rem;
  border: 1px solid var(--raven);
  font: 500 .8125rem/1 var(--mono);
  letter-spacing: .04em;
}
.status .pill::before {
  content: "";
  width: .55rem;
  height: .55rem;
  background: var(--lamp);
}

.status a { font-size: .9375rem; }

/* Contact sheet illustration */

.sheet { margin: 0; }

.sheet .query {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  padding: .85rem 0 .9rem;
  border-top: 2px solid var(--raven);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}

.sheet .query .label { flex: none; }

.sheet .query p {
  margin: 0;
  font-size: clamp(1.125rem, 1rem + .6vw, 1.4rem);
  line-height: 1.25;
}
.sheet .caret {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: .2em;
  vertical-align: -.15em;
  background: var(--lamp);
  animation: caret 1s steps(1) 5 both;
}

.sheet svg { width: 100%; height: auto; }

.sheet figcaption {
  margin-top: .85rem;
  font: .75rem/1.5 var(--mono);
  color: var(--pewter);
}

.t-bg { fill: var(--tile-bg); stroke: var(--tile-edge); stroke-width: 1; }
.t-a { fill: var(--tile-a); }
.t-b { fill: var(--tile-b); }
.t-c { fill: var(--tile-c); }
.t-ink { fill: var(--tile-ink); }
.t-lamp { fill: var(--lamp); }
.t-line { fill: none; stroke: var(--tile-b); stroke-width: 2; stroke-linecap: round; }
.t-perf { fill: none; stroke: var(--tile-c); stroke-width: 1; stroke-dasharray: 3 3; }

.tile { opacity: .5; animation: settle 1.1s ease-out .9s both; }
.tile.found { opacity: 1; animation: none; }

.finder { fill: none; stroke: var(--lamp); stroke-width: 4; stroke-linecap: square; }
.finder path { stroke-dasharray: 40; stroke-dashoffset: 0; animation: draw .6s ease-out 1.5s both; }

.scan { fill: var(--lamp); opacity: 0; animation: scan 1.4s cubic-bezier(.5, 0, .3, 1) .15s both; }

@keyframes settle { from { opacity: 1; } to { opacity: .5; } }
@keyframes draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes scan {
  0% { opacity: 0; transform: translateY(0); }
  15% { opacity: .55; }
  85% { opacity: .55; }
  100% { opacity: 0; transform: translateY(392px); }
}
@keyframes caret { 50% { opacity: 0; } }

/* Ledger sections */

.ledger { padding-bottom: clamp(3rem, 8vw, 6rem); }

.entry {
  display: grid;
  gap: 1rem 2rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

@media (min-width: 860px) {
  .entry { grid-template-columns: var(--margin-col) minmax(0, 1fr); }
}

.entry > .label { padding-top: .45rem; }
.entry > .label b { color: var(--raven); font-weight: 600; }

.entry h2 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  max-width: 22ch;
}

.entry h2 + * { margin-top: 1.25rem; }

.prose { max-width: var(--measure); }
.prose p + p { margin-top: 0; }

/* Lists of numbered items */

.items {
  display: grid;
  gap: 0 2.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

@media (min-width: 700px) { .items.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .items.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 700px) and (max-width: 1099px) { .items.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.items li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0 .5rem;
  padding-block: 1.1rem 1.3rem;
  border-top: 1px solid var(--rule);
}
.items li::before {
  content: counter(item, decimal-leading-zero);
  grid-row: span 2;
  padding-top: .3rem;
  font: 500 .75rem/1.4 var(--mono);
  color: var(--pewter);
}
.items h3 { font: 600 1.0625rem/1.4 var(--sans); }
.items p { margin-top: .3rem; color: var(--pewter); }
.items li.lit::before { color: var(--raven); }
.items li.lit h3 mark { padding-inline: .1em; }

/* Example questions */

.asks { margin: 1.75rem 0 0; padding: 0; list-style: none; }
.asks li {
  padding-block: .6rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  line-height: 1.3;
}
.asks li:first-child { border-top: 1px solid var(--rule); }

/* Definition lists (facts, contacts) */

.facts { margin: 1.5rem 0 0; display: grid; gap: 0; max-width: 46rem; }
.facts div {
  display: grid;
  gap: .15rem 1.5rem;
  padding-block: .8rem;
  border-top: 1px solid var(--rule);
}
.facts div:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 600px) { .facts div { grid-template-columns: 12rem minmax(0, 1fr); } }
.facts dt { font: 500 .75rem/1.9 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--pewter); }
.facts dd { margin: 0; }

/* Answer illustration (Munin page) */

.answer {
  margin: 2rem 0 0;
  display: grid;
  gap: 1.25rem 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--leaf);
  border: 1px solid var(--rule);
}
@media (min-width: 900px) {
  .answer { grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); align-items: start; }
  .answer svg { grid-column: 2; grid-row: 1 / span 2; }
  .answer figcaption { grid-column: 1; grid-row: 2; align-self: end; }
}

.answer .q { font-family: var(--serif); font-style: italic; font-size: 1.375rem; line-height: 1.3; }
.answer .a { margin-top: .9rem; font-size: 1.0625rem; }
.answer .a .src { font: 500 .75rem/1 var(--mono); color: var(--pewter); vertical-align: .1em; }
.answer svg { width: 100%; max-width: 15rem; height: auto; }
.answer figcaption { font: .75rem/1.5 var(--mono); color: var(--pewter); }

/* Legal documents */

.doc-head { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }
.doc-head h1 {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -.015em;
  max-width: 18ch;
  margin-top: 1.25rem;
}
.doc-head .lead { margin-top: 1.25rem; max-width: var(--measure); font-size: 1.125rem; }
.doc-head .meta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }

.doc {
  display: grid;
  gap: 2rem;
  padding-block: 2rem clamp(3rem, 8vw, 6rem);
  /* the hairline sits inside the gutters, like the ledger rules */
  background: linear-gradient(var(--rule), var(--rule)) 50% 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
@media (min-width: 960px) {
  .doc { grid-template-columns: var(--margin-col) minmax(0, 1fr); gap: 2rem; }
}

.toc { font: .8125rem/1.5 var(--mono); }
.toc ol { margin: .75rem 0 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 2rem 1fr; padding-block: .3rem; }
.toc li::before { content: counter(toc, decimal-leading-zero); color: var(--pewter); }
.toc a { color: var(--raven); text-decoration: none; }
.toc a:hover { color: var(--sheen); text-decoration: underline; }

@media (min-width: 960px) {
  .toc { position: sticky; top: 1.5rem; align-self: start; }
}
@media (max-width: 959px) {
  .toc { padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
}

.article { max-width: var(--measure); counter-reset: sec; }
.article > .facts:first-child { margin-top: 0; }
.doc > .label { padding-top: .2rem; }
@media (max-width: 959px) { .doc > p.label { margin-bottom: -1rem; } }
.article section { padding-top: 1.25rem; scroll-margin-top: 1rem; }
.article section + section { margin-top: 1.75rem; border-top: 1px solid var(--rule); padding-top: 1.75rem; }
.article h2 {
  counter-increment: sec;
  font-family: var(--serif);
  font-size: 1.625rem;
  line-height: 1.2;
  margin-bottom: .9rem;
}
.article h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: .4rem;
  font: 500 .75rem/1.4 var(--mono);
  letter-spacing: .08em;
  color: var(--pewter);
}
.article h3 { font: 600 1.0625rem/1.4 var(--sans); margin: 1.5rem 0 .4rem; }
.article ul { padding-left: 1.2rem; margin: 0 0 1em; }
.article li { margin-bottom: .5em; }
.article li::marker { color: var(--pewter); }
.article address { font-style: normal; }
.article .short {
  padding: 1.1rem 1.25rem;
  background: var(--leaf);
  border: 1px solid var(--rule);
}

/* FAQ */

.faq { max-width: var(--measure); }
.faq h3 { font-family: var(--serif); font-size: 1.375rem; line-height: 1.3; margin: 0 0 .5rem; }
.faq > div { padding-block: 1.4rem; border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }
.faq > div:first-child { border-top: 0; padding-top: 0; }

.contact-big {
  display: inline-block;
  margin-top: .25rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.5rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

/* 404 */

.lost { padding-block: clamp(3rem, 10vw, 8rem); }
.lost h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 1.4rem + 4.5vw, 4.5rem);
  line-height: 1.05;
  max-width: 20ch;
  margin-top: 1.25rem;
}
.lost p:not(.label) { margin-top: 1.25rem; max-width: 36rem; font-size: 1.125rem; }
.lost ul { margin: 2rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }

/* Colophon footer */

.colophon {
  background: var(--leaf);
  border-top: 1px solid var(--rule);
  padding-block: 2rem 1.75rem;
  font-size: .9375rem;
}

.colophon .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2.5rem;
}

.colophon .who {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  margin: 0;
  font: 600 .8125rem/1.5 var(--mono);
  letter-spacing: .06em;
}
.colophon .who svg { width: 22px; height: 22px; flex: none; }
.colophon .nb { white-space: nowrap; }

.colophon nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.colophon nav a { color: var(--raven); }
.colophon nav a[aria-current="page"] { text-decoration-color: var(--lamp); text-decoration-thickness: 2px; }

.colophon .fine {
  flex-basis: 100%;
  margin: .5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font: .75rem/1.6 var(--mono);
  color: var(--pewter);
}

/* Motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .site-header nav, .skip, .toc { display: none; }
  body { background: #fff; color: #000; }
}
