/* Merriweather marketing site. Every color, type style, space and radius is a
 * variable from tokens.css (generated from design/tokens.json). Hairlines, not
 * shadows. Cards only for distinct objects (a download, a help topic).
 *
 * Two grounds. The page is the mascots' sage paper (`surface` with the grain
 * laid over it); plates, cards and secondary buttons are the mascots' cream
 * (`surface-raised`), which stays cream in both themes. Anything cream carries
 * the `paper` remap below, so the rules inside it keep saying `--ink`,
 * `--ink-muted`, `--hairline` and `--teal-text` and get the on-paper values. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--surface); }
body {
  margin: 0;
  position: relative;
  isolation: isolate;
  background: var(--surface);
  color: var(--ink);
  font: var(--type-body-web);
  min-height: 100vh;
  overflow-x: hidden;
}
/* The paper grain: one fixed, full-viewport tile multiplied over the ground in
 * both themes. body is its own stacking context, so z-index -1 puts the layer
 * above body's background and under every piece of content, plates included
 * (multiply on cream is barely there). It takes no pointer events. html carries
 * the ground too so body's background is not lifted to the canvas and the
 * multiply has something to multiply against. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.13;
  mix-blend-mode: multiply;
  background-image: url(/assets/brand/paper-grain.svg);
  background-size: 180px 180px;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: var(--mint); color: var(--ink); }
p, ul, ol, h1, h2, h3, figure { margin: 0; }
ul, ol { padding: 0; }
code { font-family: var(--font-mono); font-size: 0.88em; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--space-8) 0; }
[hidden] { display: none !important; }

/* Cream surfaces: remap the ground tokens to their on-paper counterparts for
 * everything inside. Links on cream are green-deep; the focus ring stays
 * charcoal on cream in both themes so it never disappears into a cream plate. */
.paper, .panel, .plate, .card, .journal, .topic-list li, .btn,
.article pre, .article code, .policy-prose pre, .policy-prose code, .policy-prose blockquote, .policy-prose .table-scroll, .policy-prose .ph {
  --ink: var(--ink-on-paper);
  --ink-muted: var(--ink-muted-on-paper);
  --hairline: var(--hairline-on-paper);
  --teal-text: var(--green-deep);
  --focus: var(--ink-on-paper);
  color: var(--ink);
}
.paper ::selection, .panel ::selection, .plate ::selection, .card ::selection, .journal ::selection, .topic-list li ::selection,
.policy-prose blockquote ::selection, .policy-prose .table-scroll ::selection { background: var(--green-visor); color: var(--ink-on-paper); }

/* Type styles ---------------------------------------------------------- */
.label { font: var(--type-label); letter-spacing: var(--track-label); text-transform: uppercase; }
.readout { font: var(--type-readout); font-variant-numeric: tabular-nums; }
.readout-lg { font: var(--type-readout-lg); font-variant-numeric: tabular-nums; }
.wordmark { font: var(--type-wordmark); letter-spacing: var(--track-wordmark); text-transform: uppercase; color: var(--ink); }
.display { font: var(--type-display); letter-spacing: var(--track-display); text-wrap: balance; }
.h1 { font: var(--type-h1); text-wrap: balance; }
.h2 { font: var(--type-h2); text-wrap: balance; }
.h3 { font: var(--type-h3); text-wrap: balance; }
.lede { font: var(--type-lede); color: var(--ink-muted); text-wrap: pretty; }
.small { font: var(--type-small); }
.muted { color: var(--ink-muted); }
.measure { max-width: var(--measure); }
.mt-2 { margin-top: var(--space-2); }
.mt-6 { margin-top: var(--space-6); }
.mb-6 { margin-bottom: var(--space-6); }
.note { font: var(--type-small); font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.aside-note { color: var(--ink-muted); font-size: 15px; line-height: 23px; }
.body-type { font: var(--type-body); }
.prose > * + * { margin-top: var(--space-4); }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: var(--space-2); }
.prose code { background: var(--surface-paper); padding: 1px 5px; border-radius: var(--radius-sm); color: var(--ink-on-paper); }
@media (max-width: 599px) {
  .display { font-size: 44px; }
  .h1 { font-size: 32px; line-height: 38px; }
  .lede { font-size: 19px; line-height: 28px; }
}

/* Layout ---------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: var(--space-4); padding-right: var(--space-4); }
@media (min-width: 720px) { .wrap { padding-left: var(--space-8); padding-right: var(--space-8); } }
.section { padding: var(--space-12) 0; border-top: 1px solid var(--hairline); }
@media (min-width: 880px) { .section { padding: var(--space-16) 0; } }
.section-head { margin-bottom: var(--space-8); }
.section-head .label { color: var(--ink-muted); margin-bottom: var(--space-3); }

/* The knowing monocle, inline so it follows the theme and the surface -------- */
.mark { width: 28px; height: 22px; overflow: visible; flex: none; }
.mark .o { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.mark .eye { fill: var(--teal); }
.mark .lens { fill: none; }
.mark .ring { fill: none; stroke: var(--monocle); stroke-width: 1.65; }
.mark .pupil { fill: var(--ink); }
.mark .stem, .mark .smile { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-width: 1.1; }
.mark.rest .eye { fill: var(--ink); }
.mark.rest .ring { stroke: var(--ink); }
.mark.tracking .lens { fill: var(--resolved); }
.mark.remembering .lens { fill: var(--monocle); }
.mark.pending .eye { fill: var(--attention); }
.mark-lg { width: 56px; height: 44px; }

/* Header: on the ground, a hairline under it, the grain showing through -------- */
.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap { display: flex; align-items: center; gap: var(--space-6); height: 60px; }
.lockup { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); }
.lockup:hover { text-decoration: none; }
.lockup .wordmark { font-size: 14px; line-height: 16px; }
.site-nav { margin-left: auto; display: flex; gap: var(--space-6); align-items: center; }
.site-nav a { font: var(--type-strong); font-size: 15px; color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--teal-text); }

/* Buttons: primary is the monocle orange with charcoal on it; secondary is a
 * cream plate (the .paper remap gives it ink-on-paper and hairline-on-paper);
 * quiet is text, teal-text on the ground and green-deep on cream. ------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: var(--type-strong); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); border: 1px solid var(--hairline);
  background: var(--surface-raised); cursor: pointer; text-decoration: none;
  transition: filter 120ms ease;
}
.btn:hover { text-decoration: none; filter: brightness(0.94); }
.btn.primary { --focus: inherit; background: var(--monocle); color: var(--on-monocle); border-color: transparent; }
.btn.quiet { background: transparent; border-color: transparent; }
.btn.quiet { --ink: inherit; --ink-muted: inherit; --hairline: inherit; --teal-text: inherit; --focus: inherit; color: var(--teal-text); }
.btn.quiet:hover { filter: none; text-decoration: underline; text-underline-offset: 3px; }
.btn.lg { font-size: 17px; line-height: 24px; padding: var(--space-3) var(--space-6); }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* State badge: a dot and a word ------------------------------------------ */
.state { display: inline-flex; align-items: center; gap: var(--space-1); font: var(--type-readout); font-size: 11px; line-height: 14px; color: var(--ink-muted); white-space: nowrap; }
.state i { width: 7px; height: 7px; border-radius: var(--radius-pill); display: inline-block; flex: none; }
.state.resolved i { background: var(--resolved); }
.state.pending i { width: 5px; height: 5px; border: 1.5px solid var(--attention); }
.state.remembering i { background: var(--monocle); }
.state.info i { background: var(--readout); }
.state.error i { background: var(--error); }

/* Mascot: the figure stands directly on the sage ground, never on a tile, with
 * a soft floor ellipse (surface-deep at 60%) under the feet. The figure is
 * drawn 1200 x 1400 with the feet at about 90% of its height; the ellipse sits
 * where they land, and the figure paints above it. ------------------------- */
.mascot { position: relative; isolation: isolate; width: fit-content; max-width: 100%; margin: 0 auto; padding: var(--space-8) var(--space-4) var(--space-4); }
.mascot::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: calc(var(--space-4) + 6.5%); height: 7%; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--surface-deep) 60%, transparent); z-index: -1; }
.mascot img { height: 240px; width: auto; }
@media (min-width: 880px) { .mascot img { height: 320px; } }

/* Hero --------------------------------------------------------------------- */
.hero { padding: var(--space-12) 0; }
@media (min-width: 880px) { .hero { padding: var(--space-16) 0; } }
.hero .wrap { display: grid; gap: var(--space-8); align-items: center; }
@media (min-width: 880px) { .hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-16); } }
.hero-copy > * + * { margin-top: var(--space-6); }
.hero-copy .actions { margin-top: var(--space-8); }
.hero .mascot img { height: 280px; }
@media (min-width: 880px) { .hero .mascot img { height: 400px; } }

/* The one motion on the site: the hero assembles like an instrument plate,
 * once, from a visible resting state. The mark is already there; the hairline
 * extends from it; the type resolves. Reduced motion cuts it to a short fade. */
.assembly { display: flex; flex-direction: column; gap: var(--space-4); }
.assembly .hair { height: 1px; background: var(--hairline); transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) {
  .assembly .hair { animation: extend 220ms cubic-bezier(.2,.7,.2,1) 120ms both; }
  .assembly .resolves { animation: resolve 280ms ease-out 240ms both; }
}
@media (prefers-reduced-motion: reduce) {
  .assembly .resolves { animation: fade 200ms ease-out both; }
}
@keyframes extend { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes resolve { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Menu-bar panel as an instrument: a cream plate on the ground, its header a
 * deeper cream recess ---------------------------------------------------------- */
.panel-section .wrap { display: grid; gap: var(--space-8); align-items: start; }
@media (min-width: 880px) { .panel-section .wrap { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-16); } }
.panel { width: 100%; max-width: 320px; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); overflow: hidden; font: var(--type-body); }
.panel-bar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface-paper); border-bottom: 1px solid var(--hairline); }
.panel-bar .readout { margin-left: auto; }
.panel-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--hairline); }
.panel-row .readout { margin-left: auto; text-align: right; }
.panel-row .readout .pend { color: var(--ink-muted); }
.panel-row .readout .pend i { width: 5px; height: 5px; border: 1.5px solid var(--attention); border-radius: var(--radius-pill); display: inline-block; vertical-align: 1px; margin: 0 2px 0 var(--space-1); }
.panel-row.engagement { flex-wrap: wrap; row-gap: var(--space-1); }
.panel-row.engagement .state { margin-left: auto; }
.panel-items { list-style: none; padding: var(--space-2) 0; }
.panel-items li { padding: var(--space-1) var(--space-4); font: var(--type-body); }
.panel-items li.hair { padding: 0; height: 1px; background: var(--hairline); margin: var(--space-2) 0; }
.panel-items li.strong { font: var(--type-strong); }

/* Feature sections ---------------------------------------------------------- */
.feature .wrap { display: grid; gap: var(--space-8); align-items: center; }
@media (min-width: 880px) {
  .feature .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); }
  .feature.flip .figure { order: -1; }
}
.feature .copy > * + * { margin-top: var(--space-4); }
.feature .copy .h2 { margin-bottom: var(--space-6); }
.feature .copy .label { color: var(--ink-muted); display: block; margin-bottom: var(--space-3); }
.feature .more { display: inline-block; margin-top: var(--space-6); font: var(--type-strong); font-size: 15px; }

/* Instrument figures: a plate, a ledger, a follow-through row, a journal entry.
 * Plates, cards and the journal are cream; the ledger, transcript and
 * follow-through row sit on the ground between hairlines. */
.figure { display: grid; gap: var(--space-4); align-content: center; }
.plate { width: 100%; max-width: 280px; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); font: var(--type-body); }
.plate .ctx { font: var(--type-strong); }
.plate .acts { display: flex; gap: var(--space-2); margin-top: var(--space-1); }
.plate .acts .btn { padding: var(--space-1) var(--space-3); }
.ledger { width: 100%; max-width: 440px; border-top: 1px solid var(--hairline); font: var(--type-body); }
.ledger-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline; padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.ledger-row .readout { text-align: right; }
.ledger-row .what { font: var(--type-strong); }
.ledger-row .how { color: var(--ink-muted); font: var(--type-small); display: block; margin-top: 2px; }
.ledger-row .blank { color: var(--ink-muted); font-style: italic; }
.ledger-foot { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-6); padding: var(--space-3) 0; align-items: baseline; }
.ledger-foot .readout-lg { text-align: right; }
.transcript { width: 100%; max-width: 440px; font: var(--type-body); display: grid; gap: var(--space-2); }
.transcript .line { display: grid; grid-template-columns: 56px 1fr; gap: var(--space-3); }
.transcript .who { font: var(--type-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-muted); padding-top: 2px; }
.transcript .said { background: var(--mint); border-radius: var(--radius-sm); padding: 0 var(--space-1); margin: 0 -4px; }
.ft-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; width: 100%; max-width: 440px; padding: var(--space-3) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); font: var(--type-body); }
.ft-row .circle { width: 14px; height: 14px; border: 1.5px solid var(--ink-muted); border-radius: var(--radius-pill); margin-top: 2px; }
.ft-row .action { font: var(--type-strong); }
.ft-row .owner { color: var(--ink-muted); display: block; margin-top: 2px; }
.ft-row .due { font: var(--type-readout); color: var(--ink-muted); white-space: nowrap; }
.cards { display: grid; gap: var(--space-4); width: 100%; max-width: 440px; }
.card { background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: var(--space-4); font: var(--type-body); display: grid; gap: var(--space-1); }
.card .name { font: var(--type-strong); }
.card .meta { color: var(--ink-muted); }
.journal { width: 100%; max-width: 440px; background: var(--surface-paper); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: var(--space-4); font: var(--type-readout); font-size: 12px; line-height: 18px; overflow-x: auto; }
.journal .k { color: var(--ink-muted); }
.journal .t { display: block; font: var(--type-body); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--hairline); white-space: normal; }

/* Facts list (What stays on the Mac) ------------------------------------------ */
.facts { list-style: none; border-top: 1px solid var(--hairline); max-width: var(--measure); }
.facts li { padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline); display: grid; grid-template-columns: 1fr; gap: var(--space-1); }
@media (min-width: 720px) { .facts li { grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-6); } }
.facts .label { color: var(--ink-muted); padding-top: 6px; }
.facts p + p { margin-top: var(--space-2); }

/* Requirements line ------------------------------------------------------------- */
.reqs { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); align-items: baseline; color: var(--ink-muted); }
.reqs .label { color: var(--ink-muted); }

/* Footer: on the ground above a hairline ------------------------------------------- */
.site-footer { border-top: 1px solid var(--hairline); padding: var(--space-8) 0 var(--space-12); font: var(--type-small); font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.site-footer .wrap { display: grid; gap: var(--space-4); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.site-footer a { color: var(--ink); }
.site-footer .lockup .wordmark { font-size: 12px; }

/* Help --------------------------------------------------------------------------- */
.help { padding: var(--space-8) 0 var(--space-12); }
.help .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); align-items: start; }
@media (min-width: 880px) {
  .help { padding: var(--space-12) 0 var(--space-16); }
  .help .wrap { grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-16); }
}
.topics-wide { display: none; position: sticky; top: var(--space-6); }
@media (min-width: 880px) { .topics-wide { display: block; } .topics-narrow { display: none; } }
.topics .label { color: var(--ink-muted); margin-bottom: var(--space-3); }
.topics ol { list-style: none; border-top: 1px solid var(--hairline); }
.topics li { border-bottom: 1px solid var(--hairline); }
.topics a { display: block; padding: var(--space-2) 0; color: var(--ink); font: var(--type-strong); font-size: 14px; }
.topics a[aria-current="page"] { color: var(--teal-text); }
.topics .all { margin-bottom: var(--space-3); }
.topics-narrow { border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 0 var(--space-4); }
.topics-narrow summary { font: var(--type-strong); padding: var(--space-3) 0; cursor: pointer; }
.topics-narrow ol { border-top: 0; margin-bottom: var(--space-2); }
.article { max-width: var(--measure); min-width: 0; }
.article .kicker { color: var(--ink-muted); margin-bottom: var(--space-3); display: block; }
.article h1 { font: var(--type-h1); text-wrap: balance; margin-bottom: var(--space-3); }
.article .summary { margin-bottom: var(--space-8); }
.article h2 { font: var(--type-h2); text-wrap: balance; margin-top: var(--space-12); margin-bottom: var(--space-3); }
.article h3 { font: var(--type-h3); margin-top: var(--space-8); margin-bottom: var(--space-2); }
.article h2:first-child { margin-top: 0; }
.article p, .article ul, .article ol, .article pre, .article blockquote, .article table { margin-bottom: var(--space-4); }
.article ul, .article ol { padding-left: 1.3em; }
.article li + li { margin-top: var(--space-2); }
.article a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline); }
.article a:hover { text-decoration-color: currentColor; }
/* Code sits on the deeper cream, inline and in blocks, with charcoal on it. */
.article code { background: var(--surface-paper); padding: 1px 5px; border-radius: var(--radius-sm); }
.article pre { background: var(--surface-paper); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); overflow-x: auto; font: var(--type-readout); }
.article pre code { background: transparent; padding: 0; font-size: inherit; }
.article blockquote { border-left: 2px solid var(--hairline); margin-left: 0; padding-left: var(--space-4); color: var(--ink-muted); }
.article table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.article th, .article td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--hairline); }
.article th { font: var(--type-label); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-muted); }
.article strong { font-weight: 600; }
/* Help topics are distinct objects, so each is a cream card. */
.topic-list { list-style: none; display: grid; gap: var(--space-3); max-width: var(--measure); }
.topic-list li { background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.topic-list a { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-6); color: var(--ink); text-decoration: none; }
.topic-list a:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.topic-list .name { font: var(--type-h3); }
.topic-list .summary { color: var(--ink-muted); margin: 0; }
.pager { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-12); padding-top: var(--space-4); border-top: 1px solid var(--hairline); font: var(--type-strong); font-size: 15px; }
.pager a { display: grid; gap: 2px; color: var(--ink); }
.pager .label { color: var(--ink-muted); }
.pager .next { text-align: right; margin-left: auto; }

/* Download page ----------------------------------------------------------------- */
.steps { list-style: none; counter-reset: step; max-width: var(--measure); border-top: 1px solid var(--hairline); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline); }
.steps li::before { content: counter(step, decimal-leading-zero); font: var(--type-readout); color: var(--ink-muted); padding-top: 5px; }
.steps .name { font: var(--type-strong); font-size: 17px; line-height: 27px; }
.steps p { color: var(--ink-muted); }
.sum { font: var(--type-readout); word-break: break-all; color: var(--ink-muted); }

/* Error page ----------------------------------------------------------------------- */
.error-page { padding: var(--space-16) 0; }
.error-page .wrap { display: grid; gap: var(--space-6); max-width: var(--measure); }
