/* Aarni's website. Tokens are design/canvas/System.dc.html; the rules are
   design/UI_RULES.md. Ruled rows, one accent per side of the ledger, red
   only for late, no gradients and no shadows. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FBFAFC;
  --surface: #FFFFFF;
  --ink: #191622;
  --ink-2: #565064;
  --ink-3: #6A6379;
  --rule: #E6E2EE;
  --yours: #554697;
  --theirs: #2E6E74;
  --late: #A8392B;
  --done: #2C6B4C;
  --yours-wash: #EFECF8;
  --theirs-wash: #E5F0F0;
  --button: #191622;
  --on-button: #FBFAFC;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

/* The dark tokens, used by the whole page in dark mode and always by the
   bands that are dark on purpose (the opening, like the app's welcome). */
.dark {
  --paper: #121019;
  --surface: #1A1724;
  --ink: #EDEAF4;
  --ink-2: #ABA4BC;
  --ink-3: #9A93AD;
  --rule: #2A2538;
  --yours: #A897EC;
  --theirs: #6FB5BB;
  --late: #E28A79;
  --done: #6FC49A;
  --yours-wash: #2E2748;
  --theirs-wash: #17292B;
  --button: #EDE7DA;
  --on-button: #121019;
  --cream: #EDE7DA;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121019;
    --surface: #1A1724;
    --ink: #EDEAF4;
    --ink-2: #ABA4BC;
    --ink-3: #9A93AD;
    --rule: #2A2538;
    --yours: #A897EC;
    --theirs: #6FB5BB;
    --late: #E28A79;
    --done: #6FC49A;
    --yours-wash: #2E2748;
    --theirs-wash: #17292B;
    --button: #EDE7DA;
    --on-button: #121019;
    color-scheme: dark;
  }
  /* Two dark bands in a row would merge; the page's own paper sits one
     step lighter than the opening. */
  body { --paper: #16131F; }
}

@media (min-width: 640px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 48px; } }

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--yours); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--yours); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }

.serif { font-family: var(--serif); font-optical-sizing: auto; }

h1, h2, h3 { margin: 0; font-weight: 400; }

h1 {
  font-family: var(--serif);
  font-size: clamp(46px, 8vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

.lede { font-size: clamp(18px, 2.1vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

/* Top bar */

.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.bar nav { display: flex; gap: 20px; font-size: 15px; }
.bar nav a { color: var(--ink-2); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }
.bar nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
@media (max-width: 479px) { .bar nav { gap: 16px; } .bar nav .optional { display: none; } }

/* Buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  background: var(--button); color: var(--on-button);
  border-radius: 12px; font-weight: 600; font-size: 16px; text-decoration: none;
  transition: opacity .15s ease;
}
.button:hover { opacity: .88; }
.textlink { color: var(--ink); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; }
.textlink:hover { text-decoration: underline; }

/* The opening */

.dark { background: var(--paper); color: var(--ink); }
.dark .bar .brand { color: var(--cream); }
.opening h1, .pagehead h1 { color: var(--cream); }
.hero { display: grid; gap: 48px; padding: 40px 0 72px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; padding: 72px 0 112px; gap: 64px; } }
.hero .lede { margin: 24px 0 32px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.private { display: flex; gap: 12px; align-items: flex-start; margin: -8px 0 32px; padding: 14px 16px; max-width: 34em;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.private b { color: var(--cream, var(--ink)); font-weight: 600; }
.private svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--theirs); }
.assure { margin: 24px 0 0; color: var(--ink-3); font-size: 15px; }
.assure svg { width: 16px; height: 16px; flex: none; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack .row:nth-child(2) { margin-left: 5%; opacity: .78; }
.stack .row:nth-child(3) { margin-left: 10%; opacity: .5; }

/* The opening's list: rows from five places, ruled the way the app rules them. */

.ledger { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 8px 10px 4px; }
.ledger-head { display: flex; justify-content: space-between; gap: 12px; padding: 10px 8px 12px; font-size: 14px; font-weight: 600; }
.ledger-head .muted { font-weight: 400; }
.ledger .row { border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; padding: 14px 8px; min-height: 0; }
@media (max-width: 479px) { .ledger .extra { display: none; } }
.src { color: var(--ink-2); font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 10px; }

/* The loop row: the app's row, stripe for direction, red only when late. */

.row {
  --dir: var(--yours);
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; min-height: 64px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
}
.row.theirs { --dir: var(--theirs); }
.row::before { content: ""; flex: none; width: 3px; align-self: stretch; border-radius: 2px; background: var(--dir); }
.row .body { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.row .m { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }
.row .due { flex: none; font-size: 13.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.row .due.late { color: var(--late); }
.row .settle { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--done); margin-top: 8px; }
.row .settle svg { width: 14px; height: 14px; }

/* Sections */

main > section { padding: 88px 0; }
main > section + section { border-top: 1px solid var(--rule); }
@media (max-width: 639px) { main > section { padding: 64px 0; } }
.head { max-width: 40em; margin-bottom: 48px; }
.head p { margin: 16px 0 0; color: var(--ink-2); font-size: 18px; }

/* How it works: a caption and the thing itself, beat by beat. */

.beat { display: grid; gap: 20px; padding: 32px 0; border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .beat { grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: center; padding: 44px 0; } }
.beat h3 { font-family: var(--serif); font-weight: 400; font-size: 27px; line-height: 1.2; letter-spacing: -0.01em; }
.beat p { margin: 10px 0 0; color: var(--ink-2); max-width: 26em; }

.mail { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 18px 20px; }
.mail header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--theirs-wash); color: var(--theirs); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.avatar.you { background: var(--yours-wash); color: var(--yours); }
.mail .who { font-weight: 600; font-size: 15px; }
.mail .sub { font-size: 13.5px; color: var(--ink-3); }
.mail .when { margin-left: auto; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mail p { margin: 0; color: var(--ink); max-width: none; }

.hl {
  background-image: linear-gradient(var(--yours-wash), var(--yours-wash));
  background-repeat: no-repeat; background-size: 100% 100%;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  padding: 1px 3px; margin: 0 -3px; border-radius: 3px;
  font-weight: 600;
}

.hl.theirs { background-image: linear-gradient(var(--theirs-wash), var(--theirs-wash)); }

/* Where promises are made: a mail, a chat, a call, a sent question. */
.snips { display: grid; gap: 12px; }
@media (min-width: 600px) { .snips { grid-template-columns: 1fr 1fr; } }
.snip { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px 16px; }
.snip-src { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; }
.snip p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--ink); max-width: none; }
.snip p + p { margin-top: 6px; }
.snip p.muted { color: var(--ink-2); }
.snip .bubble { display: inline-block; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px 14px 14px 14px; padding: 8px 12px; }

/* Motion shows cause and effect, once, and only with JS and motion allowed. */
@media (prefers-reduced-motion: no-preference) {
  .js .beat .hl { background-size: 0% 100%; transition: background-size .9s ease .2s; }
  .js .beat.in .hl { background-size: 100% 100%; }
  .js .beat .arrive { opacity: 0; transform: translateY(10px); transition: opacity .5s ease .5s, transform .5s ease .5s; }
  .js .beat.in .arrive { opacity: 1; transform: none; }
  .js .beat .row.closing .t { transition: color .4s ease 1.3s; }
  .js .beat .row.closing::before { transition: background-color .4s ease 1.3s; }
  .js .beat .row.closing .settle { opacity: 0; transition: opacity .4s ease 1.4s; }
  .js .beat.in .row.closing .settle { opacity: 1; }
  .js .beat:not(.in) .row.closing .t { color: var(--ink); text-decoration-color: transparent; }
  .js .beat:not(.in) .row.closing::before { background: var(--dir); }
}
.row.closing .t { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; transition: text-decoration-color .4s ease 1.3s; }
.row.closing::before { background: var(--done); }

.pair { display: flex; flex-direction: column; gap: 12px; }
.pair .arrow { align-self: center; color: var(--ink-3); width: 18px; height: 18px; }

/* What it finds: a ruled ledger with the kind of thing named beside it. */

.finds { border-top: 1px solid var(--rule); }
.find { display: grid; gap: 10px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .find { grid-template-columns: 15em 1fr; gap: 32px; align-items: center; } }
.find .kind { font-weight: 600; }
.find .kind span { display: block; font-weight: 400; color: var(--ink-3); font-size: 15px; margin-top: 2px; }

/* The brief */

.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.brief { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 22px 24px 26px; }
.brief .from { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.brief .from svg { width: 20px; height: 20px; }
.brief .from time { margin-left: auto; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.brief p { margin: 0; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 27px); line-height: 1.35; letter-spacing: -0.005em; }

/* On the phone */

.facts { border-top: 1px solid var(--rule); margin: 0; }
.facts div { display: grid; gap: 4px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .facts div { grid-template-columns: 15em 1fr; gap: 32px; } }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--ink-2); }

/* One inbox each, and Aarni's scope */

.scope { margin: 0; border-top: 1px solid var(--rule); }
.scope div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.scope dt { font-weight: 600; }
.scope dd { margin: 0; color: var(--ink-2); }
.scope .ours { border-bottom: 0; border-top: 2px solid var(--yours); margin-top: -1px; }
.scope .ours dd { color: var(--ink); }

/* Questions */

.faq { border-top: 1px solid var(--rule); max-width: 46em; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 0; font-weight: 600; font-size: 17px; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--ink-3); transition: transform .2s ease; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 20px; color: var(--ink-2); max-width: 40em; }

/* Screens */

.screens {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px var(--gutter) 16px; margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
}
.screens figure { margin: 0; flex: none; width: min(62vw, 250px); scroll-snap-align: start; }
.screens img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--rule); aspect-ratio: 9 / 18; object-fit: cover; background: #121019; }
.screens figcaption { font-size: 14px; color: var(--ink-3); margin-top: 10px; }
@media (min-width: 1120px) { .screens { overflow: visible; margin: 0; padding: 4px 0 0; } .screens figure { flex: 1; width: auto; } }

/* Where it reads */

.sources { display: grid; gap: 0 48px; }
@media (min-width: 760px) { .sources { grid-template-columns: 1fr 1fr; } }
.sources div { padding: 18px 0; border-top: 1px solid var(--rule); }
.sources h3 { margin-bottom: 4px; }
.sources p { margin: 0; color: var(--ink-2); }

/* The close */

.close { padding: 96px 0; }
.close h2 { color: var(--cream); max-width: 16em; }
.close p { color: var(--ink-2); margin: 16px 0 32px; font-size: 18px; max-width: 32em; }

footer.site { padding: 40px 0 56px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--ink-3); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
footer.site a { color: var(--ink-2); }
footer.site .brand { font-size: 16px; margin-right: auto; }
footer.site .brand svg { width: 24px; height: 24px; }

/* Plain pages: beta, privacy, not found. The same dark head as the home
   page, so every page reads as one site. */

.measure { max-width: 720px; }
.pagehead { padding-bottom: 56px; }
.pagehead h1 { font-size: clamp(40px, 6vw, 64px); margin: 32px 0 16px; }
.pagehead .lede { margin: 0; }
.pagehead .date { color: var(--ink-3); margin: 0; }
.page { padding: 48px 0 88px; }
.page > .wrap > .measure > :first-child { margin-top: 0; }
.page h2 { font-size: clamp(24px, 3vw, 30px); margin: 44px 0 10px; }
.page p, .page li { color: var(--ink); max-width: 36em; }
.steps { border-top: 1px solid var(--rule); }
.step { padding: 28px 0; border-bottom: 1px solid var(--rule); }
.step h2 { margin: 0 0 6px; }
.step p { margin: 0 0 18px; color: var(--ink-2); }
.note { margin-top: 40px; }
.note h2 { margin-top: 0; }
@media (max-width: 479px) { .scope div { grid-template-columns: 1fr; gap: 4px; } }
