/* One stylesheet for every page. Tokens first: the brand pass changes these, not the rules below. */
:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --surface: #fffdf8;
  --text: #1d1b17;
  --muted: #5f5a50;
  --line: #e2ddd2;
  --accent: #0f6b52;
  --accent-text: #ffffff;
  --accent-soft: #dcefe7;
  --code-bg: #1f1d19;
  --code-text: #ece7dc;
  --focus: #2f8f71;
  --radius: 10px;
  --wrap: 72rem;
  --font: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', 'Noto Sans', Tahoma, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141310;
    --surface: #1b1a16;
    --text: #ece7dc;
    --muted: #a59f92;
    --line: #2f2d27;
    --accent: #5cc3a0;
    --accent-text: #0d1411;
    --accent-soft: #1d3029;
    --code-bg: #0e0d0b;
    --code-text: #e4dfd3;
    --focus: #7fd6b8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.8;
  touch-action: manipulation;
}

:lang(en) {
  line-height: 1.65;
}

h1,
h2,
h3 {
  line-height: 1.3;
  text-wrap: balance;
  scroll-margin-top: 1.5rem;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.45rem;
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

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

code,
pre {
  font-family: var(--mono);
  font-size: 0.88em;
}

:not(pre) > code {
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  direction: ltr;
  text-align: left;
  margin: 0.75rem 0 1.25rem;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Hidden above the page until focused: no inline offset, so no sideways overflow in either direction. */
.skip {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transform: translateY(-300%);
}

.skip:focus {
  transform: none;
}

/* Header and footer */
.site-header {
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.bar nav a {
  color: var(--muted);
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--text);
}

/* Sign out is a form post that reads like the menu's links. */
.signout {
  display: inline;
  margin: 0;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.link-button:hover {
  color: var(--text);
}

.account {
  padding-block: 2rem 3rem;
}

.account section {
  margin-top: 2rem;
}

/* The key page: the new key, the first steps and the live keys. */
.new-key {
  padding: 1rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}

.new-key code {
  overflow-wrap: anywhere;
}

.steps li,
.keys li {
  margin-block: 0.5rem;
}

.steps .done {
  color: var(--muted);
}

.keys {
  list-style: none;
  padding-inline-start: 0;
}

.keys li {
  display: grid;
  gap: 0.3rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.revoke summary {
  color: var(--accent);
  cursor: pointer;
}

/* Radio choices: the inputs keep their own size. */
.choices {
  display: grid;
  gap: 0.5rem;
  border: 0;
  margin: 0;
  padding: 0;
}

.choices legend {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.choice input {
  width: auto;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-bottom: 1rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* Landing */
.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: 3rem 2rem;
  align-items: start;
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.lead {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 62ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.65rem 1.2rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button.ghost {
  background: transparent;
  color: var(--accent);
}

.sample {
  margin: 0;
  min-width: 0;
}

.sample figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.section {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}

.shelves {
  margin: 0;
}

.shelves > div {
  display: grid;
  gap: 0.25rem 2rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.shelves > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.shelves dt {
  font-weight: 700;
}

.shelves dd {
  margin: 0;
  color: var(--muted);
  max-width: 68ch;
}

.shelves dd ul {
  margin: 0;
  padding-inline-start: 1.1rem;
}

.shelves dd li + li {
  margin-top: 0.5rem;
}

.shelves strong {
  color: var(--text);
}

.shelves .coming {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}

/* Sections not open yet sit back, so the open ones lead. */
.shelves .later dt {
  font-weight: 600;
  color: var(--muted);
}

.status {
  display: inline-block;
  margin-inline-start: 0.5rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.status.open {
  border-color: var(--accent);
  color: var(--accent);
}

.columns {
  display: grid;
  gap: 2rem;
}

.columns > div {
  min-width: 0;
}

.plain {
  padding-inline-start: 1.1rem;
}

.plain li {
  margin-block: 0.4rem;
}

/* Forms */
.form {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  margin-top: 1.25rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label,
.field .label {
  font-weight: 600;
}

.field .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

input,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  width: 100%;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.form .consent {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

/* The honeypot field: present for bots, invisible and out of the tab order for people. */
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Documents: docs, terms, privacy, support, messages */
.doc {
  max-width: 50rem;
  padding-block: 2.5rem 1rem;
}

.doc h2 {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.doc .updated {
  color: var(--muted);
  margin-top: -0.5rem;
}

.doc ol,
.doc ul {
  padding-inline-start: 1.25rem;
}

.doc li {
  margin-block: 0.35rem;
}

.note {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-block: 1.25rem;
}

.note p {
  margin: 0;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
  margin-block: 1.5rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: start;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 700;
}

.entry {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.entry h3 {
  margin-top: 0.5rem;
}

.params {
  list-style: none;
  padding-inline-start: 0;
}

.params li {
  margin-block: 0.3rem;
}

.meta,
.tag {
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  white-space: nowrap;
}

/* Plans. The Monthly / Yearly switch is two radios before the cards; `:checked ~` shows one price (no script). */
.billing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-block: 1.5rem 0.5rem;
}

.billing input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.billing label {
  padding: 0.4rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.billing input:checked + label {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.billing input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.billing .yearly,
.billing .yearly-pick:checked ~ .plans .monthly {
  display: none;
}

.billing .yearly-pick:checked ~ .plans .yearly {
  display: inline;
}

.plans {
  flex-basis: 100%;
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.plan {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc .plan h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.1rem;
}

.plan p {
  margin: 0;
}

.plan .price {
  font-size: 1.3rem;
  font-weight: 700;
}

.plan .calls,
.plan .soon {
  color: var(--muted);
}

.plan .soon {
  font-weight: 600;
}

.plan .button {
  text-align: center;
}

/* Connect: the setup lines wrap on a phone, so nobody has to scroll sideways to see the whole address. */
.connect pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Connect: the address on its own line, easy to select whole. */
.address code {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  user-select: all;
  overflow-wrap: anywhere;
}

.legal section + section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--line);
}

.message {
  max-width: 40rem;
  padding-block: 4rem 2rem;
}

.message section + section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .wrap {
    padding-inline: 2rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 4rem;
    padding-block: 5rem 3.5rem;
  }

  .shelves > div {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }
}

@media (min-width: 600px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

/* Usage page: the month's meter and the calls by data. */
.meter {
  width: 100%;
  max-width: 32rem;
  height: 0.75rem;
  accent-color: var(--accent);
}
table.usage {
  border-collapse: collapse;
  width: 100%;
  max-width: 32rem;
}
table.usage th,
table.usage td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: normal;
}
table.usage th {
  text-align: start;
}
table.usage td {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
