/* Repz's website: one stylesheet, system fonts only, no third-party
   anything. Colours are docs/specs/design/tokens.json's (the app is dark,
   with lime); the light theme follows the reader's setting and keeps the
   same lime for marks, with dark text over it. */

:root {
  color-scheme: dark light;

  /* tokens.json, dark */
  --page: #000000;
  --app: #0a0a0a;
  --app-glow: #181818;
  --surface: #141414;
  --border: #212121;
  --border-strong: #2e2e2e;
  --text-primary: #f5f5f5;
  --text-body: #d4d4d4;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --lime: #ccff00;
  --lime-fill: rgba(204, 255, 0, 0.09);
  --lime-edge: rgba(204, 255, 0, 0.55);
  --on-lime: #0a0a0a;
  --link: #ccff00;
  --cyan: #00e5ff;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --measure: 40rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --page: #f5f5f5;
    --app: #fafafa;
    --app-glow: #ffffff;
    --surface: #ffffff;
    --border: #e5e5e5;
    --border-strong: #d4d4d4;
    --text-primary: #0a0a0a;
    --text-body: #1c1c1c;
    --text-secondary: #404040;
    --text-muted: #525252;
    --lime-fill: rgba(143, 179, 0, 0.12);
    --lime-edge: #8fb300;
    --link: #0a0a0a;
    --cyan: #00727f;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(420px circle at 20% 0%, var(--app-glow), transparent),
    var(--app);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.wrap {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header and footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.wordmark {
  color: var(--text-primary);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* The lime letter: Repz's z, Merakia's A. On light, lime type is too faint,
   so it's dark type on a lime block instead. */
.wordmark span, .accent { color: var(--lime); }

@media (prefers-color-scheme: light) {
  .wordmark span, .accent {
    color: var(--on-lime);
    background: var(--lime);
    padding: 0 0.15em;
    border-radius: 4px;
  }
}

.site-nav { display: flex; gap: 0.25rem; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-decoration: none;
}

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

.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--text-secondary); }

/* Type */

h1, h2, h3 {
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 8vw, 2.75rem); font-weight: 800; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.375rem; font-weight: 700; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.0625rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin: 0.35rem 0; }
li::marker { color: var(--text-muted); }

strong { color: var(--text-primary); font-weight: 650; }

a {
  color: var(--link);
  text-decoration-color: var(--lime-edge);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-color: currentColor; }

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

.kicker {
  margin: 0;
  color: var(--lime);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-color-scheme: light) {
  .kicker { color: var(--text-muted); }
}

.lede { color: var(--text-secondary); font-size: 1.125rem; }
.muted { color: var(--text-muted); }
.small { font-size: 0.9375rem; }

/* Pieces */

.card {
  margin: 1rem 0;
  padding: 1rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.card > :last-child { margin-bottom: 0; }

.card.signal {
  background: var(--lime-fill);
  border-color: var(--lime-edge);
}

.points {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0;
  display: grid;
  gap: 0.625rem;
}

.points li {
  margin: 0;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.points strong { display: block; }
.points span { color: var(--text-secondary); font-size: 0.9375rem; }

.store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: 14px;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
  text-decoration: none;
}

.store-button:hover { filter: brightness(1.05); }

/* Before the listing: the same shape, as a label rather than a link. */
.store-button.is-soon {
  background: var(--lime-fill);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--lime-edge);
}

.store-button.is-soon:hover { filter: none; }

.steps { padding-left: 1.5rem; }

.path {
  color: var(--text-primary);
  font-weight: 600;
}

.toc {
  columns: 2 12rem;
  column-gap: 1.5rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
}

.toc li { break-inside: avoid; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.5rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text-primary); font-weight: 650; }

@media (max-width: 30rem) {
  .site-nav a { padding: 0 0.6rem; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
  td { border: 0; padding: 0.15rem 0; }
  td:first-child { color: var(--text-primary); font-weight: 650; }
}

/* Merakia's page: each app is a card that links to its own pages. */

.app-link {
  display: block;
  margin: -0.875rem -1rem;
  padding: 0.875rem 1rem;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}

.app-link strong { color: var(--text-primary); font-size: 1.125rem; }
.app-link strong::after { content: " →"; color: var(--lime); }
.app-link:hover strong { text-decoration: underline; text-decoration-color: var(--lime-edge); }

@media (prefers-color-scheme: light) {
  .app-link strong::after { color: var(--text-muted); }
}
