/* roamtty.com. Colours follow the app icon: charcoal, ghost white, peach. No external fonts or scripts. */
:root {
  color-scheme: light dark;
  --bg: #faf8f5; --surface: #ffffff; --surface-2: #f2eee8; --fg: #25232a; --muted: #67626d; --rule: #e3ddd5;
  --accent: #b5562f; --accent-strong: #9a4522; --on-accent: #ffffff; --ghost: #3b3550; --code: #f0ebe4;
  --ok: #2f8a4c; --warn: #b7791f;
  --term-bg: #262728; --term-fg: #e8e6ef; --term-muted: #8f8b99; --term-card: #313234; --term-rule: #3d3e41;
  --radius: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Noto Sans Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1e20; --surface: #26272a; --surface-2: #2d2e31; --fg: #ece9f2; --muted: #a29eab; --rule: #393a3e;
    --accent: #f0a27e; --accent-strong: #f5b899; --on-accent: #2a1a12; --ghost: #f7f5ff; --code: #2f3033;
    --ok: #6fcf8e; --warn: #f0c36b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.7 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); background: var(--code); padding: 1px 5px; border-radius: 5px; font-size: 0.88em; overflow-wrap: anywhere; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav .lang { border: 1px solid var(--rule); border-radius: 999px; padding: 2px 10px; color: var(--fg); }
@media (max-width: 560px) {
  .site-nav { gap: 12px; font-size: 14px; }
  .site-nav .opt:not(.keep) { display: none; }
}

/* Hero */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: 0.04em; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 52px); line-height: 1.15; margin: 0 0 18px; letter-spacing: -0.01em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store { display: inline-flex; align-items: center; gap: 10px; min-width: 190px; padding: 10px 18px; border-radius: 12px;
  background: var(--fg); color: var(--bg); text-decoration: none; line-height: 1.25; }
.store:hover { color: var(--bg); opacity: 0.9; }
.store svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.store small { display: block; font-size: 12px; opacity: 0.75; }
.store strong { font-size: 17px; }
.store.soon { background: var(--surface-2); color: var(--muted); cursor: default; border: 1px dashed var(--rule); }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* Demo video above the screenshots. */
.demo-video { margin: 0 0 28px; }
.demo-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #17181a;
  border: 1px solid var(--rule); }

/* Real app screenshots, shown in a simple device frame. */
.device { margin: 0 auto; width: min(320px, 100%); padding: 8px; border-radius: 40px; background: #111214;
  box-shadow: 0 30px 60px -20px rgba(20, 16, 30, 0.45); }
.device img, .shot img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 20; border-radius: 32px; background: var(--term-bg); }
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 18px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 12px; overscroll-behavior-x: contain; }
.shots.wide { grid-auto-columns: minmax(420px, 1fr); margin-top: 20px; }
.shots.wide .shot img { aspect-ratio: 20 / 9; }
.shot { margin: 0; scroll-snap-align: start; }
.shot img { border-radius: 22px; border: 6px solid #111214; box-shadow: 0 16px 32px -18px rgba(20, 16, 30, 0.5); }
.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Sections */
section.block { padding: 56px 0; }
section.block.alt { background: var(--surface-2); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.25; margin: 0 0 10px; }
.section-head p { color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.feature h3 { font-size: 17px; margin: 10px 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.feature .fi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.feature .fi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.platform { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.platform h3 { margin: 0 0 4px; font-size: 19px; }
.platform .req { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.platform ul { margin: 0; padding-left: 20px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 20%, transparent); box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--ok) 70%, transparent); }
.cta { text-align: center; }
.cta p { color: var(--muted); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .shots { grid-auto-columns: 62%; }
  .shots.wide { grid-auto-columns: 88%; }
  .hero { padding-top: 40px; }
  .grid, .platforms, .checks { grid-template-columns: 1fr; }
  .store { flex: 1 1 100%; }
}

/* Document pages: privacy, terms, support. */
.doc { padding: 40px 0 64px; }
.doc h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.25; margin: 0 0 8px; }
.doc h2 { font-size: 21px; margin: 36px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.doc h3 { font-size: 17px; margin: 24px 0 6px; }
.doc .meta { color: var(--muted); font-size: 14px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border: 1px solid var(--rule); vertical-align: top; }
.doc th { background: var(--surface-2); }
.doc .anchor { display: none; }
.doc .policy + .policy { margin-top: 72px; padding-top: 40px; border-top: 2px solid var(--rule); }
.toc { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; margin: 0 0 24px; }
.toc a { border: 1px solid var(--rule); border-radius: 999px; padding: 3px 12px; text-decoration: none; }
.contact-box { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; }
.contact-box .mail { font-size: 20px; font-weight: 600; }
details { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 6px; }
details p, details ul { margin: 6px 0; }

/* Documentation: a sticky contents column beside the text on wide screens, a contents box above it on narrow ones. */
.doc pre { background: var(--code); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.doc pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.doc h4 { font-size: 16px; margin: 20px 0 6px; }
.doc li + li { margin-top: 4px; }
.note { background: color-mix(in srgb, var(--accent) 10%, transparent); border-left: 3px solid var(--accent); padding: 10px 14px;
  border-radius: 0 10px 10px 0; }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs-body { max-width: 780px; min-width: 0; }
.docs-toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14px; padding-top: 6px; }
.docs-toc .toc-title { font-weight: 700; margin: 0 0 8px; }
.docs-toc ol { list-style: none; margin: 0; padding: 0; }
.docs-toc ol ol { padding-left: 12px; margin: 2px 0 4px; border-left: 1px solid var(--rule); }
.docs-toc li + li { margin-top: 0; }
.docs-toc a { display: block; padding: 3px 0 3px 8px; color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--fg); }
.docs-body h2, .docs-body h3 { scroll-margin-top: 76px; }
.steps { padding-left: 22px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 28px; align-items: start; }
.pair > div { min-width: 0; }
.pair > div > :first-child { margin-top: 0; }
.figs { display: grid; grid-template-columns: repeat(auto-fill, 190px); gap: 20px; margin: 16px 0 8px; }
.pair figure, .figs figure { margin: 0; }
.pair figure img, .figs img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 20; border-radius: 18px;
  border: 5px solid #111214; background: var(--term-bg); box-shadow: 0 14px 28px -18px rgba(20, 16, 30, 0.5); }
.figs.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.figs.wide img { aspect-ratio: 20 / 9; }
.pair figcaption, .figs figcaption { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    padding: 14px 16px; }
  .docs-toc > ol { columns: 2; column-gap: 20px; }
  .docs-toc > ol > li { break-inside: avoid; }
}
@media (max-width: 640px) {
  .pair { grid-template-columns: 1fr; gap: 16px; }
  .pair figure { width: min(220px, 70%); margin: 0 auto; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 480px) {
  .docs-toc > ol { columns: 1; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }
.site-footer .tm { flex-basis: 100%; font-size: 12.5px; }

/* Blog: a list of post cards; posts reuse the documentation layout. */
.posts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.doc .posts li + li { margin-top: 0; }
.post-card { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px;
  color: var(--fg); text-decoration: none; }
.post-card:hover { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }
.post-card time { font-size: 13.5px; color: var(--muted); }
.doc .post-card h2 { font-size: 19px; line-height: 1.4; margin: 2px 0 6px; padding: 0; border: 0; color: var(--accent); }
.post-card p { margin: 0; color: var(--muted); font-size: 15px; }
.crumb { margin: 0 0 10px; font-size: 14px; }
.crumb a { text-decoration: none; }

/* Blog diagrams: inline SVG drawn with the colour tokens above, so they follow dark mode. Each figure has a landscape
   drawing and a portrait one for phones. */
.doc .diagram { margin: 22px 0; overflow-x: auto; }
.diagram svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
.diagram .wide { min-width: 560px; }
.diagram .tall { display: none; max-width: 420px; margin: 0 auto; }
@media (max-width: 600px) {
  .diagram .wide { display: none; }
  .diagram .tall { display: block; }
}
.diagram figcaption { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.diagram text { fill: var(--fg); font-size: 14px; }
.diagram .muted { fill: var(--muted); font-size: 12.5px; }
.diagram .bold { font-weight: 600; }
.diagram .mono { font-family: var(--mono); font-size: 13px; }
.diagram .acc { fill: var(--accent); }
.diagram .group { fill: var(--surface-2); stroke: var(--rule); }
.diagram .box { fill: var(--surface); stroke: var(--rule); stroke-width: 1.5; }
.diagram .hl { fill: color-mix(in srgb, var(--accent) 12%, var(--surface)); stroke: var(--accent); stroke-width: 1.5; }
.diagram .faded { opacity: 0.4; }
.diagram .knock { fill: var(--bg); }
.diagram .term { fill: var(--term-bg); }
.diagram .term-text { fill: var(--term-fg); font-family: var(--mono); font-size: 15px; }
.diagram .line { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.diagram .line-acc { stroke: var(--accent); stroke-width: 2; fill: none; }
.diagram .dash { stroke-dasharray: 5 4; }
.diagram .head { fill: var(--muted); }
.diagram .head-acc { fill: var(--accent); }
