/* Marketing pages (/, /products, /principles, /cost, /about, /privacy, /security, 404).
   Loads after tokens.css, base.css and components.css. Colors only through tokens. */

body.site { display: flex; flex-direction: column; min-height: 100dvh; font-size: var(--fs-16); line-height: var(--lh-read); }
body.site > main { flex: 1 0 auto; }
.wrap { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: var(--sp-4); }
@media (min-width: 768px) { .wrap { padding-inline: var(--sp-6); } }
h2[id], section[id] { scroll-margin-top: calc(var(--bar-h) + var(--sp-5)); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: var(--z-panel); background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--bar-h); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--text); text-decoration: none; font-size: var(--fs-20); font-weight: 600; letter-spacing: -0.01em; flex: none; border-radius: var(--r-input); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 32px; height: 32px; }
:root[data-theme="dark"] .brand .logo { background: var(--paper-tile); border-radius: var(--r-sm); padding: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .brand .logo { background: var(--paper-tile); border-radius: var(--r-sm); padding: 3px; } }

.site-nav ul { list-style: none; display: flex; gap: var(--sp-1); }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--ctl-md); padding: 0 var(--sp-3); border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-14); font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--state) 6%, transparent); }
.site-nav a[aria-current="page"] { color: var(--on-accent-container); background: var(--accent-container); font-weight: 600; }
.bar-actions { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; flex: none; }

@media (max-width: 899.98px) {
  .site-header .bar { flex-wrap: wrap; row-gap: 0; }
  .brand, .bar-actions { min-height: var(--ctl-xl); }
  .site-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .site-nav ul { padding: 0 0 var(--sp-2); }
  .site-nav a { min-height: var(--ctl-md); }
}
@media (max-width: 479.98px) {
  .brand .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bar-actions .btn { padding: 0 var(--sp-3); font-size: var(--fs-13); min-height: var(--ctl-md); }
}

/* ---------- hero (home) ---------- */
.hero { padding: var(--sp-8) 0 var(--sp-7); text-align: center; background: var(--surface); border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; justify-items: center; gap: var(--sp-4); }
.pron { margin: 0; color: var(--text-3); font-size: var(--fs-14); }
.hero h1, .page-head h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.hero h1 { max-width: 18ch; font-size: clamp(var(--fs-32), 6vw, var(--fs-56)); }
.hero .sub { max-width: 46ch; margin: 0; color: var(--text-2); font-size: var(--fs-20); line-height: 1.5; }

/* ---------- inner page heading ---------- */
.page-head { max-width: 760px; margin: 0 auto; padding: var(--sp-8) 0 var(--sp-3); text-align: center; }
.page-head h1 { font-size: clamp(var(--fs-32), 5vw, var(--fs-44)); margin-bottom: var(--sp-3); }
.page-head p { color: var(--text-2); font-size: var(--fs-20); line-height: 1.5; max-width: 52ch; margin-inline: auto; }

/* ---------- sections ---------- */
main section { padding-top: var(--sp-7); }
.page-head ~ section { max-width: 880px; margin-inline: auto; }
main section > h2 { font-size: var(--fs-24); margin-bottom: var(--sp-4); }
.note { margin: var(--sp-4) 0 0; color: var(--text-2); font-size: var(--fs-14); }
.prose { max-width: var(--w-read); }
.page-head ~ .prose { max-width: var(--w-read); }
.prose p { margin-bottom: var(--sp-4); }
.list { list-style: disc; padding-left: var(--sp-5); margin: 0 0 var(--sp-4); }
ol.list { list-style: decimal; }
.list li { padding: 2px 0; }
.list li::marker { color: var(--text-3); }

/* available apps */
.showcase { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.pcard { position: relative; display: grid; align-content: start; gap: var(--sp-2); padding: var(--sp-5); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-card); }
.pcard:hover, .pcard:focus-within { box-shadow: var(--shadow-1); }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--sp-2); }
.pcard .glyph { width: 48px; height: 48px; }
.pcard h3 { font-size: var(--fs-20); }
.pcard h3 a { color: var(--text); text-decoration: none; }
.pcard h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pcard h3 a:hover { text-decoration: underline; }
.pcard h3 a:focus-visible { outline: none; }
.pcard:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcard p { margin: 0; color: var(--text-2); font-size: var(--fs-14); }
.p-bin .tag { background: var(--moss-container); color: var(--on-moss-container); border-color: transparent; }
.p-docs .tag { background: var(--brick-container); color: var(--on-brick-container); border-color: transparent; }
.p-id .tag { background: var(--inkc-container); color: var(--on-inkc-container); border-color: transparent; }

/* planned and possible */
.offer { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.offer li { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.offer h3 { font-size: var(--fs-16); }
.offer p { margin: 0 0 var(--sp-2); color: var(--text-2); font-size: var(--fs-14); }
.offer .tag { margin-top: auto; }
.offer li.maybe { border-style: dashed; border-color: var(--line-strong); background: transparent; }
.offer li.maybe .tag { background: var(--warning-container); color: var(--on-warning-container); border-color: transparent; }

/* principles */
.principles { list-style: none; counter-reset: p; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--sp-3); }
.principles li { counter-increment: p; display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-card); font-weight: 500; }
.principles li::before { content: counter(p); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-container); color: var(--on-accent-container); font-size: var(--fs-13); font-weight: 600; }

/* cost terms */
.terms { margin: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--raised); }
.terms > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-4); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.terms > div:last-child { border-bottom: 0; }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--text-2); }
.terms .maybe dd { color: var(--on-warning-container); background: var(--warning-container); padding: 0 var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-14); font-weight: 600; }

/* ---------- privacy and security: readable column with a table of contents ---------- */
.doc-layout { max-width: var(--w-read); margin: 0 auto; }
.doc-layout section { max-width: none; }
.toc { margin: var(--sp-6) 0 0; padding: var(--sp-4) var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.toc-title { margin: 0 0 var(--sp-2); color: var(--text-3); font-size: var(--fs-13); font-weight: 600; }
.toc ol { list-style: none; display: grid; gap: 2px; }
.toc a { display: block; padding: var(--sp-1) 0; color: var(--text-2); font-size: var(--fs-14); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (min-width: 640px) and (max-width: 1099.98px) { .toc ol { grid-template-columns: 1fr 1fr; column-gap: var(--sp-5); } }
@media (min-width: 1100px) {
  .doc-layout { max-width: none; display: grid; grid-template-columns: 220px minmax(0, var(--w-read)); gap: var(--sp-7); justify-content: center; }
  .toc { position: sticky; top: calc(var(--bar-h) + var(--sp-5)); align-self: start; margin-top: var(--sp-7); padding: 0; background: none; border: 0; border-radius: 0; }
  .toc ol { gap: 0; border-left: 1px solid var(--line); }
  .toc a { padding: var(--sp-2) var(--sp-4); margin-left: -1px; border-left: 2px solid transparent; }
  .toc a:hover { border-left-color: var(--accent); text-decoration: none; }
  .doc-layout + * { margin-top: 0; }
}

.hashes { width: 100%; table-layout: fixed; border-collapse: collapse; font: var(--fs-12) / 1.5 var(--font-mono); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-input); }
.hashes th, .hashes td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.hashes th { font-family: var(--font-ui); font-weight: 600; color: var(--text-2); background: var(--surface); }
.hashes th:first-child { width: 38%; }

/* ---------- footer ---------- */
.site-footer { margin-top: var(--sp-8); padding: var(--sp-6) 0 var(--sp-7); background: var(--surface); border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); }
.site-footer p { margin: 0; color: var(--text-3); font-size: var(--fs-13); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.site-footer a { color: var(--text-2); font-size: var(--fs-14); text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current="page"] { color: var(--text); text-decoration: underline; }

@media (max-width: 767.98px) {
  .hero { padding: var(--sp-7) 0 var(--sp-6); }
  .hero .sub, .page-head p { font-size: var(--fs-16); }
  .page-head { padding-top: var(--sp-7); }
}
