/* Ratri at night, on the web: one living form of light on near-black. Plain
   sans type in sentence case, ink on black, capsules, almost no lines. The
   same measures as the app: 24px gutters, 13px captions, display type set a
   little tight. Dark only. */

:root {
  --page: #0a0a0d;
  --raised: #16161b;
  --ink: #f2eee7;
  --on-ink: #0a0a0d;
  --ink-2: rgba(242, 238, 231, 0.6);
  --ink-3: rgba(242, 238, 231, 0.36);
  --ink-read: rgba(242, 238, 231, 0.74);
  --rule: rgba(242, 238, 231, 0.1);
  --well: rgba(242, 238, 231, 0.06);
  --gutter: 24px;
  --measure: 640px;
  --wide: 1040px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }
::selection { background: rgba(242, 238, 231, 0.2); }

/* Type */
.wordmark {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.caption {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  margin: 0;
}
.headline {
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  font-size: 40px;
  line-height: 1.02;
  letter-spacing: calc(-0.022em);
  text-wrap: balance;
}
.headline.xl { font-size: clamp(40px, 9vw, 64px); }
.lead {
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}
.read {
  color: var(--ink-read);
  font-size: 17px;
  line-height: 1.6;
}
.read p { margin: 0 0 1em; }
.read h2 {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 2.2em 0 0.6em;
}
.read ul { padding-left: 1.2em; margin: 0 0 1em; }
.read li { margin: 0.3em 0; }
.read a { color: var(--ink); border-bottom: 1px solid var(--rule); }
.read a:hover { border-bottom-color: var(--ink-2); }
.quiet { color: var(--ink-3); font-size: 13px; line-height: 1.5; }

/* Layout */
.page { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 20px var(--gutter) 0;
  max-width: var(--wide);
  margin: 0 auto;
}
header.top nav { display: flex; gap: 20px; }
header.top nav a { font-size: 13px; color: var(--ink-3); }
header.top nav a:hover, header.top nav a[aria-current] { color: var(--ink); }

section.page { padding-top: 72px; }
.section-head { display: grid; gap: 12px; margin-bottom: 32px; }

/* The hero: the form, then the words under it, as on Tonight. */
.hero.page { padding-top: 24px; text-align: center; }
.hero .stage {
  position: relative;
  width: min(70vw, 440px);
  aspect-ratio: 1;
  margin: 0 auto;
}
.hero .stage canvas {
  position: absolute;
  inset: -22%;
  width: 144%;
  height: 144%;
  touch-action: manipulation;
  cursor: pointer;
}
.hero .words { display: grid; gap: 18px; justify-items: center; margin-top: 8px; }
.hero .lead { max-width: 30em; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* Buttons: the app's capsules. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 500;
  color: var(--on-ink);
  background: var(--ink);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.button:hover { color: var(--on-ink); opacity: 0.9; }
.button:active { transform: scale(0.98); opacity: 0.8; }
.button.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(242, 238, 231, 0.3); }
.button.outline:hover { color: var(--ink); }

/* Rows between hairlines, as in Settings and the library. */
.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.row .title { font-size: 17px; color: var(--ink); }
.row .detail { grid-column: 1 / -1; font-size: 15px; color: var(--ink-2); }
.row .tag { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.row .meta { font-size: 15px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 15px;
  color: var(--ink-2);
  background: var(--well);
  border-radius: 999px;
  padding: 8px 14px;
}

/* The method: one drawing that moves through three states, and the three words. */
.method .drawing { height: 220px; display: block; margin: 0 calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); max-width: none; }
.method .steps { display: grid; gap: 0; }
.method .step { padding: 20px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr; gap: 8px; transition: opacity 0.6s ease; }
.method .step:last-child { border-bottom: 1px solid var(--rule); }
.method .step h3 { margin: 0; font-size: 28px; font-weight: 400; letter-spacing: -0.6px; }
.method .step p { margin: 0; font-size: 17px; color: var(--ink-2); max-width: 36em; }
.method .step[data-off] { opacity: 0.45; }
@media (min-width: 720px) {
  .method .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .method .step, .method .step:last-child { border: 0; border-top: 1px solid var(--rule); }
}

/* The science, as readouts. */
.figures { border-top: 1px solid var(--rule); }
.figure {
  display: grid;
  grid-template-columns: 138px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.figure .value { font-size: 34px; font-weight: 300; color: var(--ink); white-space: nowrap; }
.figure .value small { font-size: 13px; font-weight: 400; color: var(--ink-2); margin-left: 4px; }
.figure .label { font-size: 15px; color: var(--ink-2); }
.figure .label sup { font-size: 10px; color: var(--ink-3); margin-left: 2px; }
.references { display: grid; gap: 10px; margin-top: 32px; }
.references a { display: grid; grid-template-columns: 1.2em 1fr; gap: 8px; font-size: 13px; color: var(--ink-3); }
.references a:hover { color: var(--ink-2); }

/* Ratri Pro: the paywall's checklist, stars behind it. */
.pro { position: relative; }
.pro .sky { position: absolute; inset: -40px 0 0; z-index: -1; pointer-events: none; mask-image: linear-gradient(to bottom, black 35%, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, black 35%, transparent 85%); }
.pro .sky canvas { width: 100%; height: 100%; display: block; }
.checklist { width: 100%; border-collapse: collapse; }
.checklist th { font-size: 13px; font-weight: 400; text-align: right; padding: 0 0 6px; width: 60px; color: var(--ink-3); }
.checklist th:last-child { color: var(--ink); }
.checklist th:first-child { text-align: left; width: auto; }
.checklist td { padding: 14px 0; border-top: 1px solid var(--rule); font-size: 17px; vertical-align: middle; }
.checklist td + td { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.checklist td:last-child { color: var(--ink); }
.checklist .min { font-size: 13px; }
.checklist .no { display: inline-block; width: 10px; height: 1.5px; background: var(--ink-3); vertical-align: middle; }
.checklist .yes { font-weight: 600; }
.checklist tfoot td { border-top: 0; padding-top: 10px; }

/* Plans, as rows. */
.plans { border-top: 1px solid var(--rule); margin-top: 24px; }
.plan { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); font-size: 20px; }
.plan .sub { font-size: 13px; color: var(--ink-3); display: block; margin-top: 3px; }

footer.bottom {
  margin-top: 96px;
  padding: 32px var(--gutter) 40px;
  max-width: var(--wide);
  margin-left: auto;
  margin-right: auto;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 24px;
}
footer.bottom .name { display: grid; gap: 4px; }
footer.bottom .name .say { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
footer.bottom .name .say .meaning { color: var(--ink-3); }
footer.bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer.bottom nav a { font-size: 13px; color: var(--ink-2); }
footer.bottom nav a:hover { color: var(--ink); }

/* Reading pages. */
.doc { padding-top: 40px; }
.doc .section-head { margin-bottom: 36px; }
.doc .updated { color: var(--ink-3); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
