/* Page colours follow the app's Light theme, and its Dark theme in dark mode, as the examples and the
   demo do. */
:root {
  --bg: #FFFFFF; --side: #F6F6F7; --line: #E5E5E7; --text: #1D1D1F; --muted: #6E6E73; --faint: #AEAEB2;
  --accent: #007AFF; --hover: rgba(0, 0, 0, .045); --sel: #E4E4E7; --code: rgba(0, 0, 0, .05);
  --sheet: #FFFFFF; --shadow: rgba(0, 0, 0, .16);
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --body: var(--ui);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1E20; --side: #252527; --line: #333336; --text: #ECECEE; --muted: #9A9AA0; --faint: #5E5E64;
    --accent: #0A84FF; --hover: rgba(255, 255, 255, .05); --sel: #38383C; --code: rgba(255, 255, 255, .08);
    --sheet: #29292C; --shadow: rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--ui);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- header and hero ---------- */
header { display: flex; align-items: center; gap: 10px; height: 64px; font-weight: 600; font-size: 15px; }
header img { width: 28px; height: 28px; }
header > a:first-child { display: flex; align-items: center; gap: 10px; text-decoration: none; }
header nav { margin-left: auto; display: flex; gap: 22px; }
header nav a { font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none; }
header nav a:hover, header nav a.on { color: var(--text); }

.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; margin: 0 0 16px; }
.hero p { text-wrap: balance; font-size: 19px; line-height: 1.5; color: var(--muted); margin: 0 auto 28px; max-width: 30em; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 10px;
  background: var(--text); color: var(--bg); text-decoration: none; font-size: 15px; font-weight: 500;
}
.btn:hover { opacity: .88; }
.btn svg { width: 16px; height: 16px; }
.note-small { display: block; margin-top: 12px; font-size: 13px; color: var(--faint); }

/* ---------- note text, styled like the editor ---------- */
.doc {
  font-family: var(--body); font-size: 16px; line-height: 1.65; padding: 8px 48px 40px;
  max-width: 640px; margin: 0 auto; word-break: break-word;
}
.doc .ln { white-space: pre-wrap; min-height: 1.65em; }
.doc .h1 { font-size: 30px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; padding: 8px 0 14px; }
.doc b { font-weight: 650; }
.doc code { font-family: var(--mono); font-size: .86em; background: var(--code); padding: 1px 4px; border-radius: 4px; }
/* ---------- sections ---------- */
section { padding: 96px 0 0; }
.cap { text-align: center; margin: 0 auto 36px; max-width: 34em; }
.cap h2 { font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -.02em; line-height: 1.15; font-weight: 700; margin: 0 0 10px; }
.cap p { text-wrap: balance; margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--muted); }

/* chips (the tour's tabs) */
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 auto 22px; }
.chip {
  border: 0; background: var(--hover); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.flash { animation: flash 1.2s ease-out; border-radius: 4px; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } }

/* tables */
.tbl { display: inline-grid; grid-template-columns: auto auto; align-items: start; }
.tbl table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; line-height: 1.45; }
.tbl th, .tbl td { padding: 6px 12px; min-width: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; outline: none; }
.tbl tr > :last-child { border-right: 0; }
.tbl tr:last-child > * { border-bottom: 0; }
.tbl th { font-weight: 600; background: var(--hover); }
.tbl tr:first-child > :first-child { border-top-left-radius: 9px; }
.tbl tr:first-child > :last-child { border-top-right-radius: 9px; }
.tbl tr:last-child > :first-child { border-bottom-left-radius: 9px; }
.tbl tr:last-child > :last-child { border-bottom-right-radius: 9px; }
.tbl :is(th, td):focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tbl button {
  border: 0; background: none; color: var(--faint); width: 22px; height: 22px; border-radius: 5px; cursor: pointer;
  display: grid; place-items: center; padding: 0; margin: 3px;
}
.tbl button:hover { background: var(--hover); color: var(--text); }
.tbl button svg { width: 13px; height: 13px; }
.tbl .addrow { grid-column: 1; }

/* live demo */
.demo-hint { margin: 0 0 14px; text-align: center; font-size: 14px; color: var(--muted); }
.demo-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--sheet); color: var(--text); box-shadow: 0 1px 3px var(--shadow); }
.demo {
  display: block; width: 100%; height: 640px; border: 0; border-radius: 12px; background: var(--bg);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 30px 70px -20px var(--shadow), 0 8px 24px -12px var(--shadow);
}
.more { text-align: center; margin-top: 32px; font-size: 15px; }
.more a { color: var(--accent); text-decoration: none; }
.more a:hover { text-decoration: underline; }

/* shortcuts */
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; max-width: 820px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); }
.keys div { background: var(--bg); padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
kbd { font-family: var(--ui); font-size: 13px; color: var(--muted); background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }

footer { text-align: center; padding: 120px 0 72px; }
footer img { width: 64px; height: 64px; display: block; margin: 0 auto 18px; }
footer h2 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 22px; }


/* ---------- animated scenes (scenes.js) ---------- */
.scene { position: relative; }
.sc { position: relative; margin: 0 auto; transform-origin: top left; transition: opacity .35s; }
.sc.fading { opacity: 0; }

/* the app window */
.m-win {
  position: relative; display: flex; height: 430px; overflow: hidden; border-radius: 12px; text-align: left;
  background: var(--bg); color: var(--text); font-size: 13px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 30px 70px -20px var(--shadow), 0 8px 24px -12px var(--shadow);
  transition: background .4s, color .4s;
}
.m-win.m-short { height: auto; min-height: 300px; }
.m-lights {
  flex-shrink: 0; width: 52px; height: 12px;
  background: radial-gradient(circle at 6px 6px, #FF5F57 5.5px, transparent 6px), radial-gradient(circle at 26px 6px, #FEBC2E 5.5px, transparent 6px), radial-gradient(circle at 46px 6px, #28C840 5.5px, transparent 6px);
}
.m-side {
  display: flex; flex-direction: column; flex-shrink: 0; width: 200px; padding: 0 8px; overflow: hidden;
  background: var(--side); border-right: 1px solid var(--line);
  transition: width .45s cubic-bezier(.2, .8, .2, 1), padding .45s, background .4s, border-color .4s;
}
.m-wideside .m-side { width: 230px; }
.m-win.noside .m-side { width: 0; padding: 0; border-right-width: 0; }
.m-head { display: flex; align-items: center; justify-content: space-between; height: 46px; padding-left: 8px; color: var(--muted); }
.m-acts { display: flex; }
.m-acts span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; transition: background .2s, color .2s; }
.m-acts span.on { background: var(--sel); color: var(--text); }
.m-acts svg { width: 14px; height: 14px; }
.m-foot { display: flex; align-items: center; height: 38px; color: var(--muted); }
.m-foot span, .m-stat span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; transition: background .2s, color .2s; }
.m-foot span.on, .m-stat span.on { background: var(--sel); color: var(--text); }
.m-foot svg { width: 14px; height: 14px; }
.m-foot [data-a="tags"], .m-foot [data-a="lock"] { display: none; }
.has-tags .m-foot [data-a="tags"], .has-lock .m-foot [data-a="lock"] { display: grid; }
.m-stat { position: absolute; right: 10px; bottom: 8px; display: flex; color: var(--faint); }
.m-stat svg { width: 13px; height: 13px; }
.m-tree { flex: 1; transition: opacity .15s; }
.m-tree.swap, .doc.swap { opacity: 0; }
.m-sect { display: flex; align-items: center; gap: 6px; padding: 14px 8px 4px 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.m-view { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.m-back { display: grid; place-items: center; margin-left: auto; color: var(--muted); }
.m-back svg { width: 13px; height: 13px; }
.m-row {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 calc(var(--d, 0) * 14px + 2px);
  border-radius: 6px; white-space: nowrap; overflow: hidden; transition: background .2s, box-shadow .2s, height .35s, opacity .35s;
}
.m-row.sel { background: var(--sel); }
.m-row.ctx { box-shadow: inset 0 0 0 1.5px var(--accent); }
.m-row.enter { animation: row-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.m-row.leave { height: 0; opacity: 0; }
@keyframes row-in { from { height: 0; opacity: 0; } }
.m-chev { display: grid; place-items: center; flex-shrink: 0; width: 12px; color: var(--faint); }
.m-chev svg { width: 11px; height: 11px; transition: transform .2s; }
.m-chev.open svg { transform: rotate(90deg); }
.m-row svg.ico { flex-shrink: 0; width: 14px; height: 14px; color: var(--muted); }
.m-row.folder svg.ico { color: var(--accent); }
.m-name { overflow: hidden; text-overflow: ellipsis; }
.m-row .count { margin-left: auto; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.m-row .from { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.m-main { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.m-bar { display: flex; align-items: center; flex-shrink: 0; height: 44px; padding: 0 16px; }
.m-meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.m-win .doc { width: 100%; padding: 4px 40px 28px; font-size: 15px; transition: opacity .15s; }
.m-win .doc .h1 { font-size: 26px; padding: 4px 0 12px; }
.doc .h1, .doc .h2 { color: var(--heading, inherit); transition: color .4s; }
.doc .h2 { font-size: 19px; line-height: 1.3; font-weight: 650; padding: 12px 0 4px; }
.doc .task, .doc .li { display: flex; align-items: baseline; gap: 9px; }
.doc .li::before { content: ""; flex-shrink: 0; width: 5px; height: 5px; margin: 0 3px 0 5px; border-radius: 50%; background: currentColor; transform: translateY(-3px); }
.doc .box {
  position: relative; flex-shrink: 0; width: 14px; height: 14px; border-radius: 4px; transform: translateY(2px);
  box-shadow: inset 0 0 0 1.5px var(--faint); transition: background .2s, box-shadow .2s;
}
.doc .done .box { background: var(--accent); box-shadow: none; }
.doc .done .box::after {
  content: ""; position: absolute; left: 4.6px; top: 1.8px; width: 3.5px; height: 7px;
  border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg);
}
.doc .done > :last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.doc .q { margin: 8px 0; padding-left: 13px; border-left: 3px solid var(--quote, var(--accent)); color: var(--muted); transition: border-color .4s; }
.doc .link { color: var(--accent); transition: color .4s; }
.doc .tagp { padding: 0 4px; border-radius: 5px; font-size: .92em; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.doc .tagline { margin-top: 12px; }
.doc .ln.enter { animation: row-fade .3s ease-out both; }
.doc.archived { opacity: .6; }
.m-win .tbl table { font-size: 14px; }

/* pointer, drag ghost, keys */
.ptr {
  position: absolute; left: 0; top: 0; z-index: 30; width: 20px; height: 24px; margin: -2px 0 0 -3px;
  opacity: 0; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
  transition: transform .6s cubic-bezier(.45, .05, .25, 1), opacity .3s;
}
.ptr.on { opacity: 1; }
.ptr svg { display: block; width: 100%; height: 100%; transform-origin: 3px 2px; transition: transform .12s; }
.ptr.down svg { transform: scale(.85); }
.ring {
  position: absolute; left: 0; top: 0; z-index: 29; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border: 2px solid var(--accent); border-radius: 50%; pointer-events: none; animation: ring .5s ease-out forwards;
}
@keyframes ring { from { scale: .3; opacity: .9; } to { scale: 1.2; opacity: 0; } }
.ghost {
  position: absolute; left: 0; top: 0; z-index: 28; display: flex; align-items: center; gap: 6px; margin: 12px 0 0 14px;
  padding: 5px 10px; border-radius: 7px; background: var(--sheet); font-size: 13px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 20px var(--shadow), 0 0 0 .5px var(--line); opacity: 0;
  transition: transform .6s cubic-bezier(.45, .05, .25, 1), opacity .2s;
}
.ghost.on { opacity: .95; }
.ghost svg { width: 14px; height: 14px; color: var(--muted); }
.keycap {
  position: absolute; left: 50%; bottom: 28px; z-index: 31; translate: -50% 0; padding: 10px 18px; border-radius: 12px;
  background: rgba(24, 24, 26, .84); color: #fff; font-size: 22px; font-weight: 500; letter-spacing: .04em;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: key-in .25s cubic-bezier(.2, .8, .2, 1);
}
.keycap.out { opacity: 0; transition: opacity .3s; }
@keyframes key-in { from { opacity: 0; scale: .85; } }
.caret { display: inline-block; width: 1.5px; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { scale: .2; } }

/* menus and popovers */
.m-menu, .m-complete {
  position: absolute; z-index: 25; background: var(--sheet); border-radius: 9px;
  box-shadow: 0 12px 32px var(--shadow), 0 0 0 .5px var(--line);
  opacity: 0; pointer-events: none; transition: opacity .15s, scale .15s, translate .2s;
}
.m-menu { min-width: 180px; padding: 5px; font-size: 13px; scale: .96; transform-origin: top left; }
.m-menu.on, .m-complete.on { opacity: 1; scale: 1; }
.m-menu div { padding: 3px 10px; border-radius: 5px; }
.m-menu .hl { background: var(--accent); color: #fff; }
.m-menu hr { height: 1px; margin: 4px 8px; border: 0; background: var(--line); }
.m-menu .sub { display: flex; justify-content: space-between; gap: 16px; }
.m-menu .sub::after { content: "›"; opacity: .6; }

/* the editor's suggestions: the "/" menu, note links and tags */
.m-complete { min-width: 210px; padding: 4px; scale: .97; transform-origin: top left; }
.m-complete div { padding: 5px 10px; border-radius: 6px; font-size: 13px; line-height: 1.35; }
.m-complete small { display: block; font-size: 11px; color: var(--muted); }
.m-complete .on { background: var(--accent); color: #fff; }
.m-complete .on small { color: rgba(255, 255, 255, .8); }

/* pinned */
.m-pinned.enter, .m-group.enter { animation: block-in .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes block-in { from { opacity: 0; translate: 0 -6px; } }
.m-pinned { position: relative; margin-top: 4px; border-radius: 8px; outline: 1.5px solid transparent; outline-offset: 3px; transition: outline-color .2s, background .2s; }
/* While a note is dragged: an outline round the pins, with a pin in its corner. */
.m-pinned.pinning { outline-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.m-pin-badge { position: absolute; top: 8px; right: 6px; display: grid; color: color-mix(in srgb, var(--accent) 70%, transparent); opacity: 0; transition: opacity .2s; }
.m-pin-badge svg { width: 12px; height: 12px; }
.m-pinned.pinning .m-pin-badge { opacity: 1; }
.m-group { border-radius: 8px; transition: background .2s, box-shadow .2s; }
.m-group.drop { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
/* With nothing pinned: where a note dragged to the top is pinned, closed until one is picked up. */
.m-pindrop {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 0; margin: 0 6px; overflow: hidden;
  border-radius: 8px; font-size: 12px; color: var(--muted); opacity: 0;
  transition: height .25s cubic-bezier(.2, .8, .2, 1), margin .25s cubic-bezier(.2, .8, .2, 1), opacity .2s, background .2s, box-shadow .2s;
}
.m-pindrop svg { width: 14px; height: 14px; }
.m-pindrop.open {
  height: 34px; margin: 2px 6px 8px; opacity: 1; color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent);
}
.m-pindrop.drop { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
/* The line under the pins, with the chevron that folds everything else away: down while it shows, left while it's hidden. */
.m-line { display: flex; align-items: center; gap: 6px; margin: 6px 6px 0 10px; }
.m-line .l { flex: 1; height: 1px; background: var(--line); }
.m-fold { display: grid; place-items: center; width: 18px; height: 18px; color: var(--faint); }
.m-fold svg { width: 11px; height: 11px; transform: rotate(90deg); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.m-fold.hiding svg { transform: rotate(180deg); }
.m-tree.only > :not(.m-pinned, .m-line, .m-pindrop) { display: none; }

/* side by side */
.m-panes { display: flex; flex: 1; min-height: 0; }
.m-pane { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; transition: flex-grow .5s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.m-pane + .m-pane { border-left: 1px solid var(--line); }
.m-pane.in { animation: pane-in .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pane-in { from { opacity: 0; transform: translateX(12px); } }
.m-pane.leave { flex-grow: 0; opacity: 0; }
.m-pdrop {
  position: absolute; top: 6px; bottom: 6px; z-index: 5; border-radius: 10px; pointer-events: none; animation: row-fade .12s ease-out both;
  background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.m-pdrop[data-side="left"] { left: 6px; width: calc(50% - 9px); }
.m-pdrop[data-side="right"] { right: 6px; width: calc(50% - 9px); }
.m-pdrop[data-side="all"] { left: 6px; right: 6px; }
.m-row.tab .tab-sep { display: inline-block; width: 1px; height: 11px; margin: 0 7px; vertical-align: -1px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.m-panes.split .doc { padding: 0 18px; font-size: 13.5px; }
.m-panes.split .doc .h1 { font-size: 20px; }
.m-panes.split .doc .h2 { font-size: 16px; }
.m-panes.split .tbl :is(th, td) { min-width: 0; padding: 5px 8px; }

/* tables */
.tbl tr.enter > * { animation: row-fade .35s ease-out; }
@keyframes row-fade { from { opacity: 0; } }
.tbl .focus { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* images */
.sc-images .m-win { height: 440px; }
.m-img { padding: 10px 0 4px; }
.m-photo { position: relative; max-width: 100%; line-height: 0; opacity: 0; scale: .97; transition: opacity .4s, scale .4s; }
.m-photo.in { opacity: 1; scale: 1; }
.m-photo svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.m-photo.resizing svg { outline: 1.5px solid var(--accent); outline-offset: 2px; }
.m-handle { position: absolute; right: -5px; bottom: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 1.5px var(--accent); opacity: 0; transition: opacity .2s; }
.m-photo.hover .m-handle { opacity: 1; }
.m-saved { margin-top: 20px; text-align: center; font: 13px var(--mono); color: var(--muted); opacity: 0; transition: opacity .4s; }
.m-saved.on { opacity: 1; }
.m-saved b { font-weight: 500; color: var(--accent); border-radius: 3px; }

/* live Markdown */
.md .doc .ln .mk { display: inline-block; max-width: 12em; overflow: hidden; vertical-align: bottom; white-space: pre; color: var(--faint); transition: max-width .35s, opacity .3s; }
.md .doc .ln.live .mk { max-width: 0; opacity: 0; }
.md .doc .ln .b { font-weight: 650; }
.md .doc .ln .i { font-style: italic; }
.md .doc .ln .code { font-family: var(--mono); font-size: .86em; padding: 1px 4px; border-radius: 4px; background: var(--code); }
.md .doc .ln.typing .box { display: none; }
.md .doc .ln.typing.task.live .box { display: block; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.md .doc .ln.h2 { transition: font-size .3s, padding .3s; }
.md .doc .ln.typing.h2:not(.live) { font-size: 15px; font-weight: 400; padding: 0; }
.md .doc .ln.typing.q:not(.live) { border-left-color: transparent; padding-left: 0; color: inherit; }
.md .doc .ln.q { transition: border-color .3s, padding .3s, color .3s; }

/* command palette */
.m-cmd { position: absolute; inset: 0; z-index: 10; display: flex; justify-content: center; padding-top: 64px; background: rgba(0, 0, 0, .1); opacity: 0; pointer-events: none; transition: opacity .2s; }
.m-cmd.on { opacity: 1; }
.m-cmd-box { align-self: flex-start; width: 380px; overflow: hidden; border-radius: 12px; background: var(--sheet); box-shadow: 0 24px 60px var(--shadow), 0 0 0 .5px var(--line); scale: .97; transition: scale .2s; }
.m-cmd.on .m-cmd-box { scale: 1; }
.m-cmd-input { display: flex; align-items: center; height: 46px; padding: 0 16px; font-size: 15px; border-bottom: 1px solid var(--line); }
.ph { color: var(--faint); }
.typed:not(:empty) ~ .ph { display: none; }
.m-cmd-list { padding: 6px; }
.m-cmd-item { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; }
.m-cmd-item.on { background: var(--sel); }
.m-cmd-item mark { background: none; color: var(--accent); font-weight: 650; }
.m-cmd-item kbd { padding: 0; background: none; box-shadow: none; font-size: 12px; color: var(--faint); }
.m-toast { position: absolute; left: 50%; bottom: 20px; translate: -50% 10px; padding: 7px 14px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12.5px; opacity: 0; transition: opacity .25s, translate .25s; }
.m-toast.on { opacity: 1; translate: -50% 0; }

/* colours */
.m-paint, .m-paint * { transition: background-color .4s, color .4s, border-color .4s; }
.m-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 20px; margin-top: 26px; }
.m-swatches { display: flex; gap: 7px; }
.m-themes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.m-themes button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font-size: 12px; color: var(--muted); cursor: pointer; }
.m-themes i { width: 58px; height: 36px; border-radius: 7px; background: linear-gradient(90deg, var(--a) 30%, var(--b) 30%); box-shadow: 0 0 0 1px var(--line); position: relative; transition: box-shadow .2s; }
.m-themes i::after { content: ""; position: absolute; left: 24px; top: 11px; width: 22px; height: 3px; border-radius: 2px; background: var(--c); opacity: .6; box-shadow: 0 7px 0 -0px var(--c); }
.m-themes .on { color: var(--text); font-weight: 500; }
.m-themes .on i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }
.m-sw { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s; }
.m-sw[data-p="default"] { background: linear-gradient(135deg, #007AFF 50%, #1D1D1F 50%); }
.m-sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }

.sc-slash .m-win { height: 380px; }

/* locked notes */
.m-pair { display: flex; align-items: flex-start; gap: 20px; }
.m-pair .m-win { flex: 1; min-width: 0; }
.m-file { flex-shrink: 0; width: 230px; margin-top: 70px; overflow: hidden; border-radius: 10px; background: var(--bg); font-size: 12px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 20px 50px -20px var(--shadow); }
.m-fname { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--side); border-bottom: 1px solid var(--line); font-weight: 500; }
.m-fname svg { width: 13px; height: 13px; color: var(--muted); }
.m-file pre { margin: 0; padding: 10px 12px 12px; font: 11px/1.55 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-all; min-height: 92px; transition: opacity .2s; }
.m-file pre.swap { opacity: 0; }
.m-row .lk { flex-shrink: 0; width: 11px; height: 11px; margin-left: auto; color: var(--faint); }
.m-locked { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 70px; font-family: var(--ui); text-align: center; }
.m-locked span svg { width: 22px; height: 22px; color: var(--faint); margin-bottom: 6px; }
.m-locked b { font-size: 15px; font-weight: 600; }
.m-locked small { font-size: 12px; color: var(--muted); }
.m-locked button, .m-pass button { margin-top: 10px; padding: 4px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 500; }
.m-sheet {
  position: absolute; left: 50%; top: 50%; z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 250px; padding: 18px 18px 16px;
  border-radius: 12px; background: var(--sheet); text-align: center; box-shadow: 0 24px 60px var(--shadow), 0 0 0 .5px var(--line);
  translate: -50% -46%; opacity: 0; scale: .96; pointer-events: none; transition: opacity .2s, scale .2s;
}
.m-sheet.on { opacity: 1; scale: 1; }
.m-sheet b { font-size: 13.5px; font-weight: 600; }
.m-sheet small { font-size: 11.5px; line-height: 1.45; color: var(--muted); margin-bottom: 4px; }
.m-field { display: flex; align-items: center; width: 100%; height: 26px; padding: 0 8px; border-radius: 6px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; letter-spacing: 1px; text-align: left; }
.m-pass button { align-self: stretch; }
.m-btns { display: flex; gap: 6px; align-self: stretch; margin-top: 6px; }
.m-btns button { flex: 1; padding: 4px 8px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 500; }
.m-btns .alt { background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.m-touch svg { width: 40px; height: 40px; color: #E5484D; margin-bottom: 4px; transition: color .25s; }
.m-touch.ok svg { color: #2F9E5B; }

/* table totals */
.tbl .total { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tbl .total::before { content: 'Σ'; margin-right: 6px; color: var(--accent); font: 600 12px var(--ui); opacity: .85; }

/* reading mode and Focus Mode */
.m-win .m-bar, .m-win .m-stat { transition: opacity .4s; }
.m-win.focus .m-bar, .m-win.focus .m-stat { opacity: 0; }
.m-win.reading .doc .ln:not(.task) { cursor: default; }

/* the tour on the home page */
.tour .sc .chips { display: none; }
.tour-tabs { margin-bottom: 36px; }
.tour .m-win { height: 430px; }
.sc .m-taller { height: 480px; }
.tour-stage { transition: height .4s ease; }

@media (prefers-reduced-motion: reduce) {
  .sc *, .sc *::before, .sc *::after { transition: none !important; animation: none !important; }
  .ptr, .keycap { display: none; }
}

@media (max-width: 760px) {
  .hero { padding-top: 44px; }
  .demo { height: 560px; }
  .seg button { padding: 6px 10px; }
  section { padding-top: 72px; }
  .keys { grid-template-columns: 1fr 1fr; }
  .keys div { padding: 14px; font-size: 13.5px; }
}
