/* Kanzonas sites: one stylesheet, copied into home/, pdf/ and cad/
   (each folder is its own Cloudflare Pages project and only sees its own files).
   Keep the three copies identical. */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f1;
  --text: #16190f;
  --muted: #555b4e;
  --line: #dde2d6;
  --accent: #3e6b2a;
  --accent-dark: #2f5320;
  --sun: #f2b705;
  --radius: 12px;
  --us-bg: #eef4ea;               /* the comparison table's own column */
  --us-head: #dfead6;
  --max: 1040px;
}

/* Each app's site in its own color (the color of its icon and of its name in its logo):
   cad.kanzonas.com (and its card on kanzonas.com) is violet; the rest keeps the green. */
body[data-site="cad"], .card[data-site="cad"] {
  --accent: #5e43a3;
  --accent-dark: #45307d;
  --bg-soft: #f5f3fa;
  --us-bg: #f1edf9;
  --us-head: #e4dcf3;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; height: auto; display: block; }

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

/* Top bar */
.top {
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 30px; }
.nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

/* Hero */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero .logo {
  margin: 0 auto 28px;
  width: 100%;
  max-width: 560px;
}
.hero .mark {
  margin: 0 auto 20px;
  width: 120px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero .lead {
  font-size: clamp(18px, 2.4vw, 21px);
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 28px;
}

/* Buttons */
.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  padding: 14px 28px;
  border-radius: 999px;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:focus-visible, .nav a:focus-visible, .card:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}
.btn-note {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.alt-links {
  font-size: 15px;
  margin: 0;
}
.alt-links a { font-weight: 600; }
.trust-note {
  max-width: 640px;
  margin: 10px auto 2px;
  padding: 12px 16px;
  border: 1px solid #ecd9a0;
  border-left: 4px solid var(--sun);
  border-radius: 8px;
  background: #fffaeb;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.trust-note p { margin: 0 0 6px; }
.trust-note p:last-child { margin-bottom: 0; }
.listed { margin: 6px 0 0; }
.listed img { margin: 0 auto; }

/* Sections */
section { padding: 40px 0; }
section.soft { background: var(--bg-soft); }
h2 {
  font-size: 26px;
  margin: 0 0 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.feature h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.feature p { margin: 0; color: var(--muted); font-size: 16px; }

.facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
}
.facts li {
  padding-left: 22px;
  position: relative;
}
.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sun);
}

/* App cards on the home page */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(30, 50, 20, 0.10);
  color: var(--text);
}
.card img { width: 96px; }
.card h2 { margin: 4px 0 0; font-size: 24px; }
.card p { margin: 0; color: var(--muted); }
.card .go { color: var(--accent); font-weight: 700; margin-top: auto; }

.section-lead {
  color: var(--muted);
  max-width: 760px;
  margin: -8px 0 20px;
}

/* Comparison table: scrolls on its own on narrow screens, never the page */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
table.compare {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}
.compare th, .compare td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { background: var(--bg-soft); font-size: 14px; }
.compare tbody th { font-weight: 600; width: 26%; }
/* the feature names stay in view while the table scrolls sideways on a phone */
.compare tbody th, .compare thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
  box-shadow: 1px 0 0 var(--line);
}
.compare thead th:first-child { background: var(--bg-soft); }
.compare .us { background: var(--us-bg); font-weight: 600; }
.compare thead .us { background: var(--us-head); color: var(--accent-dark); }
.table-note { font-size: 13px; color: var(--muted); margin: 10px 0 18px; }
.sources { font-size: 13px; color: var(--muted); margin: -8px 0 18px; }
.sources summary { cursor: pointer; font-weight: 600; }
.sources ul { margin: 8px 0 0; padding-left: 20px; }
.sources li { margin: 4px 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Screenshots: a grid of thumbnails; a click opens the viewer (gallery.js) */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.gallery li { width: 186px; }
.gallery a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;      /* every thumbnail the same shape; the viewer shows the whole picture */
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(30, 50, 20, 0.10);
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery a:hover img, .gallery a:focus-visible img {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(30, 50, 20, 0.18);
}
.gallery a:focus-visible { outline: 3px solid var(--sun); outline-offset: 4px; border-radius: 8px; }
.gallery span { display: block; margin-top: 8px; text-align: center; }
.gallery-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0d0b;
  color: #fff;
}
.viewer::backdrop { background: #0b0d0b; }
.viewer-stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 64px 20px;
  gap: 12px;
}
.viewer-img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  border-radius: 6px;
  background: #fff;
}
.viewer-caption { margin: 0; max-width: 900px; text-align: center; font-size: 15px; line-height: 1.45; }
.viewer-count { margin: 0; font-size: 13px; color: #b8bdb2; }
.viewer button {
  position: absolute;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  width: 48px;
  height: 48px;
  cursor: pointer;
}
.viewer button:hover { background: rgba(255, 255, 255, 0.26); }
.viewer button:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.viewer-close { top: 12px; right: 12px; }
.viewer-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 520px) {
  .viewer-stage { padding: 56px 8px 72px; }
  .viewer-prev, .viewer-next { top: auto; bottom: 14px; transform: none; }
  .viewer-prev { left: calc(50% - 60px); }
  .viewer-next { right: calc(50% - 60px); }
  .gallery { gap: 10px; }
  .gallery li { width: calc(50% - 5px); }
  .gallery span { font-size: 13px; }
}

/* What's new (the newest release's notes, filled in by download.js) */
.whatsnew h3 { font-size: 17px; margin: 18px 0 8px; }
.whatsnew h3:first-child { margin-top: 0; }
.notes ul { margin: 0; padding-left: 22px; }
.notes li { margin: 0 0 8px; color: var(--text); }
.notes code { font-size: 0.9em; background: var(--bg-soft); padding: 1px 4px; border-radius: 4px; }
.notes-more { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.notes-link { margin: 18px 0 0; font-size: 15px; }
.notes { max-width: 860px; }

/* Text pages (help, privacy, about) */
.doc { padding: 40px 0 56px; }
.doc .wrap { max-width: 820px; }
.doc h1 { font-size: clamp(30px, 5vw, 40px); margin: 0 0 8px; text-wrap: balance; }
.doc .lead { color: var(--muted); font-size: 19px; margin: 0 0 24px; }
.doc h2 { font-size: 23px; margin: 40px 0 12px; scroll-margin-top: 16px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 0 0 8px; }
.doc code { font-size: 0.88em; background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.doc-date { color: var(--muted); font-size: 14px; margin: -12px 0 8px; }
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 15px;
}
.toc a { font-weight: 600; }
table.compare.plain { min-width: 560px; }
table.compare.plain tbody th { width: 30%; }
.footer-links { flex-basis: 100%; }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  font-size: 14px;
  color: var(--muted);
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
footer p { margin: 0; }
footer .privacy { flex-basis: 100%; font-size: 13px; }

@media (max-width: 520px) {
  .hero { padding: 36px 0 28px; }
  .btn { width: 100%; text-align: center; }
  .actions { align-items: stretch; }
}
