/* Nearleaf public pages: home, terms, privacy, 404. /pair keeps using style.css.
   Palette mirrors designsystem/NearleafTheme.kt. No images or web fonts on purpose. */
:root {
  color-scheme: light dark;
  --bg: #f5f8f2;
  --surface: #fff;
  --text: #202e29;
  --muted: #586c62;
  --accent: #2d6655;
  --on-accent: #fff;
  --subtle: #e2efe5;
  --border: #cedbd1;
  --warning: #865b20;
  --highlight: #f6e8c8;
  --wash: rgb(138 218 170 / 0.3);
  --shadow: rgb(32 46 41 / 0.14);
  --live: #28b583;
  --live-ring: rgb(40 181 131 / 0.28);
  --display:
    ui-rounded, "SF Pro Rounded", Quicksand, Nunito, "Varela Round", system-ui,
    sans-serif;
  --body:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141e1a;
    --surface: #1e2a23;
    --text: #eff6ed;
    --muted: #b3c8b8;
    --accent: #9cd5b1;
    --on-accent: #17251e;
    --subtle: #2a4033;
    --border: #42594a;
    --warning: #f2c982;
    --highlight: #51442b;
    --wash: rgb(40 181 131 / 0.16);
    --shadow: rgb(0 0 0 / 0.5);
    --live: #6fe0ae;
    --live-ring: rgb(111 224 174 / 0.25);
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(70rem 36rem at 88% -8%, var(--wash), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.wrap {
  width: min(100% - 2.5rem, 70rem);
  margin-inline: auto;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.25rem;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--accent);
  color: var(--on-accent);
}
.skip:focus {
  top: 1rem;
}
.ic {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  text-wrap: balance;
}

/* Top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand .mark {
  width: 2rem;
  height: 2rem;
}
.bar nav {
  display: flex;
  gap: 0.25rem;
}
.bar nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}
.bar nav a[aria-current="page"] {
  background: var(--subtle);
  color: var(--text);
}
.bar nav a:hover {
  background: var(--subtle);
  color: var(--text);
}

/* Home: the note is the page */
.stage {
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4.5rem);
}
.sheet {
  --pad: clamp(1.25rem, 4vw, 2.75rem);
  position: relative;
  width: min(100%, 38rem);
  margin-inline: auto;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2.25rem;
  background: var(--subtle);
  transform: rotate(-1.6deg) translate(-0.5rem, 0.6rem);
}
.note {
  position: relative;
  padding: var(--pad);
  padding-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 2.25rem;
  background: var(--surface);
  box-shadow: 0 2.5rem 4rem -2rem var(--shadow);
}
.note-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1;
}
.note-top .mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}
.sync {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-ring);
}
.editor {
  font-family: var(--display);
  font-size: clamp(1.1875rem, 1rem + 0.9vw, 1.5rem);
  line-height: 1.62;
  letter-spacing: -0.005em;
}
.ln {
  position: relative;
  margin: 0 0 1.1rem;
  text-wrap: pretty;
}
.ln:last-child {
  margin-bottom: 0;
}
.ln.pitch {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--border);
}
.ln.pitch strong {
  font-weight: 600;
}
mark.merged {
  padding: 0.05em 0.25em;
  border-radius: 0.3em;
  background: var(--highlight);
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--warning);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.caret {
  display: inline-block;
  width: 0.12em;
  height: 1.05em;
  margin-left: 0.12em;
  vertical-align: -0.16em;
  border-radius: 2px;
  background: var(--accent);
}

/* Margin notes beside the sample note */
.ann {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 12.5rem;
  color: var(--accent);
  font-family: var(--body);
  font-size: 1rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  transform: translateY(-50%);
}
.ann svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}
.ann .a-side {
  width: 4.25rem;
  height: 2.25rem;
}
.ann .a-stack {
  display: none;
  width: 1.75rem;
  height: 1.25rem;
}
.ann.r {
  left: calc(100% + var(--pad) - 0.25rem);
}
.ann.l {
  right: calc(100% + var(--pad) - 0.25rem);
  flex-direction: row-reverse;
  text-align: right;
}
.ann.r .a-side {
  transform: translateY(0.35rem);
}
.ann.l .a-side {
  transform: scaleX(-1) translateY(0.35rem);
}

.under {
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  text-align: center;
}
.lead {
  max-width: 34rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.6;
}
.under .lead {
  max-width: 30rem;
  margin: 0 auto 1.5rem;
  font-size: 1.125rem;
  text-wrap: balance;
}
.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.soon-pill::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--subtle);
}

/* Home: what the server holds */
.server {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
}
.server h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.625rem, 1.1rem + 2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.server .intro {
  max-width: 34rem;
  margin: 0 0 2.25rem;
  color: var(--muted);
}
.pair {
  display: grid;
  gap: 1.25rem;
}
.pane {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1.25rem 1.5rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  background: var(--surface);
}
.pane header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}
.pane header .ic,
.pane footer .ic {
  color: var(--accent);
}
.pane .snippet {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.6;
}
.pane.srv {
  border-color: transparent;
  background: var(--subtle);
}
.cts {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.9;
  word-break: break-all;
}
.ct {
  display: inline-block;
  padding: 0.02rem 0.4rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  letter-spacing: 0.04em;
}
.pane footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.1rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.pane footer .ic {
  width: 1.1rem;
  height: 1.1rem;
}
.pane.srv footer .ic {
  color: var(--muted);
}
.link-arrow {
  display: grid;
  place-items: center;
  color: var(--accent);
}
.link-arrow .ic {
  width: 1.75rem;
  height: 1.75rem;
}
.promise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 1.75rem 0 0;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
}
.promise span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 40rem;
}
.promise .ic {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}
.promise a {
  font-family: var(--body);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Footer */
.foot {
  margin-top: 1rem;
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}
.foot .wrap {
  display: grid;
  gap: 1.25rem;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.foot p {
  margin: 0;
}

/* Legal documents */
.doc {
  width: min(100% - 2.5rem, 44rem);
  margin-inline: auto;
  padding-block: clamp(1.5rem, 5vw, 3.5rem) 2rem;
}
.doc h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 1.4rem + 4.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.doc .meta {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.summary {
  margin: 0 0 2rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 0.35rem solid var(--accent);
  border-radius: 1rem;
  background: var(--surface);
}
.summary h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
}
.summary ul {
  margin: 0;
  padding-left: 1.2rem;
}
.summary li + li {
  margin-top: 0.5rem;
}
.toc {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: var(--subtle);
  font-size: 0.9375rem;
}
.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol {
  margin: 0;
  padding-left: 1.4rem;
  columns: 16rem;
  column-gap: 2rem;
}
.toc li {
  padding-block: 0.15rem;
  break-inside: avoid;
}
.doc-body {
  counter-reset: clause;
}
.doc-body section {
  margin-block: 2.5rem 0;
  scroll-margin-top: 1rem;
}
.doc-body h2 {
  counter-increment: clause;
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.doc-body h2::before {
  content: counter(clause) ".";
  margin-right: 0.5rem;
  color: var(--accent);
}
.doc-body h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
}
.doc-body p {
  margin: 0 0 1rem;
}
.doc-body ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}
.doc-body li {
  padding-left: 0.2rem;
}
.doc-body li + li {
  margin-top: 0.45rem;
}
.doc-body li::marker {
  color: var(--accent);
}
.facts {
  margin: 0 0 1rem;
  border-top: 1px solid var(--border);
}
.facts dt {
  margin-top: 0.9rem;
  font-weight: 650;
}
.facts dd {
  margin: 0.15rem 0 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.callout {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--warning);
  border-radius: 1rem;
  background: var(--highlight);
}
.callout p:last-child {
  margin-bottom: 0;
}
.todo {
  padding: 0.1em 0.4em;
  outline: 2px dashed #c00;
  background: #ff0;
  color: #000;
  font-family: var(--mono);
  font-size: 0.9em;
}
time {
  white-space: nowrap;
}

/* 404 */
.lost {
  padding-block: clamp(3rem, 12vw, 8rem);
  max-width: 34rem;
}
.lost .mark {
  width: 5rem;
  height: 5rem;
  margin-bottom: 1.5rem;
}
.lost h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.2rem + 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

@media (min-width: 52rem) {
  .pair {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
  }
  .link-arrow .down {
    display: none;
  }
}
@media (min-width: 56rem) {
  .foot .wrap {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}
@media (max-width: 51.99rem) {
  .link-arrow .right {
    display: none;
  }
}
@media (max-width: 66rem) {
  .ann,
  .ann.r,
  .ann.l {
    position: static;
    left: auto;
    right: auto;
    width: auto;
    margin: 0.4rem 0 0.2rem;
    font-size: 0.9375rem;
    flex-direction: row;
    text-align: left;
    transform: none;
  }
  .ann .a-side {
    display: none;
  }
  .ann .a-stack {
    display: block;
    transform: translateY(-0.25rem);
  }
}
@media (max-width: 30rem) {
  .pane {
    padding-inline: 1.1rem;
  }
}
@media (max-width: 24rem) {
  .bar nav a {
    padding-inline: 0.6rem;
  }
  .summary,
  .toc {
    padding-inline: 1.1rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet,
  .under {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .under {
    animation-delay: 0.12s;
  }
  .dot {
    animation: breathe 3.6s ease-in-out infinite;
  }
  .caret {
    animation: blink 1.1s step-end infinite;
  }
}
@keyframes rise {
  from {
    opacity: 0.4;
    transform: translateY(0.75rem);
  }
}
@keyframes breathe {
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@media print {
  body {
    background: none;
    color: #000;
  }
  .bar nav,
  .toc,
  .skip {
    display: none;
  }
  a {
    color: inherit;
  }
}
