/*
 * The public pages of Tokenometr: the landing, /privacy and /terms. They wear
 * the look of the Mac app, an electricity meter: enamel, black number drums
 * with a red tenths drum, DIN figures. Light and dark follow the system.
 * Text pairs pass WCAG AA: --pencil is 4.9:1 on --plate and 5.5:1 on
 * --enamel in the light theme, 6.1:1 and 6.8:1 in the dark one.
 */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/onest-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/onest-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --enamel: #e9ece7;
  --plate: #dde1db;
  --plate-edge: #c7ccc4;
  --ink: #1f2427;
  --pencil: #565f63;
  --drum: #16191b;
  --drum-ink: #f2f2ee;
  --window: #0d0f10;
  --tenths: #c3312b;
  --rule: rgba(31, 36, 39, 0.16);
  --shot-shadow: rgba(31, 36, 39, 0.28);
  --digits: "DIN Alternate", "DIN Condensed", "Onest", system-ui, sans-serif;
  --code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --enamel: #131517;
    --plate: #1c2023;
    --plate-edge: #2c3236;
    --ink: #e6e9e4;
    --pencil: #98a09b;
    --drum: #050606;
    --drum-ink: #edede8;
    --window: #000;
    --tenths: #b8302a;
    --rule: rgba(230, 233, 228, 0.16);
    --shot-shadow: rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--enamel);
  font: 400 17px/1.55 "Onest", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

.container {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* The bar on every page: the product on the left, signing in on the right. */
.site-header {
  border-bottom: 1px solid var(--rule);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.product {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.mark {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}

/* On the dark enamel the black plate of the mark needs an edge to be seen. */
.mark-plate {
  stroke: var(--plate-edge);
  stroke-width: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--enamel);
  font: 600 16px/1 "Onest", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
  filter: contrast(1.15);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
}

.button-small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 15px;
}

/* The hero: what Tokenometr is, how to get it, and the meter itself. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding-block: 48px 64px;
}

.hero h1 {
  max-width: 13ch;
  margin: 0 0 20px;
  font-size: clamp(38px, 5.4vw, 64px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 44ch;
  margin: 0 0 32px;
  font-size: clamp(18px, 1.5vw, 20px);
  line-height: 1.5;
}

.install {
  display: flex;
  max-width: 560px;
  border: 1px solid var(--plate-edge);
  border-radius: 10px;
  background: var(--plate);
  overflow: hidden;
}

.install code {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font: 500 14px/1.5 var(--code);
  white-space: nowrap;
}

.install button {
  flex: none;
  min-width: 132px;
  border: 0;
  border-left: 1px solid var(--plate-edge);
  background: var(--ink);
  color: var(--enamel);
  font: 600 15px/1 "Onest", system-ui, sans-serif;
  cursor: pointer;
}

.install-note {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--pencil);
  font-size: 15px;
}

/* The meter: a faceplate with a window of drums, the one thing that moves. */
.meter {
  justify-self: start;
  width: 100%;
  max-width: 520px;
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--plate-edge);
  border-radius: 18px;
  background: var(--plate);
}

.meter-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--pencil);
  font-size: 15px;
}

.meter-name strong {
  color: var(--ink);
  font-weight: 700;
}

.drums {
  display: flex;
  gap: 4px;
  width: fit-content;
  padding: 8px;
  border-radius: 10px;
  background: var(--window);
  font: 700 clamp(50px, 7.4vw, 84px) / 1 var(--digits);
  font-variant-numeric: tabular-nums;
}

.drum {
  position: relative;
  width: 0.62em;
  height: 1.12em;
  overflow: hidden;
  border-radius: 4px;
  background: var(--drum);
  color: var(--drum-ink);
}

.drum.tenths {
  margin-left: 6px;
  background: var(--tenths);
}

/* Light falls on the middle of a drum; its top and bottom turn away into the dark. */
.drum::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

/* Three turns of digits, one per line: the strip is too narrow for two. */
.strip {
  display: block;
  width: 100%;
  padding-top: 0.1em;
  line-height: 1.12em;
  text-align: center;
  word-break: break-all;
  transform: translateY(calc(var(--to) * -1.12em));
  animation: roll var(--turn, 1.4s) cubic-bezier(0.2, 0.7, 0.15, 1) both;
}

@keyframes roll {
  from {
    transform: translateY(0);
  }
}

.meter-reading {
  margin: 16px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.gauge {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin: 12px 0 8px;
}

.gauge span {
  height: 12px;
  border-radius: 2px;
  background: var(--ink);
}

.gauge span.empty {
  background: var(--plate-edge);
}

.meter-note {
  margin: 0;
  color: var(--pencil);
  font-size: 15px;
}

.meter-print {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--plate-edge);
  color: var(--pencil);
  font-size: 13px;
  line-height: 1.45;
}

/* Sections below the hero, each under a hairline. */
.section {
  padding-block: 64px;
  border-top: 1px solid var(--rule);
}

.section h2 {
  max-width: 22ch;
  margin: 0 0 28px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.section h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
}

.section p {
  max-width: 60ch;
}

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

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

.facts li {
  padding-block: 18px;
  border-top: 1px solid var(--rule);
}

.facts li:first-child {
  padding-top: 0;
  border-top: 0;
}

.facts p {
  margin: 0;
  color: var(--pencil);
}

.screenshot {
  margin: 0;
  border: 1px solid var(--plate-edge);
  border-radius: 14px;
  background: var(--plate);
  overflow: hidden;
  box-shadow: 0 32px 64px -36px var(--shot-shadow);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

/* The steps of joining a team are a real sequence, so they are numbered on drums. */
.steps {
  display: grid;
  gap: 20px;
  margin: 0 0 28px;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  padding-top: 3px;
  border-radius: 4px;
  background: var(--drum);
  color: var(--drum-ink);
  font: 700 24px/1 var(--digits);
}

.steps p {
  margin: 0;
}

.note {
  color: var(--pencil);
}

.ledger .split {
  margin-top: 32px;
}

.ledger ul {
  margin: 0;
  padding-left: 1.1em;
}

.ledger li + li {
  margin-top: 6px;
}

.ledger li::marker {
  color: var(--pencil);
}

.ledger .never li::marker {
  color: var(--tenths);
}

/* The footer: where the code lives and whose project this is. */
.site-footer {
  padding-block: 28px 48px;
  border-top: 1px solid var(--rule);
  color: var(--pencil);
  font-size: 15px;
}

.site-footer .bar {
  flex-wrap: wrap;
  align-items: baseline;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer p {
  margin: 0;
}

/* /privacy and /terms */
.doc {
  max-width: 720px;
  padding-block: 48px 72px;
}

.doc h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.doc h2 {
  margin: 36px 0 10px;
  font-size: 22px;
}

.doc li + li {
  margin-top: 6px;
}

.muted {
  color: var(--pencil);
}

@media (min-width: 920px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 64px;
    padding-block: 88px 104px;
  }

  .meter {
    justify-self: end;
  }

  .section {
    padding-block: 88px;
  }

  .split {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 64px;
    align-items: start;
  }

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

@media (prefers-reduced-motion: reduce) {
  .strip {
    animation: none;
  }
}

.doc code {
  font: 500 0.9em/1 var(--code);
}
