@font-face {
  font-family: "Anybody";
  src: url("fonts/anybody-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-next-latin-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;

  --page: #eeeef9;
  --sheet: #fbfbff;
  --ink: #1e1a4f;
  --muted: #514d7d;
  --line: #cbcae6;

  /* The dark panels: the channel in the hero and the "doesn't do" band. */
  --panel: #1e1a4f;
  --panel-ink: #f1f1fc;
  --panel-muted: #bdbae0;
  --panel-line: #413c84;

  /* Highlighter colours mean the same thing everywhere: pink is a bug, yellow is feedback. */
  --mark-bug: #ff8fa8;
  --mark-feedback: #f6e94b;
  --on-mark: #1e1a4f;

  --todo-bg: #ffe27a;
  --todo-ink: #3b2f00;

  --display: "Anybody", "Arial Black", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Stops the elastic bounce that drags the page past the footer. Vertical only, so swipe-back still works. */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* Links in running text keep a thin underline, because colour alone wouldn't set them apart. */
a {
  color: inherit;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-stretch: 112%; text-wrap: balance; }

.wrap { width: min(70rem, 100% - 2.5rem); margin-inline: auto; }

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 800;
  text-decoration: none;
}

/* A highlighter stroke. It is a text background, so it wraps with the words. */
.mark {
  color: var(--on-mark);
  padding-inline: 0.15em;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.mark.bug { background-image: linear-gradient(var(--mark-bug), var(--mark-bug)); }
.mark.feedback { background-image: linear-gradient(var(--mark-feedback), var(--mark-feedback)); }

/* Landing page */
.hero { padding-block: 2.5rem 4.5rem; }
.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.5rem, 6.5vw, 4.625rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero-lead {
  max-width: 34rem;
  margin: 0 0 2.75rem;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.5;
}

.example { display: grid; margin: 0; }

.channel {
  padding: 1.25rem;
  background: var(--panel);
  color: var(--panel-ink);
  border-radius: 0.5rem;
}
.pane-title { margin: 0 0 0.75rem; font-weight: 700; }
.channel .pane-title { color: var(--panel-muted); }

.messages { margin: 0; padding: 0; list-style: none; }
.message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem 1rem;
  padding-block: 0.7rem;
  line-height: 1.45;
}
.message + .message { border-top: 1px solid var(--panel-line); }
.message-author { grid-column: 1; font-weight: 700; }
.message-kind { grid-column: 2; grid-row: 1; color: var(--panel-muted); font-size: 0.875rem; }
.message-text { grid-column: 1 / -1; margin: 0; }
.message.chatter .message-text { color: var(--panel-muted); }

/* The list lies across the channel, like a sheet of notes taken from it. */
.tally {
  position: relative;
  margin: -0.5rem 0.5rem 0;
  padding: 0.85rem;
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: 0.25rem;
}

.tally .pane-title { margin-bottom: 0.75rem; }

/* The dashboard's item table: a plain grid of hairlines, so the trends are what you look at. */
.items {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.items th, .items td {
  padding: 0.5rem 0.6rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: left;
  vertical-align: middle;
}
.items th:first-child { border-left: 1px solid var(--line); }
.items thead th {
  border-top: 1px solid var(--line);
  background: var(--page);
  color: var(--muted);
  font-size: 0.875rem;
}
.items thead th:first-child { border-top-left-radius: 0.5rem; }
.items thead th:last-child { border-top-right-radius: 0.5rem; }
.items tbody tr:last-child th { border-bottom-left-radius: 0.5rem; }
.items tbody tr:last-child td:last-child { border-bottom-right-radius: 0.5rem; }
.items .items-count { width: 1%; font-variant-numeric: tabular-nums; text-align: right; }
.items td.items-trend { width: 34%; padding-block: 0.3rem; }
.item-kind { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 55.99rem) {
  /* A phone leaves little room, so the item titles get what the other columns can spare. */
  .items th, .items td { padding-inline: 0.45rem; }
  .items td.items-trend { width: 24%; }
}

/* The dashboard's sparkline. Each row scales to its own peak over a zero baseline. */
.trend { position: relative; display: block; min-width: 4.25rem; height: 2rem; }
.trend svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trend path { fill: none; vector-effect: non-scaling-stroke; }
.trend-base { stroke: var(--line); stroke-width: 1; }
.trend-line { stroke: var(--ink); stroke-width: 1.25; }
.trend:hover .trend-line { stroke-width: 2; }

/* No script: narrow slices take the pointer, so the hairline follows it across the chart.
   Each slice holds the count of its nearest day, shown in the corner as on the dashboard. */
.trend-hits { position: absolute; inset: 0; display: flex; }
.trend-hits i { flex: 1; }
.trend-hits i:hover {
  background: linear-gradient(var(--muted), var(--muted)) center / 1px 100% no-repeat;
}
.trend-hits i:hover::after {
  content: attr(data-day);
  position: absolute;
  top: -0.2rem;
  left: -0.15rem;
  padding-inline: 0.15rem;
  background: var(--sheet);
  color: var(--ink);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
}
/* iOS only reports hover on a tap for elements it thinks are clickable. */
@media (hover: none) { .trend-hits i { cursor: pointer; } }

.example figcaption { margin-top: 0.85rem; color: var(--muted); font-size: 0.875rem; }

@media (min-width: 56rem) {
  /* The intro sits beside the channel, above the sheet. */
  .hero { display: grid; grid-template-columns: 7fr 5fr; }
  .hero h1 { grid-column: 1 / -1; margin-bottom: 2.5rem; }
  .hero-lead { position: relative; z-index: 1; grid-column: 2; grid-row: 2; align-self: start; margin: 0 0 0 2.5rem; }
  .example { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 7fr 5fr; }
  .channel { grid-column: 1; grid-row: 1; padding: 1.75rem 7rem 2rem 1.75rem; }
  .tally { grid-column: 2; grid-row: 1; align-self: end; margin: 12rem 0 -1.5rem -5rem; padding: 1.5rem; }
  .example figcaption { grid-column: 1; margin-top: 0.85rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .message .mark { animation: stroke 0.5s ease-out both; animation-delay: var(--at); }
  /* Item names show from the start. Each row's tag is struck at the same moment as its
     highlight in the channel, and its count and trend arrive with it. */
  .item .item-kind { animation: tag 0.5s ease-out both; animation-delay: var(--at); }
  .item .items-count { animation: count-in 0.4s ease-out both; animation-delay: var(--at); }
  .item .trend { animation: arrive 0.4s ease-out both; animation-delay: var(--at); }
  @keyframes count-in { from { color: transparent; } }
  /* The text colour flips once the stroke has nearly finished. Fading would pass through an
     unreadable grey, and flipping sooner would hide the words the stroke hasn't reached. */
  @keyframes stroke {
    from { background-size: 0% 100%; color: var(--panel-ink); }
    79% { color: var(--panel-ink); }
    80% { color: var(--on-mark); }
  }
  /* The tag keeps its space but stays hidden until the stroke reaches it. */
  @keyframes tag {
    from { background-size: 0% 100%; color: transparent; }
    79% { color: transparent; }
    80% { color: var(--on-mark); }
  }
  @keyframes arrive { from { opacity: 0; transform: translateY(0.4rem); } }
}

.how { padding-block: 3rem 5rem; }
.how h2 { margin: 0 0 2.25rem; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }

.steps {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}
.steps h3 { margin: 0 0 0.4rem; font-family: var(--body); font-size: 1.25rem; font-stretch: normal; font-weight: 700; line-height: 1.25; }
.steps p { margin: 0; color: var(--muted); }
.steps .mark { font-weight: 600; white-space: nowrap; }
@media (min-width: 56rem) {
  /* Each step starts lower than the last, so the sequence reads downhill. */
  .steps { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
  .steps li:nth-child(2) { margin-top: 2.5rem; }
  .steps li:nth-child(3) { margin-top: 5rem; }
}

.site-footer {
  padding-block: 1.75rem;
  background: var(--panel);
  color: var(--panel-ink);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 2rem;
}
.site-footer .brand { color: inherit; }
.footer-link {
  padding-block: 0.25rem;
  color: var(--panel-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}
.footer-link:hover { color: var(--panel-ink); }

/* Privacy policy */
.policy-page { padding-block: 1.5rem 4.5rem; }
.policy-head { margin-bottom: 2.5rem; }
.policy-head h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.5rem, 7.6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.updated { margin: 0; color: var(--muted); }

.contents { margin-bottom: 2.5rem; }
.contents-title { margin: 0 0 0.75rem; font-weight: 700; }
.contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
  line-height: 1.35;
}
/* Whole rows on a rail, so the list reads as navigation rather than a stack of links. */
.contents a {
  display: block;
  margin-left: -2px;
  padding: 0.4rem 0 0.4rem 1rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.contents a:hover { border-left-color: var(--ink); color: var(--ink); }

.policy { max-width: 42rem; min-width: 0; }
.policy h2 {
  margin: 2.75rem 0 0.6rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.005em;
  scroll-margin-top: 1.5rem;
}
.policy p { margin: 0 0 0.9rem; }
.policy ul { margin: 0 0 0.9rem; padding-left: 1.25rem; }
.policy li { margin-bottom: 0.35rem; }
.lead { font-size: 1.25rem; line-height: 1.5; }

@media (min-width: 56rem) {
  .policy-layout {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 42rem);
    gap: 4rem;
    align-items: start;
  }
  .contents { position: sticky; top: 1.5rem; margin-bottom: 0; font-size: 0.9375rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Details still to fill in before publishing. Remove with the placeholders. */
.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  padding: 0 0.25em;
  border-radius: 0.2em;
  font-weight: 600;
}
