/*
 * The sales page.
 *
 * One stylesheet, no build step, no framework. The palette is the app's, read
 * off src/styles.css and written here as plain custom properties rather than
 * shared — the two deploy separately and a shared file would mean the shop
 * could not ship without the app building.
 */

:root {
  --paper: oklch(98.5% 0.006 85);
  --ink: oklch(24% 0.02 260);
  --muted: oklch(52% 0.015 260);
  --line: oklch(90% 0.008 260);

  --brand: oklch(48% 0.12 210);
  --brand-soft: oklch(95% 0.03 210);

  --clear: oklch(52% 0.13 150);
  --clear-soft: oklch(96% 0.04 150);
  --stop: oklch(52% 0.18 25);
  --stop-soft: oklch(96% 0.04 25);

  --wrap: 60rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Tabular figures, as in the app: this is a product about dates and counts. */
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  /* A 16px gutter, so nothing touches the edge of a phone. */
  padding: 0 1rem;
}

/* ---------------------------------------------------------------- chrome -- */

.bar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, white 70%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.bar.footer {
  position: static;
  border-bottom: 0;
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  background: none;
  backdrop-filter: none;
}

.bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.mark {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
}

.bar-links a {
  color: var(--muted);
  text-decoration: none;
}

.bar-links a:hover {
  color: var(--ink);
}

/* ------------------------------------------------------------------ type -- */

h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  font-weight: 650;
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  font-weight: 620;
}

h3 {
  font-size: 0.9375rem;
  margin: 0 0 0.375rem;
  font-weight: 620;
}

p {
  margin: 0 0 1rem;
}

.quiet {
  color: var(--muted);
}

.small {
  font-size: 0.8125rem;
}

.lead {
  font-size: 1.0625rem;
  max-width: 44rem;
  color: var(--muted);
}

.wide {
  max-width: 44rem;
}

.footnote {
  font-size: 0.8125rem;
  color: var(--muted);
}

.center {
  text-align: center;
}

/* --------------------------------------------------------------- layout --- */

.hero {
  padding: clamp(3rem, 10vw, 6rem) 1rem clamp(2rem, 6vw, 3.5rem);
}

.band {
  padding: clamp(2rem, 6vw, 3.5rem) 1rem;
  border-top: 1px solid var(--line);
}

.grid {
  display: grid;
  gap: 1.75rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.grid p {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

/* -------------------------------------------------------------- controls -- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0.75rem;
}

.button {
  display: inline-block;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 0.625rem;
  padding: 0.625rem 1.125rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms;
}

.button:hover {
  background: color-mix(in oklch, var(--paper) 60%, white);
}

.button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.button.primary:hover {
  background: color-mix(in oklch, var(--ink) 90%, white);
}

.button[disabled] {
  opacity: 0.45;
  cursor: default;
}

.wide-button {
  width: 100%;
  text-align: center;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* ----------------------------------------------------------------- price -- */

.price-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 0.875rem;
  padding: 1.5rem;
  max-width: 34rem;
  margin: 2rem 0;
}

.price-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.price-name {
  font-weight: 620;
}

.price-sub {
  font-size: 0.8125rem;
  color: var(--muted);
}

.amount {
  font-size: 2.25rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.price-amount {
  text-align: right;
}

.once {
  color: var(--muted);
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

.price-tax {
  margin: 0.15rem 0 0;
  margin-left: auto;
  max-width: 12rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  font-size: 0.875rem;
}

.ticks li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.5rem;
  width: 0.4rem;
  height: 0.7rem;
  border: solid var(--clear);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* -------------------------------------------------------------- messages -- */

.problem {
  color: var(--stop);
  background: var(--stop-soft);
  border: 1px solid color-mix(in oklch, var(--stop) 30%, transparent);
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin: 1rem 0 0;
}

.good {
  color: var(--clear);
  background: var(--clear-soft);
  border: 1px solid color-mix(in oklch, var(--clear) 30%, transparent);
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin: 1rem 0 0;
}

/* ------------------------------------------------------------------- key -- */

.key-box {
  border: 1px solid var(--line);
  background: white;
  border-radius: 0.875rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.key {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.7;
  /* The whole point of this box: it must be selectable and it must wrap, or
     somebody copies two thirds of a licence key and blames the app. */
  word-break: break-all;
  user-select: all;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.875rem;
  margin: 0 0 1rem;
  display: block;
}

.steps {
  font-size: 0.875rem;
  color: var(--muted);
  padding-left: 1.25rem;
  margin: 0;
}

.steps li {
  margin-bottom: 0.375rem;
}

/* ----------------------------------------------------------------- forms -- */

.form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  max-width: 30rem;
}

.input {
  flex: 1 1 14rem;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  background: white;
  color: var(--ink);
}

.input:focus {
  border-color: var(--brand);
  outline: none;
}

.spinner {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 1rem 0 0;
}

/* ------------------------------------------------------------------- legal -- */

.doc h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.75rem;
}

.doc h2 {
  font-size: 1.125rem;
  margin-top: 2rem;
}

.doc p,
.doc li {
  max-width: 40rem;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li {
  margin-bottom: 0.5rem;
}

.doc .meta {
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: no-preference) {
  .spinner::after {
    content: "";
    display: inline-block;
    width: 0.5rem;
    animation: dots 1.2s steps(4, end) infinite;
  }

  @keyframes dots {
    0% {
      content: "";
    }
    25% {
      content: ".";
    }
    50% {
      content: "..";
    }
    75% {
      content: "...";
    }
  }
}
