/* Resties public site. Same look as the app (app/src/theme.ts): a plain white or
   near-black page, Hanken Grotesk for words, Barlow Condensed for the numbers of
   someone's day, and one cyan accent. The typefaces are served from this site
   (site/fonts, built by scripts/make-site-fonts.py), so the page asks nothing of any
   other company. */

@font-face {
  font-family: 'Hanken Grotesk';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-800.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-condensed-600.woff2') format('woff2');
}

:root {
  --bg: #ffffff;
  --surface: #f3f3f5;
  --band: #f0f0f2;
  --line: #e4e4e8;
  --text: #0e0e11;
  --muted: #676770;
  --accent: #0e7490;
  --accent-soft: #e0f5f9;
  --danger: #c4271a;
  /* One person's avatar colours, as in the app. */
  --tone-a-bg: #fce9e4;
  --tone-a-fg: #a3300f;
  --tone-b-bg: #e3eefd;
  --tone-b-fg: #1d4e9e;
  --words: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --figures: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --surface: #19191d;
    --band: #000000;
    --line: #2a2a30;
    --text: #f4f4f6;
    --muted: #a3a3ae;
    --accent: #22d3ee;
    --accent-soft: #0c2b32;
    --danger: #ff7a6e;
    --tone-a-bg: #3b1a11;
    --tone-a-fg: #ffb29f;
    --tone-b-bg: #14274a;
    --tone-b-fg: #a9c8ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--words);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

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

h1,
h2,
h3 {
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
}

p,
ul,
ol {
  margin: 0;
}

strong {
  font-weight: 600;
}

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

/* Header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.wordmark {
  display: inline-flex;
  color: var(--text);
  text-decoration: none;
}

/* The mark: the picture holds only the letter's outline, and the page colours it, so it
   follows light and dark mode. Made by scripts/make-logo.py. */
.logo {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  background: currentColor;
  -webkit-mask: url('/logo.png') center / contain no-repeat;
  mask: url('/logo.png') center / contain no-repeat;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 1rem;
}

.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

/* Hero: the sentence, and the feed as the app shows it */

.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem);
}

.hero h1 {
  font-size: clamp(2.5rem, 6.6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 15ch;
}

.hero .lede {
  margin-top: 1.5rem;
  max-width: 32rem;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 23.5rem;
    align-items: center;
    gap: 4rem;
  }
}

/* The feed. A piece of the app's screen: its header, then two friends' days with the
   app's band between them. Sizes are the app's own, in pixels, so this stays a picture
   of the app rather than part of the page's type scale. */

.shot {
  margin: 0;
}

.screen {
  max-width: 23.5rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg);
  font-size: 16px;
  line-height: 22px;
}

.screen-bar {
  display: flex;
  justify-content: center;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.screen-bar .logo {
  width: 28px;
  height: 28px;
}

.post {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

.post + .post {
  border-top: 8px solid var(--band);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tone-a-bg);
  color: var(--tone-a-fg);
  font-size: 15px;
  font-weight: 800;
}

.avatar.tone-b {
  background: var(--tone-b-bg);
  color: var(--tone-b-fg);
}

.post-who {
  flex: 1;
  min-width: 0;
  display: grid;
}

.post-who b {
  font-weight: 800;
}

.post-who span,
.form small,
.post-names {
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}

.icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.post-head .icon {
  color: var(--muted);
}

.form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.form .figure {
  font-size: 52px;
  line-height: 50px;
  color: var(--accent);
}

.form-words {
  display: grid;
  padding-bottom: 5px;
}

.form b {
  font-weight: 800;
}

.figure {
  font-family: var(--figures);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stats {
  display: flex;
  gap: 14px;
  list-style: none;
  padding: 0;
}

.stats li {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stats li + li {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.stats .figure {
  font-size: 28px;
  line-height: 30px;
  white-space: nowrap;
}

.stats .figure small {
  font-family: var(--words);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.stats .label,
.stats .note {
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.stats .label {
  font-weight: 600;
}

.stats .note {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
}

.trend {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* On the narrowest phones the three columns give up a little air, so "about usual"
   still fits on one line. */
@media (max-width: 22.5rem) {
  .stats {
    gap: 8px;
  }

  .stats li + li {
    padding-left: 8px;
  }

  .stats .note {
    font-size: 11px;
  }
}

.counted {
  color: var(--muted);
}

.counted b {
  font-weight: 600;
  color: var(--text);
}

.workout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.workout .icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.reactions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reactions .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding-inline: 12px;
  border-radius: 999px;
  background: var(--surface);
}

.reactions .chip b,
.reactions .comments b {
  font-size: 13px;
  font-weight: 800;
}

.reactions .comments {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.post-names {
  margin-top: -6px;
}

.shot figcaption {
  max-width: 23.5rem;
  margin-top: 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Sections: the heading in a left rail, the text beside it */

.section {
  display: grid;
  gap: 0.75rem;
  padding-block: clamp(2rem, 5vw, 3.25rem);
  border-top: 1px solid var(--line);
}

.section h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section .text {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
}

@media (min-width: 56rem) {
  .section {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 3rem;
  }
}

.section ul,
.section ol {
  display: grid;
  gap: 0.5rem;
  padding-inline-start: 1.25rem;
}

.section ul li::marker {
  color: var(--muted);
}

/* The steps are a real order, so each carries its number, set like a figure. */
.section ol.steps {
  list-style: none;
  counter-reset: step;
  gap: 0.75rem;
  padding: 0;
}

.section ol.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: baseline;
}

.section ol.steps li::before {
  content: counter(step);
  font-family: var(--figures);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1;
  color: var(--accent);
}

/* How a number compares with someone's usual: an arrow or an equals sign, always with
   the words beside it, so nothing depends on shape or colour. */
.section .legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.section .legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section .legend .trend {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

/* Footer */

.foot {
  display: grid;
  gap: 0.75rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.foot ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  padding: 0;
}

/* Privacy policy: one reading column */

.policy {
  max-width: 46rem;
  padding-block: clamp(1.5rem, 5vw, 3rem) clamp(3rem, 8vw, 5rem);
}

.policy h1 {
  font-size: clamp(2.125rem, 5.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.policy .updated {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.policy h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.policy p,
.policy ul,
.policy .table-scroll {
  margin-top: 1rem;
}

.policy ul {
  display: grid;
  gap: 0.4rem;
  padding-inline-start: 1.25rem;
}

.policy ul li::marker {
  color: var(--muted);
}

.policy .notice {
  margin: 0 0 1.75rem;
}

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

.table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.policy table.two-columns {
  min-width: 0;
}

.policy table.five-columns {
  min-width: 52rem;
}

.policy table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

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

.policy th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

/* Anything still to be filled in is loud on purpose. `npm run site:check` lists these. */

.notice {
  padding: 0.875rem 1rem;
  border: 1px solid var(--danger);
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--danger);
}

mark.blank {
  background: none;
  color: var(--danger);
  font-size: 0.9em;
  border-bottom: 2px dashed var(--danger);
}

/* Written but not yet true: underlined and followed by a visible marker, on every screen. */

[data-not-yet] {
  text-decoration: underline dotted var(--danger);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

[data-not-yet]::after {
  content: '(not yet in place)';
  display: inline-block; /* so the underline stops at the statement */
  margin-left: 0.3em;
  color: var(--danger);
  font-size: 0.9em;
  font-weight: 600;
}
