/* Volta — a bench for small precise instruments.
   Copper and verdigris on graphite, after the voltaic pile.
   No external requests: the subject of half these pages is data that stays put. */

:root {
  --ink: #0B0C0C;
  --ink-raised: #131515;
  --rule: #232727;
  --rule-faint: #191C1C;
  --text: #E8E6E1;
  --text-dim: #9A9691;
  --text-faint: #5E5B57;
  --copper: #C97B4A;
  --copper-dim: #6B3F26;
  --verdigris: #4FB49B;
  --measure: 34rem;
  --serif: ui-serif, "New York", Iowan Old Style, Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  /* Graph paper, barely there. Depth from ruling rather than from shadow. */
  background-image:
    linear-gradient(var(--rule-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-faint) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  background-position: -1px -1px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  padding: 0 6vw 6rem;
}

a { color: var(--copper); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }

/* ---- The rail: a hairline that runs the height of the page ---- */

.sheet {
  max-width: 62rem;
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.25rem, 4vw, 3.5rem);
}

/* ---- Masthead ---- */

.masthead {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 3.5rem 0 0;
  text-decoration: none;
  color: inherit;
}

.pile { flex: none; }
.pile rect { transition: transform 240ms ease; }
.masthead:hover .pile rect:nth-child(odd) { transform: translateX(2px); }
.masthead:hover .pile rect:nth-child(even) { transform: translateX(-2px); }

.wordmark {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text);
}

/* ---- Meta labels: the caps-and-tracking move that carries the whole thing ---- */

.meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---- Type ---- */

h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 1.6rem 0 0;
  max-width: 18ch;
}

h2 {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 3rem 0 0.6rem;
  max-width: var(--measure);
}

h2::before {
  content: "";
  display: block;
  width: 26px;
  border-top: 1px solid var(--copper-dim);
  margin-bottom: 1.1rem;
}

p, li { max-width: var(--measure); color: var(--text-dim); }
p { margin: 0 0 1.1rem; }
li { margin-bottom: 0.5rem; }
strong { color: var(--text); font-weight: 600; }

.lede {
  font-size: 1.18rem;
  color: var(--text);
  margin-top: 1.6rem;
  max-width: 40rem;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--verdigris);
}

/* ---- The apps, as a ruled list rather than cards ---- */

.instruments { margin: 4.5rem 0 0; border-top: 1px solid var(--rule); }

.instrument {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.4rem 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: padding-left 200ms ease, border-color 200ms ease;
}

.instrument:hover { padding-left: 0.75rem; border-color: var(--copper-dim); }
.instrument:hover .instrument-name { color: var(--copper); }

.instrument-name {
  font-family: var(--serif);
  font-size: 1.42rem;
  transition: color 200ms ease;
}

.instrument-line {
  grid-column: 1 / 2;
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 38ch;
}

.instrument-state {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.instrument-state.live { color: var(--verdigris); }

/* ---- Footer ---- */

.colophon {
  margin-top: 5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  align-items: baseline;
}

.colophon a { color: var(--text-faint); text-decoration: none; }
.colophon a:hover { color: var(--copper); }
.colophon .spacer { flex: 1 1 auto; }

/* ---- Legal pages ---- */

.document { padding-top: 3rem; }
.document h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
.updated { margin-top: 0.9rem; }
.back { display: inline-block; margin-top: 2.6rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; }

.note {
  border-left: 2px solid var(--copper-dim);
  padding: 0.15rem 0 0.15rem 1.1rem;
  margin: 1.6rem 0;
}

.note p:last-child { margin-bottom: 0; }

/* ---- One orchestrated entrance, staggered down the page ---- */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 620ms cubic-bezier(.2,.7,.3,1) backwards; }
  .rise:nth-child(1) { animation-delay: 40ms; }
  .rise:nth-child(2) { animation-delay: 110ms; }
  .rise:nth-child(3) { animation-delay: 180ms; }
  .rise:nth-child(4) { animation-delay: 250ms; }
  .rise:nth-child(5) { animation-delay: 320ms; }
  .rise:nth-child(6) { animation-delay: 390ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

@media (max-width: 34rem) {
  body { font-size: 16px; padding: 0 5vw 4rem; }
  .instrument { grid-template-columns: 1fr; }
  .instrument-state { grid-column: 1; }
}

/* ---- App marks in the instrument list ---- */

.instrument { grid-template-columns: 44px 1fr auto; }
.instrument-mark {
  grid-row: 1 / 3;
  width: 44px; height: 44px;
  border-radius: 10px;
  align-self: center;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 1rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--copper);
  overflow: hidden;
}
.instrument-mark img { width: 100%; height: 100%; display: block; }
.instrument-mark.pending { background: var(--rule); color: var(--text-faint); }
.instrument-name { grid-column: 2; }
.instrument-line { grid-column: 2 / 3; }
.instrument-state { grid-column: 3; grid-row: 1; }

@media (max-width: 34rem) {
  .instrument { grid-template-columns: 36px 1fr; }
  .instrument-mark { width: 36px; height: 36px; border-radius: 8px; }
  .instrument-state { grid-column: 2; grid-row: auto; }
}
