/* Jotmark project page.
   Page chrome follows the site system (paper/ink/hairline, Archivo display,
   JetBrains Mono labels). Everything inside .jm-stage is a scoped replica of
   the extension popup and uses the extension's own tokens (system font,
   highlighter accents), so the product keeps its identity within the page.
   Radius system: containers 12px, page controls 6px, popup internals keep the
   extension's 4/6/8px. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/archivo-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-400-latin.woff2") format("woff2");
}

:root {
  --bg: #fbfbfa;
  --ink: #141414;
  --body: #4c4c47;
  --mut: #9a9a96;
  --hair: #e6e6e2;
  --yel: #ffe34d;
  --mut-2: #6f6f6a;
  --sec: clamp(80px, 9vw, 144px);
  --measure: 56ch;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --disp: "Archivo", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--disp);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--ink); }

:focus-visible {
  outline: 1px dashed var(--ink);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

::selection { background: var(--yel); color: var(--ink); }

.back {
  position: absolute;
  top: 24px;
  left: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  z-index: 3;
}
.back:hover { text-decoration: underline; }
.back svg { vertical-align: -1px; margin-right: 3px; }

/* Shared section shell */
.hero, .demo, .allnotes, .privacy, .colophon, .foot {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}

h2 {
  font-family: var(--disp);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 16px;
  text-wrap: balance;
}

p { margin: 0; }

/* ---------------- Hero ---------------- */

.hero { padding-top: 108px; padding-bottom: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
}
.brand-icon { display: block; }
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--mut-2);
  margin-left: 4px;
  padding-top: 1px;
}

.hero h1 {
  font-size: clamp(42px, 7.2vw, 86px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 22px;
  max-width: 11ch;
  text-wrap: balance;
}

/* Highlighter sweep: the marker draws itself under the phrase on load. */
.hl {
  background-image: linear-gradient(0deg, var(--yel), var(--yel));
  background-repeat: no-repeat;
  background-size: 0% 40%;
  background-position: 0 78%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.06em 0 0.04em;
  margin: 0 -0.04em;
  animation: sweep 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.75s forwards;
}
@keyframes sweep { to { background-size: 100% 40%; } }

.sub {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--body);
  max-width: var(--measure);
  margin-bottom: 30px;
}

.ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: #2e2e2c; }
.btn-line { border: 1px solid var(--ink); color: var(--ink); }
.btn-line:hover { background: #f1f1ec; }

/* Staged load-in for the hero, matching the home page's quiet fades. */
.brand, .hero h1, .sub, .ctas {
  opacity: 0;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero h1 { animation-delay: 0.08s; }
.sub { animation-delay: 0.16s; }
.ctas { animation-delay: 0.24s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Sections ---------------- */

.demo, .allnotes, .privacy, .colophon, .foot {
  padding-top: var(--sec);
  padding-bottom: 0;
}

.lede {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--body);
  max-width: var(--measure);
  margin-bottom: 30px;
}

/* Scroll reveal: .rv-pre is added by script only to sections below the fold,
   so nothing is hidden without JavaScript. */
@media (prefers-reduced-motion: no-preference) {
  .rv-pre { opacity: 0; transform: translateY(16px); }
  .rv-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

/* ---------------- Browser frame ---------------- */

.browser {
  background: #ffffff;
  border: 1px solid var(--hair);
  border-radius: 12px;
  box-shadow: 0 24px 60px -32px rgba(40, 38, 20, 0.25);
  overflow: hidden;
}

.chrome {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  background: #f4f4f1;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--hair);
}
.lights { display: flex; gap: 6px; padding-bottom: 12px; }
.lights i { width: 10px; height: 10px; border-radius: 50%; }
.l-r, .l-y, .l-g { background: #dcdcd6; }

.tabstrip { display: flex; gap: 2px; min-width: 0; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  min-width: 0;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: none;
  color: var(--mut-2);
  font-family: var(--jm-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--ink); background: #ecece7; }
.tab[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--hair);
  position: relative;
}
.tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: #ffffff;
}
.tfav { display: inline-flex; flex-shrink: 0; }
.tfav svg { display: block; border-radius: 3px; }
.tfav-st {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #ecece7;
  color: var(--mut-2);
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.tlabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--hair);
  background: #ffffff;
}
.nav-glyphs { display: flex; gap: 12px; color: #b9b9b3; }
.nav-glyphs svg { display: block; }
.url {
  flex: 1 1 auto;
  min-width: 0;
  background: #f4f4f1;
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.ext-btn:hover { background: #f0f0eb; }
.ext-btn[aria-expanded="true"] { background: #f0f0eb; }
.ext-btn svg { display: block; }

.viewport {
  position: relative;
  height: clamp(480px, 56vh, 540px);
  background: #ffffff;
  overflow: hidden;
}

/* Abstract page stand-ins behind the popup, one per sample site. */
.skel { position: absolute; inset: 0; padding: 34px 38px; }
.skel span { display: block; background: #ecece8; border-radius: 6px; }
.sk-line { height: 12px; }
.w40 { width: 40%; }
.w60 { width: 60%; }
.w70 { width: 70%; }
.w85 { width: 85%; }
.w90 { width: 90%; }
.w100 { width: 100%; }
.sk-h { height: 26px; width: 46%; }

.skel-gh { display: flex; gap: 34px; }
.sk-side { width: 150px; flex-shrink: 0; display: grid; gap: 12px; align-content: start; }
.sk-side span { height: 13px; }
.sk-side span:nth-child(2) { width: 78%; }
.sk-side span:nth-child(3) { width: 88%; }
.sk-side span:nth-child(4) { width: 66%; }
.sk-side span:nth-child(5) { width: 80%; }
.sk-main { flex: 1 1 auto; display: grid; gap: 16px; align-content: start; max-width: 520px; }
.sk-card { height: 64px; }

.skel-st { display: flex; justify-content: flex-start; }
.sk-col { width: min(420px, 46%); margin-left: 4%; display: grid; gap: 14px; align-content: start; justify-items: start; }
.sk-c { justify-self: center; }
.sk-photo { width: 100%; height: 150px; }

.skel-ka { background: var(--bg); }
.sk-mark {
  position: absolute;
  top: 30px;
  left: 34px;
  width: 92px;
  height: 8px;
  background: #deded8;
}
.sk-dots {
  position: absolute;
  left: 7%;
  top: 22%;
  width: 46%;
  height: 30%;
  background-image: radial-gradient(circle, #c4c4bf 0.9px, transparent 1.1px);
  background-size: 6px 6px;
}
.sk-corner {
  position: absolute;
  right: 38px;
  bottom: 34px;
  width: 130px;
  display: grid;
  gap: 10px;
  justify-items: end;
}
.sk-corner span { height: 10px; background: #e2e2dd; }
.sk-corner span:nth-child(1) { width: 100%; }
.sk-corner span:nth-child(2) { width: 72%; }
.sk-corner span:nth-child(3) { width: 86%; }
.sk-corner span:nth-child(4) { width: 58%; }

.demo-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 28px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.try {
  flex: 1 1 520px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  line-height: 1.7;
  color: var(--mut-2);
}
.reset {
  border: 0;
  padding: 0;
  background: none;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--mut-2);
  cursor: pointer;
  white-space: nowrap;
}
.reset:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- Popup replica (scoped, extension tokens) ---------------- */

.jm-stage {
  --jm-paper: #ffffff;
  --jm-paper-2: #f6f6f6;
  --jm-ink: #111111;
  --jm-ink-2: #444444;
  --jm-muted: #6b6b6b;
  --jm-faint: #767676;
  --jm-line: #e4e4e4;
  --jm-line-strong: #111111;
  --jm-danger: #c62828;
  --jm-toast-bg: #111111;
  --jm-toast-ink: #ffffff;
  --jm-toast-line: #111111;
  --jm-accent: #ffe34d;
  --jm-accent-ink: #111111;
  --jm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --jm-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.jm-stage[data-jm-accent="pink"]   { --jm-accent: #ffb3d9; }
.jm-stage[data-jm-accent="green"]  { --jm-accent: #b9f26b; }
.jm-stage[data-jm-accent="blue"]   { --jm-accent: #9ad8ff; }
.jm-stage[data-jm-accent="orange"] { --jm-accent: #ffb454; }

.jm-stage[data-jm-theme="dark"] {
  --jm-paper: #0e0e0e;
  --jm-paper-2: #181818;
  --jm-ink: #f2f2f2;
  --jm-ink-2: #cfcfcf;
  --jm-muted: #9a9a9a;
  --jm-faint: #8a8a8a;
  --jm-line: #2a2a2a;
  --jm-line-strong: #f2f2f2;
  --jm-danger: #ff6b6b;
  --jm-toast-bg: #2c2c2c;
  --jm-toast-ink: #f2f2f2;
  --jm-toast-line: #454545;
}
@media (prefers-color-scheme: dark) {
  .jm-stage[data-jm-theme="system"] {
    --jm-paper: #0e0e0e;
    --jm-paper-2: #181818;
    --jm-ink: #f2f2f2;
    --jm-ink-2: #cfcfcf;
    --jm-muted: #9a9a9a;
    --jm-faint: #8a8a8a;
    --jm-line: #2a2a2a;
    --jm-line-strong: #f2f2f2;
    --jm-danger: #ff6b6b;
    --jm-toast-bg: #2c2c2c;
    --jm-toast-ink: #f2f2f2;
    --jm-toast-line: #454545;
  }
}

.jm-popup {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 380px;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  background: var(--jm-paper);
  color: var(--jm-ink);
  font-family: var(--jm-font);
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--jm-line);
  border-radius: 8px;
  box-shadow: 0 14px 42px -12px rgba(0, 0, 0, 0.3);
  transform-origin: calc(100% - 26px) 0;
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.24s ease;
  z-index: 2;
}
.jm-popup.is-closed {
  transform: scale(0.6);
  opacity: 0;
  pointer-events: none;
}
.jm-popup :focus { outline: none; }
.jm-popup :focus-visible { outline: 2px solid var(--jm-ink); outline-offset: 2px; }

.jm-site, .jm-settings, .jm-scope, .jm-composer { flex: 0 0 auto; }

.jm-site {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 0;
}
.jm-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding-top: 4px;
  font-weight: 600;
}
.jm-host {
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jm-path {
  font-size: 12px;
  font-family: var(--jm-mono);
  font-weight: 400;
  color: var(--jm-muted);
  flex: 0 20 auto;
  min-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jm-actions { display: flex; gap: 2px; flex-shrink: 0; margin-right: -6px; }

.jm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--jm-muted);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.jm-icon-btn:hover { background: var(--jm-paper-2); color: var(--jm-ink); }
.jm-icon-btn[aria-expanded="true"] { background: var(--jm-paper-2); color: var(--jm-ink); }
.jm-icon-btn svg { width: 16px; height: 16px; display: block; }

.jm-settings {
  display: grid;
  gap: 8px;
  margin: 10px 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--jm-line);
  border-radius: 6px;
  background: var(--jm-paper-2);
}
.jm-set-row { display: flex; align-items: center; gap: 10px; }
.jm-set-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--jm-muted);
}
.jm-swatches { display: flex; gap: 8px; }
.jm-swatch {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  cursor: pointer;
}
.jm-swatch[data-accent="yellow"] { background: #ffe34d; }
.jm-swatch[data-accent="pink"]   { background: #ffb3d9; }
.jm-swatch[data-accent="green"]  { background: #b9f26b; }
.jm-swatch[data-accent="blue"]   { background: #9ad8ff; }
.jm-swatch[data-accent="orange"] { background: #ffb454; }
.jm-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--jm-paper), 0 0 0 4px var(--jm-ink);
}

.jm-seg {
  display: flex;
  border: 1px solid var(--jm-line-strong);
  border-radius: 4px;
  overflow: hidden;
  background: var(--jm-paper);
}
.jm-seg label {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--jm-muted);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.jm-seg label + label { border-left: 1px solid var(--jm-line-strong); }
.jm-seg label:hover { color: var(--jm-ink); background: var(--jm-paper-2); }
.jm-seg input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.jm-seg label:has(input:checked) {
  background: var(--jm-accent);
  color: var(--jm-accent-ink);
}
.jm-seg label:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--jm-ink); }
.jm-seg-sm { flex: 1 1 auto; }
.jm-seg-sm label { min-height: 24px; font-size: 11px; }

.jm-scope { margin: 10px 14px 0; }
.jm-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--jm-paper-2);
  color: var(--jm-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.jm-seg label:has(input:checked) .jm-count {
  background: rgba(0, 0, 0, 0.12);
  color: var(--jm-accent-ink);
}

.jm-composer { display: grid; gap: 6px; padding: 10px 14px 0; }
.jm-field {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--jm-line-strong);
  border-radius: 4px;
  background: var(--jm-paper);
  color: var(--jm-ink);
  font: inherit;
  line-height: 1.45;
}
.jm-field::placeholder { color: var(--jm-faint); }
textarea.jm-field {
  resize: none;
  min-height: calc(2 * 1.45em + 14px);
  max-height: 170px;
  overflow-y: auto;
}
textarea.jm-field:focus {
  outline: none;
  border-color: var(--jm-line-strong);
  box-shadow: 0 0 0 2px var(--jm-accent);
}
.jm-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.jm-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: -6px;
}
.jm-hint {
  font-size: 11px;
  color: var(--jm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--jm-line-strong);
  border-radius: 4px;
  background: var(--jm-paper);
  color: var(--jm-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.jm-btn:hover { background: var(--jm-paper-2); }
.jm-btn:active { transform: translateY(1px); }
.jm-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.jm-btn:disabled:hover { background: var(--jm-paper); }
.jm-btn-primary { background: var(--jm-ink); color: var(--jm-paper); border-color: var(--jm-ink); }
.jm-btn-primary:hover { background: var(--jm-ink-2); border-color: var(--jm-ink-2); }
.jm-btn-primary:disabled:hover { background: var(--jm-ink); border-color: var(--jm-ink); }
.jm-btn-sm { min-height: 26px; padding: 0 9px; font-size: 12px; }

.jm-notes {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-top: 10px;
  padding: 0 14px 10px;
  border-top: 1px solid var(--jm-line);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--jm-line) transparent;
}
.jm-list { list-style: none; margin: 0; padding: 0; }
.jm-note {
  position: relative;
  padding: 10px 0;
  border-top: 1px solid var(--jm-line);
}
.jm-note:first-child { border-top: 0; padding-top: 12px; }
.jm-note::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background-color 0.12s ease;
}
.jm-note:hover::before, .jm-note:focus-within::before { background: var(--jm-accent); }
@media (prefers-reduced-motion: no-preference) {
  .jm-note.is-new { animation: jm-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@keyframes jm-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.jm-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.jm-text .jm-line { min-height: 1.45em; }
.jm-task { display: flex; align-items: flex-start; gap: 8px; }
.jm-task-box {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-top: calc((1.45em - 15px) / 2);
  padding: 0;
  border: 1px solid var(--jm-line-strong);
  border-radius: 3px;
  background: var(--jm-paper);
  color: var(--jm-accent-ink);
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.jm-task-box svg { width: 11px; height: 11px; opacity: 0; transition: opacity 0.12s ease; }
.jm-task-box:hover { background: var(--jm-paper-2); }
.jm-task.is-done .jm-task-box { background: var(--jm-accent); }
.jm-task.is-done .jm-task-box svg { opacity: 1; }
.jm-task.is-done .jm-task-text {
  color: var(--jm-muted);
  text-decoration: line-through;
  text-decoration-color: var(--jm-faint);
}
.jm-task-text { min-width: 0; overflow-wrap: anywhere; }

.jm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--jm-muted);
}
.jm-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.jm-prog { font-variant-numeric: tabular-nums; }
.jm-nact {
  display: inline-flex;
  gap: 10px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.jm-note:hover .jm-nact, .jm-note:focus-within .jm-nact { opacity: 1; }
@media (hover: none) {
  .jm-nact { opacity: 1; }
  .jm-task-box { position: relative; }
  .jm-task-box::before { content: ""; position: absolute; inset: -5px; }
}
.jm-link-btn {
  padding: 2px 4px;
  margin: 0 -4px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--jm-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.jm-link-btn:hover { color: var(--jm-ink); text-decoration: underline; text-underline-offset: 2px; }
.jm-link-btn.is-danger:hover { color: var(--jm-danger); }

.jm-editor { display: grid; gap: 6px; }
.jm-editor textarea { min-height: 60px; max-height: 200px; }
.jm-editor-row { display: flex; justify-content: flex-end; gap: 6px; }

.jm-empty {
  padding: 22px 0;
  margin: 0;
  color: var(--jm-muted);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}
.jm-empty strong { color: var(--jm-ink); font-weight: 600; }

.jm-toast {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) translateY(6px);
  padding: 6px 10px;
  border: 1px solid var(--jm-toast-line);
  border-radius: 4px;
  background: var(--jm-toast-bg);
  color: var(--jm-toast-ink);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 10;
}
.jm-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.jm-popup:has(.jm-toast.is-visible) .jm-notes { padding-bottom: 44px; }
.jm-toast-action {
  margin-left: 4px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--jm-accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- All notes / privacy / colophon ---------------- */

.split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.split-txt p {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--body);
  max-width: 44ch;
}
.shot {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--hair);
  border-radius: 12px;
}

.privgrid {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.priv-txt { display: grid; gap: 14px; }
.priv-txt p {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--body);
  max-width: none;
}
.perms table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}
.perms tr + tr th, .perms tr + tr td { border-top: 1px solid var(--hair); }
.perms th {
  text-align: left;
  vertical-align: top;
  padding: 12px 18px 12px 0;
  font-weight: 400;
  white-space: nowrap;
}
.perms th code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #f1f1ec;
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 2px 7px;
}
.perms td { padding: 12px 0; color: var(--body); vertical-align: top; }
.perms-note {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mut-2);
  line-height: 1.7;
}

.colophon p {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: var(--body);
  max-width: var(--measure);
  border-top: 1px solid var(--hair);
  padding-top: 40px;
}
.colophon a { color: var(--ink); text-underline-offset: 3px; }

.foot { padding-bottom: 48px; }
.back-foot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
}
.back-foot:hover { text-decoration: underline; }
.back-foot svg { vertical-align: -1px; margin-right: 3px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 880px) {
  .split, .privgrid { grid-template-columns: 1fr; }
  .split { gap: 26px; }
  .shot { order: 2; }
}

@media (max-width: 720px) {
  .back { top: 18px; left: 18px; }
  .hero { padding-top: 92px; }
  .tab .tlabel { max-width: 64px; }
  .tab[aria-pressed="true"] .tlabel { max-width: 130px; }
  .tab { padding: 8px 10px; }
  .chrome { gap: 10px; }
  .nav-glyphs svg:nth-child(2) { display: none; }
  .viewport { height: 540px; }
  .jm-popup {
    top: auto;
    bottom: 12px;
    right: 10px;
    max-width: calc(100% - 20px);
    transform-origin: 50% 100%;
  }
  .skel { padding: 22px 18px; }
  .sk-side { width: 84px; }
}

@media (max-width: 560px) {
  .tab[aria-pressed="false"] { padding: 8px 10px; }
  .tab[aria-pressed="false"] .tlabel { display: none; }
  .tab[aria-pressed="true"] .tlabel { max-width: none; }
  .perms tr, .perms th, .perms td { display: block; }
  .perms th { padding: 0 0 6px; }
  .perms td { padding: 0 0 14px; }
  .perms tr + tr th { border-top: 1px solid var(--hair); padding-top: 14px; }
  .perms tr + tr td { border-top: 0; }
}

@media (max-width: 380px) {
  .ctas .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand, .hero h1, .sub, .ctas { animation: none; opacity: 1; }
  .hl { animation: none; background-size: 100% 40%; }
  .jm-popup, .btn, .jm-btn, .jm-note::before, .jm-task-box, .jm-nact, .jm-toast, .tab, .ext-btn {
    transition: none !important;
    animation: none !important;
  }
}
