/* SwarFlow site: shared system (tokens, chrome, document pages).
   Home-only styles live in home.css. Fonts are self-hosted (SIL OFL, see fonts/). */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrainsmono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FCFCE6;
  --surf: #F1F1DA;
  --surf2: #E6E6CD;
  --line: #E3E3CB;
  --text: #1B1B1A;
  --muted: #5E5E55;
  --acc: #3FD67A;
  --acc-hover: #36C46D;
  --acc-text: #157A3E;
  --acc-soft: rgba(63, 214, 122, .20);
  --acc-softer: rgba(63, 214, 122, .08);
  --ink: #1B1B1A;
  --cream: #FCFCE6;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --wrap: 1200px;
  --gutter: 40px;
  --bar-h: 64px;
  color-scheme: light dark;
}
@media (max-width: 900px) { :root { --gutter: 24px; } }
@media (max-width: 520px) { :root { --gutter: 16px; } }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surf: #1F1F1D;
    --surf2: #2B2B28;
    --line: #2A2A27;
    --text: #FCFCE6;
    --muted: #A9A99C;
    --acc-hover: #5BE08F;
    --acc-text: #3FD67A;
    --acc-soft: rgba(63, 214, 122, .14);
    --acc-softer: rgba(63, 214, 122, .06);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 24px);
  scrollbar-color: var(--surf2) var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--acc);
}
::selection { background: var(--acc); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
a { color: var(--acc-text); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
strong { font-weight: 700; }
code, kbd {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surf);
  padding: 2px 7px;
  border-radius: 7px;
  white-space: nowrap;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surf2); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--acc); color: var(--ink); font-weight: 700;
  padding: 10px 16px; border-radius: 12px; text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- the mark ---------- */
.mark { width: 34px; height: auto; overflow: visible; color: var(--text); flex: none; }
.mark rect { transform-box: fill-box; transform-origin: 50% 50%; }
.mark .c { fill: var(--acc); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  transition: box-shadow .3s var(--ease-out), background-color .3s var(--ease-out);
}
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar-in {
  height: var(--bar-h);
  max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 20px; letter-spacing: -0.02em; line-height: 1;
}
.brand .mark { width: 30px; }
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .mark rect { animation: bar-wave .7s var(--ease-in-out); }
  .brand:hover .mark rect:nth-child(2) { animation-delay: .03s; }
  .brand:hover .mark rect:nth-child(3) { animation-delay: .06s; }
  .brand:hover .mark rect:nth-child(4) { animation-delay: .09s; }
  .brand:hover .mark rect:nth-child(5) { animation-delay: .12s; }
  .brand:hover .mark rect:nth-child(6) { animation-delay: .15s; }
  .brand:hover .mark rect:nth-child(7) { animation-delay: .18s; }
  .brand:hover .mark rect:nth-child(8) { animation-delay: .21s; }
  .brand:hover .mark rect:nth-child(9) { animation-delay: .24s; }
}
@keyframes bar-wave {
  0%, 100% { transform: scaleY(1); }
  40% { transform: scaleY(.45); }
  70% { transform: scaleY(1.12); }
}
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600;
  position: relative; padding: 6px 0;
  transition: color .15s;
}
.nav a:not(.pill)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--acc); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.nav a:hover { color: var(--text); }
.nav a:not(.pill):hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--text); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--acc); color: var(--ink) !important; font-weight: 700 !important;
  padding: 9px 16px !important; border-radius: 999px; text-decoration: none;
  transition: background-color .15s, transform .15s var(--ease-out);
}
.pill:hover { background: var(--acc-hover); }
.pill:active { transform: scale(.97); }
@media (max-width: 640px) {
  .nav .pill { display: none; }
  .nav a { font-size: 14px; padding: 13px 0; }
  .nav a:not(.pill)::after { bottom: 7px; }
  .brand { font-size: 18px; }
}

/* reading progress, drawn at the bar's bottom edge */
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--acc);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  .progress { animation: progress-grow linear both; animation-timeline: scroll(root block); }
  @keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 24px;
  border-radius: 18px;
  font: 700 17px/1 var(--sans); letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap;
  background: var(--acc); color: var(--ink);
  transition: background-color .15s, transform .2s var(--ease-out);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { background: var(--acc-hover); }
.btn:active { transform: scale(.97); }
.btn-alt { background: var(--surf); color: var(--text); }
.btn-alt:hover { background: var(--surf2); }

/* ---------- footer ---------- */
.foot { margin-top: clamp(64px, 10vw, 128px); background: var(--surf); }
.foot-in {
  max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 40px;
  display: grid; grid-template-columns: 1fr auto; gap: 28px 40px; align-items: end;
}
.foot-brand .brand { font-size: 22px; }
.foot-brand p { margin: 12px 0 0; color: var(--muted); max-width: 34ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: flex-end; }
.foot-nav a { color: var(--text); font-weight: 600; text-decoration: none; font-size: 15px; }
.foot-nav a:hover { color: var(--acc-text); }
.foot-legal { grid-column: 1 / -1; margin: 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .foot-in { grid-template-columns: 1fr; }
  .foot-nav { justify-content: flex-start; }
}

/* ---------- document pages (privacy, terms, support) ---------- */
.doc-head { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(32px, 5vw, 56px); }
.doc-head h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 88px); line-height: .98; letter-spacing: -0.04em; font-weight: 800;
  max-width: 12ch;
}
.doc-meta {
  margin: 22px 0 0; color: var(--muted);
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.doc-meta span { display: inline-flex; align-items: center; gap: 8px; }
.doc-meta span + span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--acc); margin-right: 10px; }
.doc-head .lede { margin: 24px 0 0; max-width: 46ch; font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--muted); }

.doc-grid {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.doc-body { max-width: 68ch; min-width: 0; }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2 {
  position: relative;
  font-size: clamp(24px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -0.02em; font-weight: 700;
  margin: 72px 0 14px;
}
.doc-body h3 { font-size: 18px; line-height: 1.35; font-weight: 700; margin: 36px 0 8px; }
.doc-body p, .doc-body ul, .doc-body ol { margin: 0 0 18px; }
.doc-body ul, .doc-body ol { padding-left: 22px; }
.doc-body li { margin-bottom: 8px; padding-left: 4px; }
.doc-body li::marker { color: var(--acc-text); }

/* the brand's green centre bar marks the section you jumped to */
.doc-body h2::before {
  content: ""; position: absolute; left: -22px; top: .18em; bottom: .18em; width: 6px; border-radius: 3px;
  background: var(--acc); transform: scaleY(0); opacity: 0;
}
.doc-body h2:target::before, .doc-body h2.is-flash::before { animation: bar-flash 1.8s var(--ease-out); }
@keyframes bar-flash {
  0% { transform: scaleY(0); opacity: 1; }
  25% { transform: scaleY(1); opacity: 1; }
  75% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

.summary { background: var(--surf); border-radius: 22px; padding: 26px 28px 22px; margin: 0 0 8px; }
.summary .summary-title { margin: 0 0 12px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.summary ul { margin: 0 !important; padding-left: 0 !important; list-style: none; }
.summary li { position: relative; padding-left: 26px !important; }
.summary li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 8px;
  border-left: 2.5px solid var(--acc-text); border-bottom: 2.5px solid var(--acc-text);
  transform: rotate(-45deg) translateY(-2px);
}

.table-wrap { overflow-x: auto; margin: 0 0 20px; border-radius: 18px; }
.doc-body td { background: var(--surf); }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.doc-body th, .doc-body td { text-align: left; vertical-align: top; padding: 14px 18px; }
.doc-body th { font-weight: 700; font-size: 14px; color: var(--muted); background: var(--surf2); }
.doc-body tr + tr td { border-top: 1px solid var(--line); }
.doc-body td:first-child { font-weight: 600; width: 34%; }

/* on-this-page index with a sliding green bar */
.toc { position: sticky; top: calc(var(--bar-h) + 32px); max-height: calc(100vh - var(--bar-h) - 64px); overflow: auto; overscroll-behavior: contain; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc > summary {
  list-style: none; cursor: pointer;
  font-size: 15px; font-weight: 700; padding: 0 0 12px;
}
.toc > summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; counter-reset: none; }
.toc ol::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--surf2); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 7px 0; color: var(--muted); text-decoration: none;
  font-size: 14.5px; font-weight: 500; line-height: 1.35;
  transition: color .2s;
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); font-weight: 600; }
.toc-marker {
  position: absolute; left: 0; top: 0; width: 4px; border-radius: 2px; background: var(--acc);
  height: var(--h, 0px); transform: translateY(var(--y, 0px));
  transition: transform .45s var(--ease-out), height .45s var(--ease-out);
  pointer-events: none;
}
@media (min-width: 961px) {
  .toc > summary { pointer-events: none; }
}
@media (max-width: 960px) {
  .doc-grid { grid-template-columns: 1fr; gap: 8px; }
  .toc { position: static; max-height: none; background: var(--surf); border-radius: 18px; padding: 16px 20px; margin-bottom: 24px; }
  .toc > summary { padding: 0; display: flex; justify-content: space-between; align-items: center; }
  .toc > summary::after {
    content: ""; width: 14px; height: 14px; background: var(--text);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 5l5 5 5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 5l5 5 5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform .3s var(--ease-out);
  }
  .toc[open] > summary::after { transform: rotate(180deg); }
  .toc[open] > summary { padding-bottom: 12px; }
  .doc-body h2 { margin-top: 56px; }
  .doc-body h2::before { left: -14px; width: 5px; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .doc-body td:first-child { width: auto; }
  .summary { padding: 22px 20px 18px; }
}

/* FAQ (support) */
.faq-group { margin: 64px 0 0; }
.faq-group:first-of-type { margin-top: 48px; }
.faq-group > h2 { margin: 0 0 18px; }
.faq {
  background: var(--surf); border-radius: 18px; margin: 0 0 10px;
  interpolate-size: allow-keywords;
}
.faq > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; font-weight: 600; font-size: 17px; line-height: 1.4;
  border-radius: 18px;
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary:hover { color: var(--acc-text); }
.faq-icon { position: relative; width: 14px; height: 14px; flex: none; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 1px; background: currentColor;
  transition: transform .35s var(--ease-out);
}
.faq-icon::after { transform: rotate(90deg); }
.faq[open] .faq-icon::after { transform: rotate(0deg); }
.faq[open] .faq-icon::before { transform: rotate(180deg); }
.faq-body { padding: 0 22px 6px; color: var(--text); }
.faq-body > :first-child { margin-top: 0; }
.faq::details-content {
  block-size: 0; overflow: clip;
  transition: block-size .4s var(--ease-out), content-visibility .4s allow-discrete;
}
.faq[open]::details-content { block-size: auto; }

.contact-card {
  display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: center;
  background: var(--ink); color: var(--cream); border-radius: 26px; padding: 30px 32px;
}
.contact-card h2 { margin: 0 0 6px !important; font-size: 24px; color: var(--cream); }
.contact-card p { margin: 0 !important; color: #A9A99C; }
.contact-card .btn { background: var(--acc); color: var(--ink); }
.contact-card h2::before { display: none; }
@media (prefers-color-scheme: dark) {
  .contact-card { box-shadow: inset 0 0 0 1px var(--line); }
}
@media (max-width: 640px) {
  .contact-card { grid-template-columns: 1fr; padding: 26px 22px; }
}

/* ---------- reduced motion: keep colour and state, drop travel ---------- */
@media (prefers-reduced-motion: reduce) {
  .toc-marker { transition: opacity .2s; }
  .nav a:not(.pill)::after { transition: none; }
  .faq::details-content { transition: none; }
  .faq-icon::before, .faq-icon::after { transition: none; }
  .doc-body h2:target::before, .doc-body h2.is-flash::before { animation: bar-fade 1.6s ease-out; transform: scaleY(1); }
  @keyframes bar-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
  .btn:active, .pill:active { transform: none; }
}
