/*
 * app.softii.business — the counter where a device gets its copy of SOFTII.
 *
 * Deliberately hand-written and dependency-free: this page is the thing a technician loads
 * on a cold 3G connection in a shop, so it ships as three files and no framework.
 */

@font-face {
  font-family: 'Volte';
  src: url('/fonts/Volte/Volte-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Volte';
  src: url('/fonts/Volte/Volte_Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat/Montserrat-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat/Montserrat-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #17161a;
  --counter: #222125;
  --line: #37343d;
  --salmon: #ed6a5a;
  --salmon-lit: #f18c7e;
  --bone: #f4f0ec;
  --mute: #948f9c;
  --gold: #f2a73b;

  --gutter: clamp(20px, 5vw, 56px);
  /* `ch` scales with the element's own font-size, so the shell is set in rem: the footer
     and the header must line up with the body copy, not shrink with their smaller type. */
  --shell: 47.5rem;
  --column: 64ch;

  --display: 'Volte', 'Trebuchet MS', sans-serif;
  --body: 'Montserrat', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  padding: 0 var(--gutter) 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 1rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main,
.bar,
.foot {
  max-width: var(--shell);
  margin-inline: auto;
}

a {
  color: var(--bone);
  text-decoration-color: color-mix(in srgb, var(--bone) 35%, transparent);
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: var(--salmon);
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  position: static;
  display: inline-block;
  padding: 8px 0;
}

/* ---------- bar ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 28px 0;
}

.bar__mark {
  height: 30px;
  width: auto;
}

.lang {
  display: flex;
  gap: 4px;
}

.lang__btn {
  border: 0;
  background: none;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--mute);
  font: 500 0.8125rem/1 var(--body);
  cursor: pointer;
}

.lang__btn[aria-pressed='true'] {
  background: var(--counter);
  color: var(--bone);
}

/* ---------- counter: the detection result ---------- */

.counter {
  position: relative;
  padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 7vw, 72px) clamp(20px, 4vw, 34px);
}

/* The one moment of motion on the page: the salmon rule draws down beside the answer. */
.counter::before {
  content: '';
  position: absolute;
  inset-block: clamp(48px, 9vw, 96px) clamp(40px, 7vw, 72px);
  left: 0;
  width: 3px;
  background: var(--salmon);
  transform-origin: top;
  animation: draw 620ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes draw {
  from {
    transform: scaleY(0);
  }
}

.counter__kicker {
  margin: 0 0 10px;
  color: var(--salmon);
  font: 500 0.875rem/1 var(--body);
  letter-spacing: 0.01em;
}

.counter__title {
  margin: 0;
  font: 600 clamp(2.25rem, 7.2vw, 3.5rem) / 1.04 var(--display);
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-wrap: balance;
}

.counter__detail {
  margin: 14px 0 0;
  max-width: var(--column);
  color: var(--mute);
}

.counter__act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 30px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 15px 26px;
  border-radius: 10px;
  font: 600 1rem/1 var(--display);
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn--primary {
  background: var(--salmon);
  color: #2a0f0b;
}

.btn--primary:hover {
  background: var(--salmon-lit);
}

.btn--quiet {
  border: 1px solid var(--line);
  color: var(--bone);
  padding: 11px 18px;
  font-size: 0.9375rem;
}

.btn--quiet:hover {
  border-color: var(--salmon);
}

.meta {
  margin: 0;
  color: var(--mute);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- notes about friction, stated before the click ---------- */

.note {
  margin: 22px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--line);
  max-width: var(--column);
  color: var(--mute);
  font-size: 0.9375rem;
}

.note--gold {
  border-left-color: var(--gold);
}

.note strong {
  color: var(--bone);
  font-weight: 500;
}

/* ---------- rack: the other platforms ---------- */

.rack,
.noplay,
.ask {
  border-top: 1px solid var(--line);
  padding-block: clamp(36px, 6vw, 60px);
}

.rack__title,
.noplay__title,
.ask__title {
  margin: 0 0 4px;
  font: 600 1.375rem/1.25 var(--display);
  letter-spacing: -0.01em;
}

.rack__list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.rack__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 18px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.rack__item:last-child {
  border-bottom: 0;
}

.rack__name {
  flex: 0 0 8.5rem;
  font: 600 1.0625rem/1.3 var(--display);
}

.rack__where {
  flex: 1 1 14ch;
  color: var(--mute);
  font-size: 0.9375rem;
}

.rack__item .btn,
.rack__pending {
  margin-left: auto;
}

/* A download with nothing published behind it: stated, not offered. */
.rack__pending {
  padding: 11px 0;
  color: var(--mute);
  font-size: 0.9375rem;
}

.btn--disabled {
  background: var(--counter);
  color: var(--mute);
  pointer-events: none;
}

/* ---------- no-play section ---------- */

.noplay__lead,
.ask dd {
  margin: 12px 0 0;
  max-width: var(--column);
  color: var(--mute);
}

.noplay__act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 26px;
}

.steps {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  max-width: var(--column);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 44px;
  color: var(--mute);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--bone);
  font: 600 0.875rem/1 var(--display);
}

.steps li:last-child {
  padding-bottom: 0;
}

.steps strong {
  display: block;
  color: var(--bone);
  font-weight: 500;
}

/* ---------- questions ---------- */

.ask__list {
  margin: 22px 0 0;
}

.ask dt {
  margin-top: 22px;
  font: 600 1rem/1.4 var(--display);
}

.ask dt:first-child {
  margin-top: 0;
}

.ask dd {
  margin-inline: 0;
  font-size: 0.9375rem;
}

/* ---------- foot ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 28px 44px;
  color: var(--mute);
  font-size: 0.875rem;
}

.foot__line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.foot__line--mute {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.foot a {
  color: var(--mute);
}

/* ---------- narrow ---------- */

@media (max-width: 560px) {
  .rack__name {
    flex-basis: 100%;
  }

  .rack__item .btn,
  .rack__pending {
    margin-left: 0;
  }

  .btn--primary {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .counter::before {
    animation: none;
  }
  * {
    transition-duration: 1ms !important;
  }
}
