/* Paw's site: one stylesheet, no build step.
   Dim, muted, readable without telling hues apart: meaning comes from
   brightness, weight and shape. The only colour is Loki's own ginger. */

/* ---- tokens ------------------------------------------------------- */
:root {
  color-scheme: dark;

  --bg: #0f1012;
  --panel: #141518;
  --raised: #1b1c20;
  --mine: #2a2c32;
  --line: #26282d;
  --line-strong: #3a3d44;
  --text: #d3d4d7;
  --dim: #9a9da4;
  --faint: #8a8d94;
  --bright: #f3f3f4;
  --mark: #cbb98f;
  --ginger: #e0903d;
  --ginger-dark: #7a3f12;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Type scale: a fluid step from phone to desktop. */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --t-2xl: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  --t-3xl: clamp(2.4rem, 1.5rem + 4vw, 4.25rem);
  --t-display: clamp(2.7rem, 1.4rem + 6vw, 5.6rem);

  /* Spacing: a 4px base, doubling from the middle. */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 5rem;
  --s-9: 8rem;

  --radius: 10px;
  --radius-lg: 18px;
  --bubble: 18px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --wide: 1200px;
  --narrow: 720px;
  --header: 64px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1rem);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font: var(--t-base) / 1.6 var(--font);
  overflow-x: clip;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--bright);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

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

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--bright);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

code {
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--bright);
}

pre {
  margin: 0;
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  font: 0.875rem / 1.6 var(--mono);
  color: var(--bright);
}

pre code {
  padding: 0;
  border: 0;
  background: none;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.1em 0.5em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--raised);
  color: var(--bright);
  text-align: center;
}

.skip {
  position: fixed;
  left: var(--s-3);
  top: -4rem;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius);
  background: var(--bright);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s;
}

.skip:focus {
  top: var(--s-3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- the doodle wallpaper ------------------------------------------ */
/* The same line drawings as the chat background in the app, fixed behind
   the page and drifting a little as you scroll. Texture, never content. */
.wallpaper {
  position: fixed;
  inset: -15% 0;
  z-index: -1;
  pointer-events: none;
  background: url("../img/doodles.svg") repeat;
  background-size: 700px 700px;
  opacity: 0.9;
  transform: translate3d(0, calc(var(--scroll, 0) * -0.06px), 0);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

/* ---- layout -------------------------------------------------------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2 * var(--gutter), var(--narrow));
  margin-inline: auto;
}

section {
  position: relative;
}

.band {
  padding-block: var(--s-8);
}

.band-tight {
  padding-block: var(--s-7);
}

.band-panel {
  background: linear-gradient(to bottom, var(--panel), var(--bg));
  border-block: 1px solid var(--line);
}

.stack > * + * {
  margin-top: var(--s-4);
}

.center {
  text-align: center;
  margin-inline: auto;
}

/* ---- header -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  border-bottom: 1px solid transparent;
  background: rgba(15, 16, 18, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: border-color 0.2s;
}

.site-header[data-scrolled] {
  border-bottom-color: var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--s-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--bright);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand svg {
  width: 30px;
  height: 30px;
  transition: transform 0.3s var(--ease);
}

.brand:hover svg {
  transform: rotate(-12deg) scale(1.08);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav a {
  padding: var(--s-2) var(--s-3);
  border-radius: 999px;
  color: var(--dim);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--bright);
  background: var(--raised);
}

.nav a[aria-current="page"] {
  color: var(--bright);
  box-shadow: inset 0 -2px 0 var(--bright);
  border-radius: 0;
}

.nav .btn {
  min-height: 38px;
  margin-left: var(--s-2);
  padding: 0 var(--s-4);
  font-size: var(--t-sm);
  color: var(--bg);
}

/* ---- buttons ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--raised);
  color: var(--bright);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    background 0.2s,
    border-color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--faint);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--bright);
  border-color: var(--bright);
  color: var(--bg);
}

.btn-primary:hover {
  background: #fff;
  border-color: #fff;
}

.btn-quiet {
  background: transparent;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.note {
  color: var(--faint);
  font-size: var(--t-sm);
}

/* ---- type helpers -------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  color: var(--dim);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--mark);
}

.display {
  font-size: var(--t-display);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.h1 {
  font-size: var(--t-3xl);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.h2 {
  font-size: var(--t-2xl);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.h3 {
  font-size: var(--t-xl);
  font-weight: 700;
}

.lead {
  color: var(--dim);
  font-size: var(--t-lg);
  line-height: 1.55;
  max-width: 38em;
}

.lead strong,
.lead b {
  color: var(--bright);
  font-weight: 600;
}

.mark {
  background: linear-gradient(
    to top,
    rgba(203, 185, 143, 0.5) 0.14em,
    transparent 0.14em
  );
  color: var(--bright);
}

/* ---- the window frame around demos and screenshots ------------------ */
.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 30px 80px -20px rgba(0, 0, 0, 0.8),
    0 8px 20px -8px rgba(0, 0, 0, 0.6);
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: 38px;
  padding-inline: var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}

/* Three neutral dots, differing in size, not hue. */
.frame-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.frame-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.frame-dots i:nth-child(2) {
  width: 8px;
  height: 8px;
}

.frame-dots i:nth-child(3) {
  width: 6px;
  height: 6px;
}

.frame-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: var(--t-xs);
  text-align: center;
  padding-right: 36px;
}

.frame img {
  width: 100%;
}

.frame-phone {
  width: min(100%, 300px);
  margin-inline: auto;
  border: 7px solid var(--line-strong);
  border-radius: 38px;
  background: #000;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: var(--s-3);
  color: var(--faint);
  font-size: var(--t-sm);
  text-align: center;
}

/* ---- demo slots ---------------------------------------------------- */
/* A demo is an element the demo module mounts into. Until it has, the
   placeholder box holds its place at the same size, so nothing jumps. */
.demo {
  position: relative;
  width: 100%;
  min-height: var(--h, 500px);
}

.demo[data-ready] {
  min-height: 0;
}

.demo-hold {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: var(--s-2);
  padding: var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 14px,
      rgba(255, 255, 255, 0.02) 14px 15px
    ),
    var(--panel);
  color: var(--faint);
  font-size: var(--t-sm);
  text-align: center;
}

.demo-hold b {
  color: var(--dim);
  font-family: var(--mono);
  font-weight: 600;
}

.demo[data-ready] .demo-hold {
  display: none;
}

.demo-note {
  margin-top: var(--s-3);
  color: var(--faint);
  font-size: var(--t-sm);
  text-align: center;
}

/* ---- chat bubbles (Telegram look) ----------------------------------- */
.bubbles {
  display: grid;
  gap: var(--s-2);
}

.bubble {
  max-width: min(86%, 30em);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--bubble);
  background: var(--raised);
  border: 1px solid var(--line);
  font-size: var(--t-sm);
  line-height: 1.45;
}

.bubble small {
  display: block;
  margin-bottom: 2px;
  color: var(--dim);
  font-size: var(--t-xs);
  font-weight: 700;
}

.bubble.them {
  border-bottom-left-radius: 5px;
}

.bubble.me {
  justify-self: end;
  border-bottom-right-radius: 5px;
  background: var(--mine);
  border-color: var(--line-strong);
}

/* ---- avatars: initials, a ring for work ----------------------------- */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--line-strong);
  color: var(--bright);
  font-size: 0.85rem;
  font-weight: 800;
}

.avatar.working {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--dim);
}

.avatar.waiting {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--mark);
}

/* ---- the ticker ------------------------------------------------------ */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--panel);
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: var(--s-6);
  padding-block: var(--s-4);
  animation: ticker 60s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-6);
  color: var(--dim);
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
}

.ticker-track span::after {
  content: "";
  width: 8px;
  height: 8px;
  border: 2px solid var(--line-strong);
  border-radius: 2px;
  transform: rotate(45deg);
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

/* ---- feature rows ---------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-7);
  align-items: center;
  padding-block: var(--s-8);
}

.feature + .feature {
  border-top: 1px solid var(--line);
}

.feature.flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.feature.flip .feature-copy {
  order: 2;
}

.feature-copy > * + * {
  margin-top: var(--s-4);
}

.feature-num {
  display: block;
  margin-bottom: var(--s-3);
  color: var(--line-strong);
  font-size: var(--t-3xl);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.feature-copy .ticks {
  margin-top: var(--s-5);
}

.ticks {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: var(--s-5);
  color: var(--text);
}

/* A drawn check: shape carries it, not a colour. */
.ticks li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.48em;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--mark);
  border-bottom: 2px solid var(--mark);
  transform: rotate(-45deg);
}

.link-arrow {
  display: inline-flex;
  gap: var(--s-2);
  font-weight: 700;
  text-decoration: none;
}

.link-arrow::after {
  content: "\2192";
  transition: transform 0.2s var(--ease);
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* ---- cards ---------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--s-4);
}

.card {
  position: relative;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  transition:
    transform 0.25s var(--ease),
    border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.card h3 {
  margin-bottom: var(--s-2);
  font-size: var(--t-lg);
}

.card p {
  color: var(--dim);
  font-size: var(--t-sm);
}

.card .ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--raised);
  color: var(--bright);
}

.card .ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- numbers --------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--s-5);
}

.stat b {
  display: block;
  color: var(--bright);
  font-size: var(--t-2xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: var(--s-2);
  color: var(--dim);
  font-size: var(--t-sm);
}

/* ---- steps ----------------------------------------------------------- */
.steps {
  display: grid;
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  min-width: 0;
  position: relative;
  padding-left: calc(var(--s-7) + var(--s-2));
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  color: var(--bright);
  font-weight: 800;
}

.steps h3 {
  margin-bottom: var(--s-1);
  font-size: var(--t-lg);
}

.steps p {
  color: var(--dim);
}

/* ---- callouts, faq --------------------------------------------------- */
.callout {
  padding: var(--s-5);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--mark);
  border-radius: var(--radius);
  background: var(--panel);
}

.callout h2,
.callout h3 {
  margin-bottom: var(--s-2);
  font-size: var(--t-lg);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: var(--s-4) var(--s-6) var(--s-4) 0;
  color: var(--bright);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: var(--s-3);
  color: var(--dim);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details > p {
  padding-bottom: var(--s-4);
  color: var(--dim);
}

/* ---- the table of what is open to whom ------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

th,
td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--dim);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

/* Yes and no by shape and word, not by colour. */
.yes::before,
.no::before {
  display: inline-block;
  width: 1.4em;
  font-weight: 800;
}

.yes::before {
  content: "\2713";
}

.no::before {
  content: "\2715";
  color: var(--faint);
}

.no {
  color: var(--dim);
}

/* ---- Loki ------------------------------------------------------------ */
.loki {
  display: block;
  width: var(--size, 120px);
  height: auto;
  overflow: visible;
}

.loki .eye {
  transition: transform 0.08s linear;
}

.loki .tail {
  transform-origin: 20px 24px;
}

.loki-say {
  position: relative;
  max-width: 22em;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--bubble);
  border-bottom-left-radius: 5px;
  background: var(--raised);
  color: var(--bright);
  font-size: var(--t-sm);
}

.loki-say small {
  display: block;
  margin-bottom: 2px;
  color: var(--ginger);
  font-weight: 800;
}

/* Loki, a visitor from the bottom edge of the page. */
.loki-peek {
  position: fixed;
  right: var(--s-4);
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
  max-width: calc(100vw - 2rem);
  transform: translateY(110%);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}

.loki-peek[data-show] {
  transform: translateY(0);
  pointer-events: auto;
}

.loki-peek .loki-say {
  margin-bottom: var(--s-6);
}

.loki-peek button {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--dim);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.loki-peek button:hover {
  color: var(--bright);
}

/* ---- the layouts, drawn in CSS --------------------------------------- */
.tiles {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  aspect-ratio: 16 / 10;
}

.tiles > i {
  display: grid;
  place-items: center;
  min-height: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--raised);
  color: var(--dim);
  font-size: var(--t-xs);
  font-style: normal;
  font-weight: 700;
}

/* ---- footer ---------------------------------------------------------- */
.site-footer {
  margin-top: var(--s-8);
  padding-block: var(--s-7) var(--s-6);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
}

.footer-grid h2 {
  margin-bottom: var(--s-3);
  color: var(--dim);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-grid ul {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid a {
  color: var(--text);
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--bright);
  text-decoration: underline;
}

.footer-brand p {
  margin-top: var(--s-3);
  max-width: 24em;
  color: var(--dim);
  font-size: var(--t-sm);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: var(--t-sm);
}

/* ---- scroll reveal ---------------------------------------------------- */
/* Without script everything is simply there. With it, things arrive. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .reveal-left {
  transform: translateX(-36px);
}

.js .reveal-right {
  transform: translateX(36px);
}

.js .reveal-scale {
  transform: scale(0.94);
}

/* ---- page specific: hero ---------------------------------------------- */
.hero {
  padding-block: var(--s-8) var(--s-7);
  overflow: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: var(--s-7);
  align-items: center;
}

.hero h1 {
  margin-bottom: var(--s-5);
}

.hero .lead {
  margin-bottom: var(--s-6);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
}

.hero-facts li {
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--dim);
  font-size: var(--t-xs);
  font-weight: 600;
}

.hero-stage {
  position: relative;
}

.hero-stage .loki-wrap {
  position: absolute;
  top: -66px;
  right: 28px;
  z-index: 3;
}

.page-head {
  padding-block: var(--s-8) var(--s-6);
}

.page-head .lead {
  margin-top: var(--s-4);
}

/* A full-width quote of the feel of a chat, set big. */
.pull {
  font-size: var(--t-2xl);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--bright);
  text-wrap: balance;
}

/* The features page: a table of contents beside the groups. */
.with-toc {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: var(--s-7);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header) + var(--s-5));
  display: grid;
  gap: 2px;
}

.toc a {
  padding: var(--s-2) var(--s-3);
  border-left: 2px solid var(--line);
  color: var(--dim);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
}

.toc a:hover {
  color: var(--bright);
}

.toc a[aria-current="true"] {
  border-left-color: var(--bright);
  color: var(--bright);
}

.group {
  padding-block: var(--s-7);
}

.group + .group {
  border-top: 1px solid var(--line);
}

.group > .h2 {
  margin-bottom: var(--s-3);
}

.group > .lead {
  margin-bottom: var(--s-6);
}

.group .frame,
.group figure {
  margin-top: var(--s-6);
}

.mini-list {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-5) 0 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  padding-left: var(--s-5);
  position: relative;
  color: var(--dim);
}

.mini-list li strong {
  color: var(--bright);
}

.mini-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border: 2px solid var(--faint);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* ---- the server story, in SVG ------------------------------------------ */
.diagram {
  width: 100%;
  height: auto;
}

.diagram text {
  fill: var(--text);
  font-family: var(--font);
  font-size: 15px;
}

.diagram .t-dim {
  fill: var(--dim);
  font-size: 13px;
}

.diagram .t-bold {
  fill: var(--bright);
  font-weight: 700;
}

.diagram .box {
  fill: var(--panel);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.diagram .box-strong {
  fill: var(--raised);
  stroke: var(--bright);
  stroke-width: 2;
}

.diagram .wire {
  fill: none;
  stroke: var(--bright);
  stroke-width: 2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}

.diagram .wire-off {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.5;
  stroke-dasharray: 5 6;
}

.js .diagram .wire {
  animation: flow 1.2s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -18;
  }
}

.zzz {
  animation: zzz 3s ease-in-out infinite;
}

@keyframes zzz {
  50% {
    transform: translateY(-5px);
    opacity: 0.55;
  }
}

/* ---- 404 --------------------------------------------------------------- */
.lost {
  display: grid;
  min-height: calc(100vh - var(--header) - 12rem);
  place-items: center;
  padding-block: var(--s-8);
  text-align: center;
}

.lost .table {
  position: relative;
  width: min(100%, 420px);
  margin: var(--s-6) auto 0;
}

.lost .knocked {
  animation: knock 2.4s var(--ease) 0.4s both;
  transform-origin: 50% 100%;
}

@keyframes knock {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  35% {
    transform: translate(10px, -2px) rotate(8deg);
  }
  100% {
    transform: translate(46px, 70px) rotate(78deg);
  }
}

/* ---- small layouts used by one page each -------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-7);
  align-items: center;
}

.loki-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-7);
  align-items: center;
}

.loki-big {
  justify-self: center;
}

.poke {
  display: flex;
  align-items: flex-end;
  gap: var(--s-3);
}

.poke-btn {
  padding: var(--s-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

.poke-btn:hover {
  transform: rotate(-4deg) scale(1.05);
}

.poke-btn:active {
  transform: scale(0.95);
}

.phones {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--s-5);
}

.phones .frame-phone {
  width: min(46%, 270px);
  margin: 0;
}

.phones .frame-phone:nth-child(2) {
  margin-top: var(--s-7);
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .js .reveal-left,
  .js .reveal-right {
    transform: translateY(28px);
  }

  .hero-grid,
  .two-col,
  .loki-grid,
  .feature,
  .feature.flip,
  .with-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature,
  .feature.flip {
    gap: var(--s-6);
    padding-block: var(--s-7);
  }

  .feature.flip .feature-copy {
    order: 0;
  }

  .hero {
    padding-top: var(--s-7);
  }

  .hero-stage {
    margin-top: var(--s-6);
  }

  .hero-stage .loki-wrap {
    top: -60px;
    right: 14px;
  }

  .toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
  }

  .toc a {
    border: 1px solid var(--line-strong);
    border-radius: 999px;
  }

  .toc a[aria-current="true"] {
    background: var(--bright);
    color: var(--bg);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  :root {
    --header: 58px;
  }

  .band {
    padding-block: var(--s-7);
  }

  .nav a {
    padding-inline: var(--s-2);
  }

  .nav .btn {
    margin-left: 0;
    padding-inline: var(--s-3);
  }

  .brand span {
    display: none;
  }

  .loki-peek .loki-say {
    display: none;
  }
}

/* Reduced motion lives in reduced.css, which the pages load only for people
   who ask for it. */

/* ---- FAQ and question lists ----------------------------------------- */
.faq-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: 0 0 var(--s-6);
  padding: 0;
  list-style: none;
}

.faq-links a {
  color: var(--text);
}

.qa {
  display: grid;
  gap: var(--s-6);
}

.qa-item {
  scroll-margin-top: calc(var(--header) + var(--s-5));
}

.qa-item h3 {
  margin-bottom: var(--s-2);
  color: var(--bright);
  font-size: var(--t-lg);
}

.qa-item p {
  color: var(--text);
}
