/* Bodhi Tree public site
 * Plain, calm pages for App Store metadata, support, and privacy review.
 */

:root {
  color-scheme: light dark;
  --bg: #f7efe1;
  --bg-alt: #efe3cf;
  --surface: #fffaf1;
  --surface-strong: #fffdf7;
  --border: #d9c8a8;
  --ink: #211c16;
  --muted: #655b4d;
  --faint: #8b7d69;
  --saffron: #b7651f;
  --saffron-strong: #8e4717;
  --sage: #4d6b55;
  --indigo: #393b61;
  --lotus: #99566a;
  --focus: #2458c7;
  --max-width: 820px;
  --wide-width: 1040px;
  --radius: 8px;
  --shadow: 0 18px 42px rgb(56 39 19 / 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171411;
    --bg-alt: #201b16;
    --surface: #211d18;
    --surface-strong: #28231d;
    --border: #40382c;
    --ink: #f1e8d5;
    --muted: #c4b69d;
    --faint: #978a77;
    --saffron: #e2a15d;
    --saffron-strong: #f1bc7a;
    --sage: #8cad92;
    --indigo: #a8acd8;
    --lotus: #d59aab;
    --focus: #8fb4ff;
    --shadow: 0 18px 42px rgb(0 0 0 / 0.28);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-alt) 52%, transparent), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea {
  letter-spacing: 0;
}

img,
svg {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
  transform: translateY(-140%);
  padding: 8px 12px;
  background: var(--surface-strong);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
.eyebrow,
.meta-list,
.toc,
.summary-grid,
.support-actions,
.button-link,
.contact-card,
.data-table,
.callout,
.page-note {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.site-header-inner,
.site-footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--saffron) 18%, transparent);
  color: var(--saffron-strong);
  font-size: 16px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 9px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--saffron) 11%, transparent);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 88px;
}

.page-hero {
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--saffron-strong);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.25rem, 2rem + 1.2vw, 3.1rem);
  font-weight: 760;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.35rem;
  font-weight: 740;
  margin: 42px 0 12px;
}

h3 {
  font-size: 1.04rem;
  font-weight: 720;
  margin: 28px 0 8px;
}

p {
  margin: 0 0 16px;
}

.lede {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.58;
}

a {
  color: var(--saffron-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 62%, transparent);
  outline-offset: 3px;
}

strong {
  color: var(--ink);
}

ul,
ol {
  margin: 0 0 18px;
  padding-left: 23px;
}

li {
  margin-bottom: 7px;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: color-mix(in srgb, var(--saffron) 18%, transparent);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--ink);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 38px 0;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.meta-list div {
  min-width: 0;
}

.meta-list dt {
  color: var(--faint);
  font-weight: 700;
}

.meta-list dd {
  margin: 2px 0 0;
}

.callout,
.contact-card,
.page-note,
.toc,
.summary-grid,
.data-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.callout {
  padding: 18px;
  box-shadow: var(--shadow);
}

.callout h2,
.contact-card h2,
.page-note h2 {
  margin-top: 0;
}

.callout p:last-child,
.contact-card p:last-child,
.page-note p:last-child {
  margin-bottom: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin: 24px 0 10px;
}

.summary-item {
  padding: 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.summary-item:nth-child(2n) {
  border-right: 0;
}

.summary-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.summary-item b {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--ink);
}

.summary-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.toc {
  padding: 16px 18px;
  margin: 30px 0 8px;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 18px;
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  overflow: hidden;
  margin: 18px 0 22px;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child th,
.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table th {
  width: 34%;
  color: var(--ink);
  background: color-mix(in srgb, var(--sage) 10%, transparent);
}

.contact-card {
  padding: 20px;
  margin: 26px 0 28px;
  box-shadow: var(--shadow);
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--ink);
  background: var(--surface-strong);
  text-decoration: none;
  font-weight: 720;
  font-size: 14px;
}

.button-link.primary {
  border-color: color-mix(in srgb, var(--saffron) 38%, var(--border));
  background: var(--saffron-strong);
  color: #fffaf1;
}

.button-link:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.page-note {
  padding: 16px 18px;
  margin: 24px 0;
}

.compact-list {
  margin-bottom: 0;
}

.question-list h3 {
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
}

.question-list h3:first-child {
  border-top: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  font-size: 14px;
}

.site-footer-inner {
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

/* Landing page */

.hero {
  padding-top: 14px;
}

.hero-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--saffron-strong);
  background: color-mix(in srgb, var(--saffron) 17%, transparent);
  font-size: 28px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  margin: 0;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

@media (max-width: 720px) {
  main {
    padding: 42px 20px 68px;
  }

  .site-header-inner,
  .site-footer-inner {
    padding: 14px 20px;
  }

  .meta-list,
  .summary-grid,
  .toc ol,
  .feature-list {
    grid-template-columns: 1fr;
  }

  .summary-item,
  .summary-item:nth-child(2n),
  .summary-item:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .summary-item:last-child {
    border-bottom: 0;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table th {
    border-bottom: 0;
    padding-bottom: 4px;
  }

  .data-table td {
    padding-top: 4px;
  }
}

@media (max-width: 460px) {
  body {
    font-size: 16px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .site-nav {
    font-size: 13px;
  }

  .site-nav a {
    padding: 6px 7px;
  }

  h1 {
    font-size: 2rem;
  }
}
